kwin:remove PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_WITHOUT_FULL_REPAINTS

paintSimpleScreen can handle the affected effects now.

REVIEW: 103827
This commit is contained in:
Philipp Knechtges 2012-01-29 17:25:20 +01:00
parent 32a3c49630
commit ba39d1f917
7 changed files with 18 additions and 40 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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();
}

View file

@ -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 {

View file

@ -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

View file

@ -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 };