kwin: Fix the clip intersection code

The code that intersected the clip region with the window region
appears to have been accidentally lost in 5ce3c6b8.
icc-effect-5.14.5
Fredrik Höglund 2011-02-15 22:34:23 +01:00
parent 5d29307f58
commit 90f6cbfa5e
1 changed files with 6 additions and 5 deletions

View File

@ -463,11 +463,14 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData
if ( mask & PAINT_WINDOW_TRANSLUCENT && opaque ) if ( mask & PAINT_WINDOW_TRANSLUCENT && opaque )
return; // Only painting translucent and window is opaque return; // Only painting translucent and window is opaque
}*/ }*/
// paint only requested areas
if (region != infiniteRegion()) // avoid integer overflow // Intersect the clip region with the rectangle the window occupies on the screen
region.translate(-x(), -y()); if (!(mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED)))
region &= toplevel->visibleRect();
if (region.isEmpty()) if (region.isEmpty())
return; return;
if (!bindTexture()) if (!bindTexture())
return; return;
@ -501,8 +504,6 @@ void SceneOpenGL::Window::performPaint(int mask, QRegion region, WindowPaintData
if (!sceneShader) if (!sceneShader)
pushMatrix(windowTransformation); pushMatrix(windowTransformation);
region.translate(toplevel->x(), toplevel->y()); // Back to screen coords
WindowQuadList decoration = data.quads.select(WindowQuadDecoration); WindowQuadList decoration = data.quads.select(WindowQuadDecoration);
GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer();