From a6d8bb41bb19bf661907ae4fb36f336f298e2759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 22 Feb 2009 11:27:08 +0000 Subject: [PATCH] Reactivating the use of a gl list for painting the cube. The cube is painted once without using the gl list. By that the problem of black windows on other desktops should be solved. If the black window problem appears again the patch will be reverted. CCBUG: 183905 svn path=/trunk/KDE/kdebase/workspace/; revision=929840 --- effects/cube/cube.cpp | 57 ++++++++++++++++++++++++++++++++++--------- effects/cube/cube.h | 1 + 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 4d4a063cf3..88d38c5927 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -315,6 +315,16 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) glPopMatrix(); } + // compile List for cube + if( useList ) + { + glNewList( glList + 1, GL_COMPILE ); + glPushMatrix(); + paintCube( mask, region, data ); + glPopMatrix(); + glEndList(); + } + QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop()); if( effects->numScreens() > 1 && bigCube ) rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() ); @@ -443,9 +453,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) } glPushMatrix(); glCallList( glList ); - glPushMatrix(); - paintCube( mask, region, data ); - glPopMatrix(); + if( useList ) + glCallList( glList + 1 ); + else + { + glPushMatrix(); + paintCube( mask, region, data ); + glPopMatrix(); + } glPopMatrix(); glCullFace( GL_BACK ); if( mode == Cylinder ) @@ -456,9 +471,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) } glPushMatrix(); glCallList( glList ); - glPushMatrix(); - paintCube( mask, region, data ); - glPopMatrix(); + if( useList ) + glCallList( glList + 1 ); + else + { + glPushMatrix(); + paintCube( mask, region, data ); + glPopMatrix(); + } glPopMatrix(); // cap @@ -552,9 +572,14 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) } glPushMatrix(); glCallList( glList ); - glPushMatrix(); - paintCube( mask, region, data ); - glPopMatrix(); + if( useList ) + glCallList( glList + 1 ); + else + { + glPushMatrix(); + paintCube( mask, region, data ); + glPopMatrix(); + } glPopMatrix(); glCullFace( GL_FRONT ); if( mode == Cylinder ) @@ -571,10 +596,17 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) } glPushMatrix(); glCallList( glList ); - glPushMatrix(); - paintCube( mask, region, data ); - glPopMatrix(); + if( useList ) + glCallList( glList + 1 ); + else + { + glPushMatrix(); + paintCube( mask, region, data ); + glPopMatrix(); + } glPopMatrix(); + // we painted once without glList, now it's safe to paint using lists + useList = true; // cap if( paintCaps && ( effects->numberOfDesktops() >= 2 )) @@ -1976,6 +2008,7 @@ void CubeEffect::setActive( bool active ) glList = glGenLists(3); capListCreated = false; recompileList = true; + useList = false; // create the capList if( paintCaps ) paintCap(); diff --git a/effects/cube/cube.h b/effects/cube/cube.h index 0056506462..7acdb0cc82 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -147,6 +147,7 @@ class CubeEffect float capDeformationFactor; bool useZOrdering; float zOrderingFactor; + bool useList; // GL lists bool capListCreated;