diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-04-16 08:37:08 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-16 08:41:23 (GMT) |
commit | fbce782f1d566c318737bf7e5ab55d0a66fb2a2c (patch) | |
tree | 44a073445b14453135d53c140646aa3ded2a4090 /src/opengl | |
parent | ac7484e36bfab69473278d7268cf37f7c69abfd2 (diff) | |
download | Qt-fbce782f1d566c318737bf7e5ab55d0a66fb2a2c.zip Qt-fbce782f1d566c318737bf7e5ab55d0a66fb2a2c.tar.gz Qt-fbce782f1d566c318737bf7e5ab55d0a66fb2a2c.tar.bz2 |
Fix off-by-one bugs in the framebuffer blits.
The bottom-right coordinates are exclusive, not inclusive.
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 45d4788..61d0f85 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1132,14 +1132,14 @@ void QGLFramebufferObject::blitFramebuffer(QGLFramebufferObject *target, const Q const int th = target ? target->height() : height; const int sx0 = sourceRect.left(); - const int sx1 = sourceRect.right(); - const int sy0 = sh - sourceRect.bottom() - 1; - const int sy1 = sh - sourceRect.top() - 1; + const int sx1 = sourceRect.left() + sourceRect.width(); + const int sy0 = sh - (sourceRect.top() + sourceRect.height()); + const int sy1 = sh - sourceRect.top(); const int tx0 = targetRect.left(); - const int tx1 = targetRect.right(); - const int ty0 = th - targetRect.bottom() - 1; - const int ty1 = th - targetRect.top() - 1; + const int tx1 = targetRect.left() + targetRect.width(); + const int ty0 = th - (targetRect.top() + targetRect.height()); + const int ty1 = th - targetRect.top(); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, source ? source->handle() : 0); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, target ? target->handle() : 0); |