summaryrefslogtreecommitdiff
path: root/src/opengl/qglpaintdevice.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-14 15:42:43 +0200
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-05-14 15:42:43 +0200
commit9a69656bd64016933124813ea5403e7e5d454719 (patch)
tree220e31e08e11bfa3a76627b53f303880e065f8e0 /src/opengl/qglpaintdevice.cpp
parentb2e15281d56415e6ef8d4f1604d25b198d449f06 (diff)
downloadqt4-tools-9a69656bd64016933124813ea5403e7e5d454719.tar.gz
Added workarounds for two MBX/SGX specific GL ES bugs/problems.
The workaround flags are put into the platform independent section for now, since there might be a general need for these as we expand our GL and GL ES usage. The workaround_needsFullClearOnEveryFrame flag covers the case where you get a performance penalty on PowerVR hw if all rendering buffers are not cleared. The workaround_brokenFBOReadBack flag covers the case where copying pixels from a texture (e.g. via glCopyTexSubImage2d()) bound in an FBO doesn't work. Task-number: QTBUG-10670 Reviewed-by: Gunnar
Diffstat (limited to 'src/opengl/qglpaintdevice.cpp')
-rw-r--r--src/opengl/qglpaintdevice.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index e874e85c38..e1dcbfde89 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -175,7 +175,10 @@ void QGLWidgetGLPaintDevice::beginPaint()
float alpha = c.alphaF();
glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);
}
- glClear(GL_COLOR_BUFFER_BIT);
+ if (context()->d_func()->workaround_needsFullClearOnEveryFrame)
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ else
+ glClear(GL_COLOR_BUFFER_BIT);
}
}