Move shared code to base class.
svn path=/branches/work/kwin_composite/; revision=598752
This commit is contained in:
parent
189ca6c3a2
commit
548eb09a74
4 changed files with 20 additions and 20 deletions
15
scene.cpp
15
scene.cpp
|
@ -41,6 +41,21 @@ Scene::~Scene()
|
|||
{
|
||||
}
|
||||
|
||||
// returns mask and possibly modified region
|
||||
void Scene::paintScreen( int* mask, QRegion* region )
|
||||
{
|
||||
*mask = ( *region == QRegion( 0, 0, displayWidth(), displayHeight()))
|
||||
? 0 : PAINT_SCREEN_REGION;
|
||||
WrapperEffect wrapper;
|
||||
// preparation step
|
||||
effects->prePaintScreen( mask, region, &wrapper );
|
||||
if( *mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED ))
|
||||
*mask &= ~PAINT_SCREEN_REGION;
|
||||
// TODO call also prePaintWindow() for all windows
|
||||
ScreenPaintData data;
|
||||
effects->paintScreen( *mask, *region, data, &wrapper );
|
||||
}
|
||||
|
||||
void Scene::WrapperEffect::prePaintScreen( int*, QRegion* )
|
||||
{
|
||||
// nothing, no changes
|
||||
|
|
1
scene.h
1
scene.h
|
@ -46,6 +46,7 @@ class Scene
|
|||
PAINT_SCREEN_TRANSFORMED = 1 << 4
|
||||
};
|
||||
protected:
|
||||
void paintScreen( int* mask, QRegion* region );
|
||||
virtual void paintGenericScreen( int mask, ScreenPaintData data );
|
||||
virtual void paintSimpleScreen( int mask, QRegion region );
|
||||
virtual void paintBackground( QRegion region ) = 0;
|
||||
|
|
|
@ -277,16 +277,8 @@ void SceneOpenGL::paint( QRegion damage, ToplevelList toplevels )
|
|||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
glScalef( 1, -1, 1 );
|
||||
glTranslatef( 0, -displayHeight(), 0 );
|
||||
int mask = ( damage == QRegion( 0, 0, displayWidth(), displayHeight()))
|
||||
? 0 : PAINT_SCREEN_REGION;
|
||||
WrapperEffect wrapper;
|
||||
// preparation step
|
||||
effects->prePaintScreen( &mask, &damage, &wrapper );
|
||||
if( mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED ))
|
||||
mask &= ~PAINT_SCREEN_REGION;
|
||||
// TODO call also prePaintWindow() for all windows
|
||||
ScreenPaintData data;
|
||||
effects->paintScreen( mask, damage, data, &wrapper );
|
||||
int mask = 0;
|
||||
paintScreen( &mask, &damage );
|
||||
stacking_order.clear();
|
||||
glPopMatrix();
|
||||
// TODO only partial repaint for mask & PAINT_SCREEN_REGION
|
||||
|
|
|
@ -84,16 +84,8 @@ void SceneXrender::paint( QRegion damage, ToplevelList toplevels )
|
|||
assert( windows.contains( c ));
|
||||
stacking_order.append( &windows[ c ] );
|
||||
}
|
||||
int mask = ( damage == QRegion( 0, 0, displayWidth(), displayHeight()))
|
||||
? 0 : PAINT_SCREEN_REGION;
|
||||
WrapperEffect wrapper;
|
||||
// preparation step
|
||||
effects->prePaintScreen( &mask, &damage, &wrapper );
|
||||
if( mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED ))
|
||||
mask &= ~PAINT_SCREEN_REGION;
|
||||
// TODO call also prePaintWindow() for all windows
|
||||
ScreenPaintData data;
|
||||
effects->paintScreen( mask, damage, data, &wrapper );
|
||||
int mask = 0;
|
||||
paintScreen( &mask, &damage );
|
||||
stacking_order.clear();
|
||||
if( mask & PAINT_SCREEN_REGION )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue