From 6252421a70d2bc20a3fc6c01612a9a8f1b7ab20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 2 Jan 2011 10:08:13 +0100 Subject: [PATCH] Disable clipping when rendering infiniteRegion --- lib/kwinglutils.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 3338919a9e..927233cf2e 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -1643,13 +1643,14 @@ void GLVertexBufferPrivate::legacyPainting( QRegion region, GLenum primitiveMode } // Clip using scissoring - PaintClipper pc( region ); - for( PaintClipper::Iterator iterator; - !iterator.isDone(); - iterator.next()) - { - glDrawArrays( primitiveMode, 0, numberVertices ); + if (region != infiniteRegion()) { + PaintClipper pc(region); + for (PaintClipper::Iterator iterator; !iterator.isDone(); iterator.next()) { + glDrawArrays(primitiveMode, 0, numberVertices); } + } else { + glDrawArrays(primitiveMode, 0, numberVertices); + } glDisableClientState( GL_VERTEX_ARRAY ); if (!legacyTexCoords.isEmpty()) { @@ -1682,13 +1683,14 @@ void GLVertexBufferPrivate::corePainting( const QRegion& region, GLenum primitiv } // Clip using scissoring - PaintClipper pc( region ); - for( PaintClipper::Iterator iterator; - !iterator.isDone(); - iterator.next()) - { - glDrawArrays( primitiveMode, 0, numberVertices ); + if (region != infiniteRegion()) { + PaintClipper pc(region); + for (PaintClipper::Iterator iterator; !iterator.isDone(); iterator.next()) { + glDrawArrays(primitiveMode, 0, numberVertices); } + } else { + glDrawArrays(primitiveMode, 0, numberVertices); + } glBindBuffer( GL_ARRAY_BUFFER, 0 ); @@ -1793,13 +1795,14 @@ void GLVertexBuffer::render( const QRegion& region, GLenum primitiveMode ) } // Clip using scissoring - PaintClipper pc( region ); - for( PaintClipper::Iterator iterator; - !iterator.isDone(); - iterator.next()) - { - glDrawArrays( primitiveMode, 0, d->numberVertices ); + if (region != infiniteRegion()) { + PaintClipper pc(region); + for (PaintClipper::Iterator iterator; !iterator.isDone(); iterator.next()) { + glDrawArrays(primitiveMode, 0, d->numberVertices); } + } else { + glDrawArrays(primitiveMode, 0, d->numberVertices); + } glBindBuffer( GL_ARRAY_BUFFER, 0 );