From 0b992748be05a75f6b23ddc2f4908f04e6c4a44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 25 Nov 2009 23:08:19 +0000 Subject: [PATCH] Switch the order, so the decoration is drawn before the client window. svn path=/trunk/KDE/kdebase/workspace/; revision=1054380 --- scene_opengl.cpp | 26 ++++++++++++++------------ scene_xrender.cpp | 35 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 741551b662..fb44b8bf51 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1437,20 +1437,8 @@ void SceneOpenGL::Window::performPaint( int mask, QRegion region, WindowPaintDat } region.translate( toplevel->x(), toplevel->y() ); // Back to screen coords - texture.bind(); - texture.enableUnnormalizedTexCoords(); - WindowQuadList decoration = data.quads.select( WindowQuadDecoration ); - // paint the content - if ( !(mask & PAINT_DECORATION_ONLY) ) - { - prepareStates( Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader ); - renderQuads( mask, region, data.quads.select( WindowQuadContents )); - restoreStates( Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader ); - } - texture.disableUnnormalizedTexCoords(); - texture.unbind(); // decorations Client *client = dynamic_cast(toplevel); @@ -1520,6 +1508,20 @@ void SceneOpenGL::Window::performPaint( int mask, QRegion region, WindowPaintDat } } + texture.bind(); + texture.enableUnnormalizedTexCoords(); + + // paint the content + if ( !(mask & PAINT_DECORATION_ONLY) ) + { + prepareStates( Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader ); + renderQuads( mask, region, data.quads.select( WindowQuadContents )); + restoreStates( Content, data.opacity * data.contents_opacity, data.brightness, data.saturation, data.shader ); + } + + texture.disableUnnormalizedTexCoords(); + texture.unbind(); + glPopMatrix(); } diff --git a/scene_xrender.cpp b/scene_xrender.cpp index acccefb7af..36d374a850 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -724,22 +724,6 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa !iterator.isDone(); iterator.next()) { - if ( !(mask & PAINT_DECORATION_ONLY) ) - { - // Paint the window contents - if( opaque ) - { - XRenderComposite( display(), PictOpSrc, pic, None, buffer, cr.x() * xscale, cr.y() * yscale, - 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); - } - else - { - Picture alpha = alphaMask( data.opacity ); - XRenderComposite( display(), PictOpOver, pic, alpha, buffer, cr.x() * xscale, cr.y() * yscale, - 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); - transformed_shape = QRegion(); - } - } if( client || deleted ) { bool noBorder = true; @@ -804,7 +788,24 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa } } } - if( data.brightness < 1.0 ) + if ( !(mask & PAINT_DECORATION_ONLY) ) + { + // Paint the window contents + if( opaque ) + { + XRenderComposite( display(), PictOpSrc, pic, None, buffer, cr.x() * xscale, cr.y() * yscale, + 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); + } + else + { + Picture alpha = alphaMask( data.opacity ); + XRenderComposite( display(), PictOpOver, pic, alpha, buffer, cr.x() * xscale, cr.y() * yscale, + 0, 0, dr.x(), dr.y(), dr.width(), dr.height()); + transformed_shape = QRegion(); + } + } + + if( data.brightness < 1.0 ) { // fake brightness change by overlaying black XRenderColor col = { 0, 0, 0, 0xffff * ( 1 - data.brightness ) * data.opacity };