summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 13:09:00 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 16:36:16 (GMT)
commit31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7 (patch)
treee9402324bd0eadd51802a3df9b43157639f01123 /src/opengl/qglframebufferobject.cpp
parente3e7cf545116c194bd5cfe79b28ea37c8bf78219 (diff)
downloadQt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.zip
Qt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.tar.gz
Qt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.tar.bz2
Make QGLPixmapData work with the new QGLPaintDevice API
This patch changes the ordering of QGL2PaintEngine::begin a bit because QGLPixmapData needs to use the paint engine's drawTexture method within beginPaint(). Also, this initialises needsSync to true and removes the setState call. So now all the state initialisation is done in ensureActive rather than begin.
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r--src/opengl/qglframebufferobject.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index f60eb62..9dbf5c8 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -299,6 +299,12 @@ bool QGLFramebufferObjectFormat::operator!=(const QGLFramebufferObjectFormat& ot
return !(*this == other);
}
+void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f)
+{
+ fbo = f;
+ m_thisFBO = fbo->d_func()->fbo; // This shouldn't be needed
+}
+
void QGLFBOGLPaintDevice::ensureActiveTarget()
{
QGLContext* ctx = const_cast<QGLContext*>(QGLContext::currentContext());
@@ -377,6 +383,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
ctx = QGLContextPrivate::contextGroup(currentContext);
glDevice.setFBO(q);
+
bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext)))
return;
@@ -389,6 +396,8 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo);
+ glDevice.setFBO(q);
+
QT_CHECK_GLERROR();
// init texture
if (samples == 0) {