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
This commit is contained in:
parent
24eacc4908
commit
949aa1a778
7 changed files with 16 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
4
scene.h
4
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 };
|
||||
|
|
Loading…
Reference in a new issue