summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-09-16 12:36:02 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-09-18 17:45:05 +0200
commit5d5de7a97fa0f6fc4b83403a7c282d180f4e2060 (patch)
tree1f5c69a71d4fbebb160b80c017cceebee1e20991
parent4aba2d07d2fe67beaf544a4b38c5b9aa8b8ec39b (diff)
QOpenGLWidget: Play nice with empty paintGL
Applications that do not override paintGL() (may happen in some test code) will not perform any GL rendering, not even clearing. This is fine, but to be safe we need to do a clear right after creating the FBO in order to prevent showing garbage. Task-number: QTBUG-38327 Change-Id: If062901bb18724f961e41856085470e37b49abbe Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 524597f7a1..13e3ee876b 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -563,6 +563,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
fbo->bind();
+ context->functions()->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
paintDevice->setSize(deviceSize);
paintDevice->setDevicePixelRatio(q->devicePixelRatio());