diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index 0ef154520a..6f0efb3d4a 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -88,9 +88,6 @@ bool InvertEffect::loadData() void InvertEffect::prePaintScreen(ScreenPrePaintData &data, int time) { - if (m_valid && (m_allWindows || !m_windows.isEmpty())) { - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS; - } effects->prePaintScreen(data, time); } diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 8fb0608031..74346ce786 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -75,8 +75,6 @@ void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags) void SlidingPopupsEffect::prePaintScreen(ScreenPrePaintData& data, int time) { - if (!mAppearingWindows.isEmpty() || !mDisappearingWindows.isEmpty()) - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS; effects->prePaintScreen(data, time); } diff --git a/effects/taskbarthumbnail/taskbarthumbnail.cpp b/effects/taskbarthumbnail/taskbarthumbnail.cpp index 1ce62332fd..ac68876faa 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -57,9 +57,6 @@ TaskbarThumbnailEffect::~TaskbarThumbnailEffect() void TaskbarThumbnailEffect::prePaintScreen(ScreenPrePaintData& data, int time) { - if (thumbnails.count() > 0) { - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS; - } effects->prePaintScreen(data, time); } diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp index c7d30febc1..4855570441 100644 --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -291,8 +291,6 @@ void WobblyWindowsEffect::prePaintScreen(ScreenPrePaintData& data, int time) // screen won't be repainted, resulting in artefacts. // Could we just set a subset of the screen to be repainted ? if (windows.count() != 0) { - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS; - m_updateRegion = QRegion(); } diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 491ec58506..6685ad2a3f 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -316,15 +316,7 @@ public: * Window will be painted with a lanczos filter. **/ PAINT_WINDOW_LANCZOS = 1 << 8, - /** - * Same as PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS but does not trigger - * full repaints of the screen. If this flag is used the effect has - * to ensure by itself that the correct areas are repainted. If not - * handled correctly it will cause rendering glitches. - * Use with care! - * @since 4.6 - **/ - PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS = 1 << 9 + // PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS = 1 << 9 has been removed }; enum Feature { diff --git a/scene.cpp b/scene.cpp index 24bc587b51..ecaad5dfd2 100644 --- a/scene.cpp +++ b/scene.cpp @@ -180,8 +180,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_SCREEN_WITH_TRANSFORMED_WINDOWS - | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS)) + if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) paintGenericScreen(mask, data); else paintSimpleScreen(mask, region); @@ -216,9 +215,9 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPaintData) // preparation step effects->prePaintWindow(effectWindow(w), data, time_diff); #ifndef NDEBUG - foreach (const WindowQuad & q, data.quads) - if (q.isTransformed()) + if (data.quads.isTransformed()) { kFatal(1212) << "Pre-paint calls are not allowed to transform quads!" ; + } #endif if (!w->isPaintingEnabled()) continue; @@ -228,8 +227,9 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPaintData) & (PAINT_WINDOW_TRANSLUCENT | PAINT_SCREEN_TRANSFORMED | PAINT_WINDOW_TRANSFORMED)); } - foreach (const Phase2Data & d, phase2) - paintWindow(d.window, d.mask, d.region, d.quads); + foreach (const Phase2Data & d, phase2) { + paintWindow(d.window, d.mask, d.region, d.quads); + } } // The optimized case without any transformations at all. @@ -237,12 +237,8 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPaintData) // to reduce painting and improve performance. void Scene::paintSimpleScreen(int orig_mask, QRegion region) { - // TODO PAINT_WINDOW_* flags don't belong here, that's why it's in the assert, - // perhaps the two enums should be separated - assert((orig_mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED - | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS - | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS - | PAINT_WINDOW_TRANSLUCENT | PAINT_WINDOW_OPAQUE)) == 0); + assert((orig_mask & (PAINT_SCREEN_TRANSFORMED + | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) == 0); QList< QPair< Window*, Phase2Data > > phase2data; QRegion dirtyArea = region; @@ -279,11 +275,9 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region) // preparation step effects->prePaintWindow(effectWindow(w), data, time_diff); #ifndef NDEBUG - foreach (const WindowQuad & q, data.quads) - if (q.isTransformed()) + if (data.quads.isTransformed()) { kFatal(1212) << "Pre-paint calls are not allowed to transform quads!" ; - if (data.mask & PAINT_WINDOW_TRANSFORMED) - kFatal(1212) << "PAINT_WINDOW_TRANSFORMED without PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS!"; + } #endif if (!w->isPaintingEnabled()) { w->suspendUnredirect(true); @@ -307,15 +301,18 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region) // In case there is a window with a higher stackposition which has translucent regions // (e.g. decorations) that still have to be drawn, we also have to repaint the current window // in these particular regions - data->region |= (upperTranslucentDamage & tlw->decorationRect().translated(tlw->pos())); - + if (!(data->mask & PAINT_WINDOW_TRANSFORMED)) { + data->region |= (upperTranslucentDamage & tlw->decorationRect().translated(tlw->pos())); + } else { + data->region |= upperTranslucentDamage; + } // subtract the parts which will possibly been drawn as part of // a higher opaque window data->region -= allclips; // Here we rely on WindowPrePaintData::setTranslucent() to remove // the clip if needed. - if (!data->clip.isEmpty()) { + if (!data->clip.isEmpty() && !(data->mask & PAINT_WINDOW_TRANSFORMED)) { // clip away the opaque regions for all windows below this one allclips |= data->clip; // extend the translucent damage for windows below this by remaining (translucent) regions diff --git a/scene.h b/scene.h index c227352522..b1e438a064 100644 --- a/scene.h +++ b/scene.h @@ -87,8 +87,7 @@ public: // PAINT_DECORATION_ONLY = 1 << 7 has been removed // Window will be painted with a lanczos filter. PAINT_WINDOW_LANCZOS = 1 << 8, - // same as PAINT_SCREEN_TRANSFORMED without full repainting - PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS = 1 << 9 + // PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS = 1 << 9 has been removed }; // types of filtering available enum ImageFilterType { ImageFilterFast, ImageFilterGood };