summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPauli Jarvinen <ext-pauli.p.jarvinen@nokia.com>2012-06-12 09:27:19 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-06-19 08:11:06 (GMT)
commita56ff23fb9e6c33ff97b5b0e8619346797626755 (patch)
tree8765e7e2e6a70194682f3531cdc09928d0168126 /src
parenta7f0196fe301b962da94563cffc958df220a6c21 (diff)
downloadQt-a56ff23fb9e6c33ff97b5b0e8619346797626755.zip
Qt-a56ff23fb9e6c33ff97b5b0e8619346797626755.tar.gz
Qt-a56ff23fb9e6c33ff97b5b0e8619346797626755.tar.bz2
Performance fix for OpenGL drawing
Excessive calling of glFlush() was causing a performance problem when QML application was being run in the OpenGL graphics mode. There was an unnecessary call to glFlush() in the function QGLWindowSurfaceGLPaintDevice::endPaint(). This function gets called each time a QPainter instance is destroyed, which may happen several times per each painted screen frame (at least 4 times per frame can easily happen). Calling glFlush() from endPaint() is not necessary at all since it will be anyway called from QGLWindowSurface::flush() (either directly if single-buffered context is used or indirectly by swapping buffers if double-buffered context is used). Task-number: ou1cimx1#957423 Change-Id: I89509d8935ad31cc47bfed41a1900b6bb76c2af8 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp6
-rw-r--r--src/opengl/qwindowsurface_gl_p.h1
2 files changed, 0 insertions, 7 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 81e857f..c26e773 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -321,12 +321,6 @@ struct QGLWindowSurfacePrivate
QGLFormat QGLWindowSurface::surfaceFormat;
QGLWindowSurface::SwapMode QGLWindowSurface::swapBehavior = QGLWindowSurface::AutomaticSwap;
-void QGLWindowSurfaceGLPaintDevice::endPaint()
-{
- glFlush();
- QGLPaintDevice::endPaint();
-}
-
QSize QGLWindowSurfaceGLPaintDevice::size() const
{
return d->size;
diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 1e9db5e..487381e 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -74,7 +74,6 @@ class QGLWindowSurfaceGLPaintDevice : public QGLPaintDevice
{
public:
QPaintEngine* paintEngine() const;
- void endPaint();
QSize size() const;
int metric(PaintDeviceMetric m) const;
QGLContext* context() const;