summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-09-10 13:56:11 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-10 14:06:58 (GMT)
commita21b661384c31e6c9154a99690b2d134a12b9187 (patch)
tree6bf37bcdda9f15f16cec716c8fdaca4e85e3f3a7 /src/opengl/qpixmapdata_gl.cpp
parent56ac253d0668c5ea9227a07699c31beb2b8034a1 (diff)
downloadQt-a21b661384c31e6c9154a99690b2d134a12b9187.zip
Qt-a21b661384c31e6c9154a99690b2d134a12b9187.tar.gz
Qt-a21b661384c31e6c9154a99690b2d134a12b9187.tar.bz2
Re-order begin() so everything needing a current context has one
It should be up to QGLPaintDevice::beginPaint() to make the correct context current, so everything needing a current context needs to be moved after that call. This patch also modifies QGLPixmapData to use QGLContext::drawTexture rather than the GL2 PE's drawTexture, which shouldn't be called inside beginPaint as the paint engine hasn't been fully initialised yet. Reviewed-by: Eskil
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index fa1b815..0bc46e1 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -157,12 +157,8 @@ void QGLPixmapGLPaintDevice::beginPaint()
// uploaded from an image or rendered into before), we need to
// copy it from the texture to the render FBO.
- // Pass false to tell bind to _not_ copy the FBO into the texture!
- GLuint texId = data->bind(false);
-
- QGL2PaintEngineEx* pe = static_cast<QGL2PaintEngineEx*>(data->paintEngine());
- QRect rect(0, 0, data->width(), data->height());
- pe->drawTexture(QRectF(rect), texId, rect.size(), QRectF(rect));
+ // Pass false to bind so it doesn't copy the FBO into the texture!
+ context()->drawTexture(QPointF(0.0, 0.0), data->bind(false));
}
}