From 949aa1a7787eda8abeb9213596fc3c4581e23d44 Mon Sep 17 00:00:00 2001 From: Philip Falkner Date: Sun, 11 Feb 2007 17:35:10 +0000 Subject: [PATCH] Add PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS flag, to be called by effects in prePaintScreen(). Indicates that some window(s) may have transformed geometry, so the whole screen should be repainted. svn path=/branches/work/kwin_composite/; revision=632580 --- effects/minimizeanimation.cpp | 6 +++--- effects/presentwindows.cpp | 6 +++--- effects/scalein.cpp | 3 +-- effects/shakymove.cpp | 2 +- effects/wavywindows.cpp | 6 +++--- scene.cpp | 4 ++-- scene.h | 4 +++- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/effects/minimizeanimation.cpp b/effects/minimizeanimation.cpp index a655cbbe50..ab295341c6 100644 --- a/effects/minimizeanimation.cpp +++ b/effects/minimizeanimation.cpp @@ -30,9 +30,9 @@ MinimizeAnimationEffect::MinimizeAnimationEffect() void MinimizeAnimationEffect::prePaintScreen( int* mask, QRegion* region, int time ) { if( mActiveAnimations > 0 ) - // We need to mark the screen as transformed. Otherwise the whole - // screen won't be repainted, resulting in artefacts - *mask |= Scene::PAINT_SCREEN_TRANSFORMED; + // We need to mark the screen windows as transformed. Otherwise the + // whole screen won't be repainted, resulting in artefacts + *mask |= Scene::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; effects->prePaintScreen(mask, region, time); } diff --git a/effects/presentwindows.cpp b/effects/presentwindows.cpp index 34133ea96e..3e1e6a518e 100644 --- a/effects/presentwindows.cpp +++ b/effects/presentwindows.cpp @@ -55,10 +55,10 @@ void PresentWindowsEffect::prePaintScreen( int* mask, QRegion* region, int time effectTerminated(); } - // We need to mark the screen as transformed. Otherwise the whole screen - // won't be repainted, resulting in artefacts + // We need to mark the screen windows as transformed. Otherwise the whole + // screen won't be repainted, resulting in artefacts if( mActiveness > 0.0f ) - *mask |= Scene::PAINT_SCREEN_TRANSFORMED; + *mask |= Scene::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; effects->prePaintScreen(mask, region, time); } diff --git a/effects/scalein.cpp b/effects/scalein.cpp index a889b5645f..5440c0136e 100644 --- a/effects/scalein.cpp +++ b/effects/scalein.cpp @@ -15,11 +15,10 @@ License. See the file "COPYING" for the exact licensing terms. namespace KWinInternal { -// TODO right now it's necessary to set PAINT_WINDOW_TRANSFORMED also here void ScaleInEffect::prePaintScreen( int* mask, QRegion* region, int time ) { if( !windows.isEmpty()) - *mask |= Scene::PAINT_WINDOW_TRANSFORMED; + *mask |= Scene::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; effects->prePaintScreen( mask, region, time ); } diff --git a/effects/shakymove.cpp b/effects/shakymove.cpp index cd7f3c5b83..e74acd5851 100644 --- a/effects/shakymove.cpp +++ b/effects/shakymove.cpp @@ -26,7 +26,7 @@ static const int SHAKY_MAX = sizeof( shaky_diff ) / sizeof( shaky_diff[ 0 ] ); void ShakyMoveEffect::prePaintScreen( int* mask, QRegion* region, int time ) { if( !windows.isEmpty()) - *mask |= Scene::PAINT_WINDOW_TRANSFORMED; + *mask |= Scene::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; effects->prePaintScreen( mask, region, time ); } diff --git a/effects/wavywindows.cpp b/effects/wavywindows.cpp index 626da17691..68f89993d2 100644 --- a/effects/wavywindows.cpp +++ b/effects/wavywindows.cpp @@ -34,9 +34,9 @@ void WavyWindowsEffect::prePaintScreen( int* mask, QRegion* region, int time ) { // Adjust elapsed time mTimeElapsed += (time / 1000.0f); - // We need to mark the screen as transformed. Otherwise the whole screen - // won't be repainted, resulting in artefacts - *mask |= Scene::PAINT_SCREEN_TRANSFORMED; + // We need to mark the screen windows as transformed. Otherwise the whole + // screen won't be repainted, resulting in artefacts + *mask |= Scene::PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; effects->prePaintScreen(mask, region, time); } diff --git a/scene.cpp b/scene.cpp index 01eb730bdc..6f176c212d 100644 --- a/scene.cpp +++ b/scene.cpp @@ -95,7 +95,7 @@ void Scene::paintScreen( int* mask, QRegion* region ) // preparation step effects->startPaint(); effects->prePaintScreen( mask, region, time_diff ); - if( *mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED )) + if( *mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS )) { // Region painting is not possible with transformations, // because screen damage doesn't match transformed positions. *mask &= ~PAINT_SCREEN_REGION; @@ -145,7 +145,7 @@ void Scene::idle() // the function that'll be eventually called by paintScreen() above void Scene::finalPaintScreen( int mask, QRegion region, ScreenPaintData& data ) { - if( mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED )) + if( mask & ( PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS )) paintGenericScreen( mask, data ); else paintSimpleScreen( mask, region ); diff --git a/scene.h b/scene.h index 8d15ff86f1..d7e5eb9fab 100644 --- a/scene.h +++ b/scene.h @@ -66,8 +66,10 @@ class Scene PAINT_SCREEN_REGION = 1 << 4, // Whole screen will be painted with transformed geometry. PAINT_SCREEN_TRANSFORMED = 1 << 5, + // At least one window will be painted with transformed geometry. + PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS = 1 << 6, // Clear whole background as the very first step, without optimizing it - PAINT_SCREEN_BACKGROUND_FIRST = 1 << 6 + PAINT_SCREEN_BACKGROUND_FIRST = 1 << 7 }; // types of filtering available enum ImageFilterType { ImageFilterFast, ImageFilterGood };