summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-10-20 05:46:33 +1000
committerQt Continuous Integration System <qt-info@nokia.com>2011-10-20 05:46:33 +1000
commitac1fcae4177ca39729509b3b70ed0b766b042c1e (patch)
treeff43ffec99221c5c27aca1827e29ab11af48e17e
parentc14af1c242ea3b268a4b6a5df62869bfd0efb6c4 (diff)
parent20542f9546637bd649c928226249be0ffc91841b (diff)
downloadqt4-tools-ac1fcae4177ca39729509b3b70ed0b766b042c1e.tar.gz
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Workaround to VideoCore III scissor bug.
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qgl_egl.cpp11
-rw-r--r--src/opengl/qgl_p.h2
4 files changed, 16 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 047d5890e4..999a0746f8 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -2059,6 +2059,8 @@ void QGL2PaintEngineExPrivate::updateClipScissorTest()
currentScissorBounds = bounds;
if (bounds == QRect(0, 0, width, height)) {
+ if (ctx->d_func()->workaround_brokenScissor)
+ clearClip(0);
glDisable(GL_SCISSOR_TEST);
} else {
glEnable(GL_SCISSOR_TEST);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 3b3da431b8..af160d8c41 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1716,6 +1716,8 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
workaround_brokenTextureFromPixmap = false;
workaround_brokenTextureFromPixmap_init = false;
+ workaround_brokenScissor = false;
+
for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
vertexAttributeArraysEnabledState[i] = false;
}
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index a5891180f4..07134cf9e7 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -192,7 +192,9 @@ void QGLContext::makeCurrent()
if (!d->workaroundsCached) {
d->workaroundsCached = true;
const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- if (renderer && (strstr(renderer, "SGX") || strstr(renderer, "MBX"))) {
+ if (!renderer)
+ return;
+ if ((strstr(renderer, "SGX") || strstr(renderer, "MBX"))) {
// PowerVR MBX/SGX chips needs to clear all buffers when starting to render
// a new frame, otherwise there will be a performance penalty to pay for
// each frame.
@@ -229,6 +231,13 @@ void QGLContext::makeCurrent()
d->workaround_brokenFBOReadBack = true;
}
}
+ } else if (strstr(renderer, "VideoCore III")) {
+ // Some versions of VideoCore III drivers seem to pollute and use
+ // stencil buffer when using glScissors even if stencil test is disabled.
+ // Workaround is to clear stencil buffer before disabling scissoring.
+
+ // qDebug() << "Found VideoCore III driver, enabling brokenDisableScissorTest";
+ d->workaround_brokenScissor = true;
}
}
}
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index c56b2db806..d76f0b042a 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -415,6 +415,8 @@ public:
uint workaround_brokenTextureFromPixmap : 1;
uint workaround_brokenTextureFromPixmap_init : 1;
+ uint workaround_brokenScissor : 1;
+
QPaintDevice *paintDevice;
QColor transpColor;
QGLContext *q_ptr;