Properly initialize glViewport() to appropriate value in QGLPixelBuffer.
authorSamuel Rødal <samuel.rodal@digia.com>
Wed, 21 Nov 2012 13:32:30 +0000 (14:32 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 21 Nov 2012 13:39:02 +0000 (14:39 +0100)
Since we are using a hidden window in order to make the context current,
the viewport will end up with an arbitrary value. By setting it
explicitly we ensure compatibility with Qt 4.

Task-number: QTBUG-28115
Change-Id: I69fb5efda2b274b539c3d3b9fa842a2d32ad70b1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
src/opengl/qglpixelbuffer.cpp

index 135f2ed..d39ac3d 100644 (file)
@@ -220,6 +220,7 @@ bool QGLPixelBuffer::makeCurrent()
             format.setSamples(d->req_format.samples());
         d->fbo = new QOpenGLFramebufferObject(d->req_size, format);
         d->fbo->bind();
+        glViewport(0, 0, d->req_size.width(), d->req_size.height());
     }
     return true;
 }