summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-04-17 10:04:08 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-04-17 10:16:35 +0200
commitb3f0d6e31c6897b1701de28d51980a81fb3e778f (patch)
tree29b8095070bb4f1585bee5a3eed45776c033ce5e /src/opengl/qpixmapdata_gl_p.h
parent537c26b2125994b42a5d00540ca4644582111573 (diff)
Correctly handle using GL pixmaps that still have an active engine.
In the case where a GL pixmap is used when there it still has an active engine we need to ensure that the pixmap has been flushed from the render FBO first. The newly added QGLPixmapData::copyBackFromRenderFbo() handles this. In addition, because several GL 2 paint engines can be active on the same context at the same time, we can't make any assumptions and need to call the newly added QGL2PaintEngineEx::ensureCreated() in the beginning of any state-dependent paint engine function. QGL2PaintEngineEx::ensureCreated() correctly transfers control to the current engine if a different engine is active. Running lance with -pixmap and -graphicssystem opengl works correctly with the GL pixmap backend now.
Diffstat (limited to 'src/opengl/qpixmapdata_gl_p.h')
-rw-r--r--src/opengl/qpixmapdata_gl_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index b1b31f7029..7dda653235 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -97,8 +97,9 @@ public:
QGLFramebufferObject *fbo() const;
- void beginPaint();
- void endPaint();
+ void makeCurrent();
+ void doneCurrent();
+ void swapBuffers();
protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
@@ -107,6 +108,8 @@ private:
QGLPixmapData(const QGLPixmapData &other);
QGLPixmapData &operator=(const QGLPixmapData &other);
+ void copyBackFromRenderFbo(bool keepCurrentFboBound) const;
+
static bool useFramebufferObjects();
int m_width;