summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli Jarvinen <ext-pauli.p.jarvinen@nokia.com>2012-06-12 12:27:19 +0300
committerPasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>2012-06-20 09:38:57 +0200
commit8f67d9006be1d79701eb0271d9d2d373eda18e0a (patch)
tree9cb67dbe067bcd763d6f31672004dd159517e592
parentd254d2709d0b89b2686814afe7cd2f79b1ac04c4 (diff)
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> (cherry picked from commit a56ff23fb9e6c33ff97b5b0e8619346797626755)
-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 81e857f19a..c26e773bec 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 1e9db5e1b8..487381ee37 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;