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;