524
512
if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
525
513
paintRegion = infiniteRegion;
527
mGeometries.addGeometryForWindow (w, paintRegion);
529
#ifdef USE_MODERN_COMPIZ_GL
530
UnityDialogScreen *uds = UnityDialogScreen::get (screen);
531
GLWindowPaintAttrib attrib (gWindow->lastPaintAttrib());
532
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
533
/* Texture rendering set-up */
534
// uds->gScreen->setTexEnvMode(GL_MODULATE);
535
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
536
/* Draw the dim texture with all of it's modified
538
gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
539
gWindow->glDrawTexture(mTexture, transform, attrib, mask
540
| PAINT_WINDOW_BLEND_MASK
541
| PAINT_WINDOW_TRANSLUCENT_MASK
542
| PAINT_WINDOW_TRANSFORMED_MASK);
543
gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
544
/* Texture rendering tear-down */
545
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
546
uds->gScreen->setTexEnvMode(GL_REPLACE);
548
if (gWindow->geometry().vertices)
515
if (mGeometries.addGeometryForWindow (w, paintRegion))
550
UnityDialogScreen *uds = UnityDialogScreen::get (screen);
551
GLFragment::Attrib fa (gWindow->lastPaintAttrib());
552
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
553
/* Texture rendering set-up */
554
uds->gScreen->setTexEnvMode(GL_MODULATE);
555
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
556
/* Draw the dim texture with all of it's modified
558
gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
559
gWindow->glDrawTexture(mTexture, fa, mask | PAINT_WINDOW_BLEND_MASK
560
| PAINT_WINDOW_TRANSLUCENT_MASK |
561
PAINT_WINDOW_TRANSFORMED_MASK);
562
gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
563
/* Texture rendering tear-down */
564
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
565
uds->gScreen->setTexEnvMode(GL_REPLACE);
517
UnityDialogScreen *uds = UnityDialogScreen::get (screen);
518
GLWindowPaintAttrib attrib (gWindow->lastPaintAttrib());
519
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
520
/* Texture rendering set-up */
521
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
522
/* Draw the dim texture with all of it's modified
524
gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
525
gWindow->glDrawTexture(mTexture, transform, attrib, mask
526
| PAINT_WINDOW_BLEND_MASK
527
| PAINT_WINDOW_TRANSLUCENT_MASK
528
| PAINT_WINDOW_TRANSFORMED_MASK);
529
gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
530
/* Texture rendering tear-down */
531
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
532
uds->gScreen->setTexEnvMode(GL_REPLACE);
621
587
unity::PaintInfoCollector::drawGeometriesForWindow(CompWindow *w,
622
#ifdef USE_MODERN_COMPIZ_GL
623
588
const GLMatrix &transform,
627
591
for (unity::TexGeometryCollection &tcg : mCollection)
628
#if USE_MODERN_COMPIZ_GL
629
592
tcg.addGeometriesAndDrawTextureForWindow (w, transform, pm);
631
tcg.addGeometriesAndDrawTextureForWindow (w, pm);
635
595
unity::PaintInfoCollector * unity::PaintInfoCollector::active_collector = NULL;
674
626
GLTexture::MatrixList matl;
675
627
GLTexture::Matrix mat = tex->matrix();
676
#ifdef USE_MODERN_COMPIZ_GL
677
628
GLWindowPaintAttrib wAttrib(attrib);
680
630
/* We can reset the window geometry since it will be
681
631
* re-added later */
682
#ifdef USE_MODERN_COMPIZ_GL
683
632
gWindow->vertexBuffer()->begin();
685
gWindow->geometry().reset();
688
634
/* Scale the dim render by the ratio of dim size
689
635
* to window size */
704
650
* dim (so we get a nice render for things like
705
651
* wobbly etc etc */
706
652
gWindow->glAddGeometry(matl, reg, paintRegion);
707
#ifdef USE_MODERN_COMPIZ_GL
708
gWindow->vertexBuffer()->end();
711
#ifdef USE_MODERN_COMPIZ_GL
712
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
713
wAttrib.opacity = mShadeProgress;
714
/* Texture rendering set-up */
715
// uds->gScreen->setTexEnvMode(GL_MODULATE);
716
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
717
/* Draw the dim texture with all of it's modified
719
gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
720
gWindow->glDrawTexture(tex, transform, attrib, mask
721
| PAINT_WINDOW_BLEND_MASK
722
| PAINT_WINDOW_TRANSLUCENT_MASK
723
| PAINT_WINDOW_TRANSFORMED_MASK);
724
gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
725
/* Texture rendering tear-down */
726
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
727
uds->gScreen->setTexEnvMode(GL_REPLACE);
729
/* Did it succeed? */
730
if (gWindow->geometry().vertices)
653
if (gWindow->vertexBuffer()->end())
732
655
unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
733
fragment.setOpacity(mShadeProgress);
656
wAttrib.opacity = mShadeProgress;
734
657
/* Texture rendering set-up */
735
uds->gScreen->setTexEnvMode(GL_MODULATE);
658
// uds->gScreen->setTexEnvMode(GL_MODULATE);
736
659
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
737
660
/* Draw the dim texture with all of it's modified
738
661
* geometry glory */
739
662
gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
740
gWindow->glDrawTexture(tex, fragment, mask | PAINT_WINDOW_BLEND_MASK
741
| PAINT_WINDOW_TRANSLUCENT_MASK |
742
PAINT_WINDOW_TRANSFORMED_MASK);
663
gWindow->glDrawTexture(tex, transform, attrib, mask
664
| PAINT_WINDOW_BLEND_MASK
665
| PAINT_WINDOW_TRANSLUCENT_MASK
666
| PAINT_WINDOW_TRANSFORMED_MASK);
743
667
gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
744
668
/* Texture rendering tear-down */
745
669
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
746
670
uds->gScreen->setTexEnvMode(GL_REPLACE);
751
674
for (CompWindow* w : mTransients)