From b9bf9831b06074f9a0ea72b147679600935e4a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 25 Sep 2008 09:13:00 +0000 Subject: [PATCH] Fix wrong logic. svn path=/trunk/KDE/kdebase/workspace/; revision=864621 --- scene_opengl.cpp | 16 ++++------------ scene_xrender.cpp | 16 ++++------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index b67c561dc8..f80025d06f 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1313,18 +1313,10 @@ 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( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) - {} - else if( mask & PAINT_WINDOW_OPAQUE ) - { - if( !opaque ) - return; - } - else if( mask & PAINT_WINDOW_TRANSLUCENT ) - { - if( opaque ) - return; - } + 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; // 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 e74eb0c6bc..1e3d965d0b 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -523,18 +523,10 @@ 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( mask & ( PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSLUCENT )) - {} - else if( mask & PAINT_WINDOW_OPAQUE ) - { - if( !opaque ) - return; - } - else if( mask & PAINT_WINDOW_TRANSLUCENT ) - { - if( opaque ) - return; - } + 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; Picture pic = picture(); // get XRender picture if( pic == None ) // The render format can be null for GL and/or Xv visuals return;