summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-05-28 13:00:37 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-02 09:31:10 +0200
commitf7ddbcb3d589a1f7138663398538c332c491d85c (patch)
tree673a062f1a21dbbacc1f4f78be9fdf0ddcc734be /src/opengl
parent46959875cf7ddeb9bbcee883e4bfaef63992b870 (diff)
Remove tracking of the current fbo
When binding an FBO directly via glBindFramebuffer, the QOpenGLContext's internal current_fbo, that is maintained by QOpenGLFramebufferObject, becomes out of sync. This will lead to QOpenGLFramebufferObjects thinking they are still bound. Such state tracking should be avoided since it is becoming increasingly difficult to keep it consistent between the various OpenGL API wrappers and will never be robust enough when the application changes the state by directly calling OpenGL functions. current_fbo is now removed in QtGui. QtOpenGL is not touched. Change-Id: Id809aab1306c9486d1e2ba3bb5aa93593659e920 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglpixelbuffer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 18dbf4bdbb..4205761472 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -338,7 +338,7 @@ void QGLPixelBuffer::updateDynamicTexture(GLuint texture_id) const
if (d->invalid || !d->fbo)
return;
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ const QGLContext *ctx = QGLContext::currentContext();
if (!ctx)
return;
@@ -352,19 +352,19 @@ void QGLPixelBuffer::updateDynamicTexture(GLuint texture_id) const
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#endif
- QOpenGLExtensions extensions(ctx);
+ QOpenGLExtensions extensions(ctx->contextHandle());
if (d->blit_fbo) {
QOpenGLFramebufferObject::blitFramebuffer(d->blit_fbo, d->fbo);
extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, d->blit_fbo->handle());
}
- ctx->functions()->glBindTexture(GL_TEXTURE_2D, texture_id);
+ extensions.glBindTexture(GL_TEXTURE_2D, texture_id);
#ifndef QT_OPENGL_ES
- GLenum format = ctx->isOpenGLES() ? GL_RGBA : GL_RGBA8;
- ctx->functions()->glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, d->req_size.width(), d->req_size.height(), 0);
+ GLenum format = ctx->contextHandle()->isOpenGLES() ? GL_RGBA : GL_RGBA8;
+ extensions.glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, d->req_size.width(), d->req_size.height(), 0);
#else
- ctx->functions()->glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, d->req_size.width(), d->req_size.height(), 0);
+ extensions.glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, d->req_size.width(), d->req_size.height(), 0);
#endif
if (d->blit_fbo)