diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-03-31 12:32:33 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-04-08 05:58:27 +0000 |
commit | a715c6ceb8cd59b44f75a08cd6a7095f2ceac04d (patch) | |
tree | 540670537cbc4767bf7268b8fb03c3d2c23ee4b6 /src/gui/opengl/qopenglframebufferobject.cpp | |
parent | f041757d7a9e76c8463609d8169339b4b0dae3f6 (diff) |
Use the default fbo in Qt sense in blitFramebuffer
QOpenGLFramebufferObject::blitFramebuffer() passes 0 when no FBO is specified.
This goes against the rest of the framework where the default fbo is what
QOpenGLContext::defaultFramebufferObject() returns. This becomes significant
with QOpenGLWidget and on iOS.
Task-number: QTBUG-45328
Change-Id: Iaeb82cd3786ad395116679c9626bdcb10e93b4e3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/opengl/qopenglframebufferobject.cpp')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index c4deeea4c9..8d298496df 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1484,8 +1484,10 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, const int ty0 = targetRect.top(); const int ty1 = targetRect.top() + targetRect.height(); - extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, source ? source->handle() : 0); - extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target ? target->handle() : 0); + const GLuint defaultFboId = ctx->defaultFramebufferObject(); + + extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, source ? source->handle() : defaultFboId); + extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target ? target->handle() : defaultFboId); extensions.glBlitFramebuffer(sx0, sy0, sx1, sy1, tx0, ty0, tx1, ty1, |