diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-04-17 08:04:08 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-17 08:16:35 (GMT) |
commit | b3f0d6e31c6897b1701de28d51980a81fb3e778f (patch) | |
tree | 29b8095070bb4f1585bee5a3eed45776c033ce5e /src/opengl/qgl.cpp | |
parent | 537c26b2125994b42a5d00540ca4644582111573 (diff) | |
download | Qt-b3f0d6e31c6897b1701de28d51980a81fb3e778f.zip Qt-b3f0d6e31c6897b1701de28d51980a81fb3e778f.tar.gz Qt-b3f0d6e31c6897b1701de28d51980a81fb3e778f.tar.bz2 |
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/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 64048f2..d1cf35d 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4289,6 +4289,8 @@ void QGLDrawable::swapBuffers() if (widget) { if (widget->autoBufferSwap()) widget->swapBuffers(); + } else if (pixmapData) { + pixmapData->swapBuffers(); } else { glFlush(); } @@ -4297,7 +4299,7 @@ void QGLDrawable::swapBuffers() void QGLDrawable::makeCurrent() { if (pixmapData) - pixmapData->beginPaint(); + pixmapData->makeCurrent(); else if (widget) widget->makeCurrent(); else if (buffer) @@ -4321,7 +4323,7 @@ QGLPixmapData *QGLDrawable::copyOnBegin() const void QGLDrawable::doneCurrent() { if (pixmapData) - pixmapData->endPaint(); + pixmapData->doneCurrent(); else if (fbo && !wasBound) fbo->release(); } |