From 24816cb67ba97aba95885dfa4e8dd475ef6dc130 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 27 Sep 2008 06:23:33 +0000 Subject: [PATCH] Fixed "fixed" logic. There's really no other way to do this that's readable so if the "suspicious code" checker still picks this up just ignore it. BUG: 171709 svn path=/trunk/KDE/kdebase/workspace/; revision=865220 --- scene_opengl.cpp | 11 +++++++---- scene_xrender.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index f80025d06f..eb8c436eaf 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1313,10 +1313,13 @@ void SceneOpenGL::Window::performPaint( int mask, QRegion region, WindowPaintDat // check if there is something to paint (e.g. don't paint if the window // is only opaque and only PAINT_WINDOW_TRANSLUCENT is requested) bool opaque = isOpaque() && data.opacity == 1.0; - if( opaque && ( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) == PAINT_WINDOW_TRANSLUCENT ) - return; - if( !opaque && ( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) == PAINT_WINDOW_OPAQUE ) - return; + if( !( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT ))) + { // We are only painting either opaque OR translucent windows, not both + if( mask & PAINT_WINDOW_OPAQUE && !opaque ) + return; // Only painting opaque and window is translucent + if( mask & PAINT_WINDOW_TRANSLUCENT && opaque ) + return; // Only painting translucent and window is opaque + } // paint only requested areas if( region != infiniteRegion()) // avoid integer overflow region.translate( -x(), -y()); diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 1e3d965d0b..9cee6b850d 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -523,10 +523,13 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa setTransformedShape( QRegion()); // maybe nothing will be painted // check if there is something to paint bool opaque = isOpaque() && data.opacity == 1.0; - if( opaque && ( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) == PAINT_WINDOW_TRANSLUCENT ) - return; - if( !opaque && ( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) == PAINT_WINDOW_OPAQUE ) - return; + if( !( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT ))) + { // We are only painting either opaque OR translucent windows, not both + if( mask & PAINT_WINDOW_OPAQUE && !opaque ) + return; // Only painting opaque and window is translucent + if( mask & PAINT_WINDOW_TRANSLUCENT && opaque ) + return; // Only painting translucent and window is opaque + } Picture pic = picture(); // get XRender picture if( pic == None ) // The render format can be null for GL and/or Xv visuals return;