summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-31 21:39:35 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-31 21:39:35 (GMT)
commit62c23329fd61b016edbdc8dba758ca785a56fca7 (patch)
treec8bcaeec55d33a5decfba82af70cbc51c1129397 /src/opengl
parentda038b5f74f98d73e25c10e12817cf46ad48f7f9 (diff)
parent882992494e0c6f6510e95976abdac5d57966eb6c (diff)
downloadQt-62c23329fd61b016edbdc8dba758ca785a56fca7.zip
Qt-62c23329fd61b016edbdc8dba758ca785a56fca7.tar.gz
Qt-62c23329fd61b016edbdc8dba758ca785a56fca7.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp7
-rw-r--r--src/opengl/qwindowsurface_gl.cpp14
2 files changed, 16 insertions, 5 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 943a195..c49dba4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2103,11 +2103,8 @@ void QGLContextPrivate::syncGlState()
#ifdef QT_NO_EGL
void QGLContextPrivate::swapRegion(const QRegion *)
{
- static bool firstWarning = true;
- if (firstWarning) {
- qWarning() << "::swapRegion called but not supported!";
- firstWarning = false;
- }
+ Q_Q(QGLContext);
+ q->swapBuffers();
}
#endif
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index b86fb78..d602000 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -426,6 +426,20 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize,
void QGLWindowSurface::beginPaint(const QRegion &)
{
+ if (! context())
+ return;
+
+ int clearFlags = 0;
+
+ if (context()->d_func()->workaround_needsFullClearOnEveryFrame)
+ clearFlags = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
+ else if (context()->format().alpha())
+ clearFlags = GL_COLOR_BUFFER_BIT;
+
+ if (clearFlags) {
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(clearFlags);
+ }
}
void QGLWindowSurface::endPaint(const QRegion &rgn)