summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-31 08:40:28 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-31 08:40:28 (GMT)
commit69d43435f241f0d654b1a3eecdfdfc5140f6beac (patch)
treeb552389385cd5b3c627280ee1488bab81939106d /src/opengl
parentcf28f6cacf59d434072656af05466541ba69e8ae (diff)
parent1a72dd3a1c8f66e31ce4102b2d3e7e5cff4817f8 (diff)
downloadQt-69d43435f241f0d654b1a3eecdfdfc5140f6beac.zip
Qt-69d43435f241f0d654b1a3eecdfdfc5140f6beac.tar.gz
Qt-69d43435f241f0d654b1a3eecdfdfc5140f6beac.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Make tst_image a little bit more tollerent to rounding errors Clear the QGLWindowSurface in ::beginPaint when needed. Made QT_GL_SWAPBUFFER_PRESERVE=1 with the GL graphics system work. Fix QStaticText with OpenGL1 engine tst_qimage: backport fix of commit 0d7e683 into 4.7 qdrawhelper: backport the optimisations in fetchTransformBilinear from master to 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)