Do not try to paint outside of the screen.

svn path=/branches/work/kwin_composite/; revision=606822
This commit is contained in:
Luboš Luňák 2006-11-21 22:22:48 +00:00
parent 9c4218d4bf
commit 2c9dd370d9
3 changed files with 10 additions and 4 deletions

View file

@ -111,8 +111,12 @@ void Scene::paintScreen( int* mask, QRegion* region )
*mask &= ~PAINT_SCREEN_REGION; *mask &= ~PAINT_SCREEN_REGION;
*region = infiniteRegion(); *region = infiniteRegion();
} }
else if(( *mask & PAINT_SCREEN_REGION ) == 0 ) else if( *mask & PAINT_SCREEN_REGION )
{ // force region to be full { // make sure not to go outside visible screen
*region &= QRegion( 0, 0, displayWidth(), displayHeight());
}
else
{ // whole screen, not transformed, force region to be full
*region = QRegion( 0, 0, displayWidth(), displayHeight()); *region = QRegion( 0, 0, displayWidth(), displayHeight());
} }
ScreenPaintData data; ScreenPaintData data;

View file

@ -467,8 +467,10 @@ void SceneOpenGL::waitSync()
} }
// actually paint to the screen (double-buffer swap or copy from pixmap buffer) // actually paint to the screen (double-buffer swap or copy from pixmap buffer)
void SceneOpenGL::flushBuffer( int mask, const QRegion& damage ) void SceneOpenGL::flushBuffer( int mask, QRegion damage )
{ {
if( mask & PAINT_SCREEN_REGION )// make sure not to go outside visible screen
damage &= QRegion( 0, 0, displayWidth(), displayHeight());
if( db ) if( db )
{ {
if( mask & PAINT_SCREEN_REGION ) if( mask & PAINT_SCREEN_REGION )

View file

@ -45,7 +45,7 @@ class SceneOpenGL
void initRenderingContext(); void initRenderingContext();
bool findConfig( const int* attrs, GLXFBConfig* config, VisualID visual = None ); bool findConfig( const int* attrs, GLXFBConfig* config, VisualID visual = None );
void waitSync(); void waitSync();
void flushBuffer( int mask, const QRegion& damage ); void flushBuffer( int mask, QRegion damage );
typedef GLuint Texture; typedef GLuint Texture;
GC gcroot; GC gcroot;
Drawable buffer; Drawable buffer;