From f723f132ca1e6923579bb5c10538bcc084feb408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 12 Jul 2012 16:20:30 +0200 Subject: [PATCH] Drop support for explicit contents opacity from WindowPaintData No effect has ever made use of contents opacity. Which means it is not needed. Removing means faster effects as we used to multiply the value (always 1.0) with the opacity in each frame for each window. --- effects/blur/blur.cpp | 4 ++-- libkwineffects/kwineffects.cpp | 2 -- libkwineffects/kwineffects.h | 1 - scene_opengl.cpp | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 28ed0d593a..4852f76f83 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -394,9 +394,9 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai if (!shape.isEmpty()) { if (m_shouldCache && !translated) { - doCachedBlur(w, region, data.opacity * data.contents_opacity); + doCachedBlur(w, region, data.opacity); } else { - doBlur(shape, screen, data.opacity * data.contents_opacity); + doBlur(shape, screen, data.opacity); } } } diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index 586d759026..7428c6ac85 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -208,7 +208,6 @@ void PaintData::setRotationOrigin(const QVector3D &origin) WindowPaintData::WindowPaintData(EffectWindow* w) : PaintData() , opacity(w->opacity()) - , contents_opacity(1.0) , decoration_opacity(1.0) , saturation(1) , brightness(1) @@ -220,7 +219,6 @@ WindowPaintData::WindowPaintData(EffectWindow* w) WindowPaintData::WindowPaintData(const WindowPaintData &other) : PaintData() , opacity(other.opacity) - , contents_opacity(other.contents_opacity) , decoration_opacity(other.decoration_opacity) , saturation(other.saturation) , brightness(other.brightness) diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 4ff0492762..afb652a223 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -1864,7 +1864,6 @@ public: * way for decoration. */ double opacity; - double contents_opacity; double decoration_opacity; /** * Saturation of the window, in range [0; 1] diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 9122489e26..ef8b7281e0 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -573,9 +573,9 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData WindowQuadList contentQuads = data.quads.select(WindowQuadContents); if (!contentQuads.empty()) { texture.bind(); - prepareStates(Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader); + prepareStates(Content, data.opacity, data.brightness, data.saturation, data.shader); renderQuads(mask, region, contentQuads, &texture, false, hardwareClipping); - restoreStates(Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader); + restoreStates(Content, data.opacity, data.brightness, data.saturation, data.shader); texture.unbind(); #ifndef KWIN_HAVE_OPENGLES if (static_cast(scene)->debug) {