Clearing of the whole buffer is not necessary anymore, at least not
in the simple cases. Improves drawing performance. svn path=/branches/work/kwin_composite/; revision=608458
This commit is contained in:
parent
a4d6273de0
commit
2fa320c9b8
1 changed files with 19 additions and 4 deletions
|
@ -443,8 +443,6 @@ void SceneOpenGL::paint( QRegion damage, ToplevelList toplevels )
|
||||||
grabXServer();
|
grabXServer();
|
||||||
glXWaitX();
|
glXWaitX();
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glClearColor( 0, 0, 0, 1 );
|
|
||||||
glClear( GL_COLOR_BUFFER_BIT );
|
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
paintScreen( &mask, &damage ); // call generic implementation
|
paintScreen( &mask, &damage ); // call generic implementation
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
@ -540,9 +538,26 @@ void SceneOpenGL::paintGenericScreen( int mask, ScreenPaintData data )
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneOpenGL::paintBackground( QRegion )
|
void SceneOpenGL::paintBackground( QRegion region )
|
||||||
{
|
{
|
||||||
// TODO?
|
if( region == infiniteRegion())
|
||||||
|
{
|
||||||
|
glClearColor( 1, 1, 1, 1 ); // white
|
||||||
|
glClear( GL_COLOR_BUFFER_BIT );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glColor4f( 1, 1, 1, 1 ); // white
|
||||||
|
glBegin( GL_QUADS );
|
||||||
|
foreach( QRect r, region.rects())
|
||||||
|
{
|
||||||
|
glVertex2i( r.x(), r.y());
|
||||||
|
glVertex2i( r.x() + r.width(), r.y());
|
||||||
|
glVertex2i( r.x() + r.width(), r.y() + r.height());
|
||||||
|
glVertex2i( r.x(), r.y() + r.height());
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneOpenGL::windowAdded( Toplevel* c )
|
void SceneOpenGL::windowAdded( Toplevel* c )
|
||||||
|
|
Loading…
Reference in a new issue