diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-04-20 10:23:48 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-20 10:23:48 (GMT) |
commit | 4b4d4b3d7ae4ad019963d957831c46daacba62f7 (patch) | |
tree | 541d078fc2c5ee9ee3dbe99c310e9d96efd9e89e /src | |
parent | 8027a669e31d2fc96f9ffdfc0771034571dd583e (diff) | |
download | Qt-4b4d4b3d7ae4ad019963d957831c46daacba62f7.zip Qt-4b4d4b3d7ae4ad019963d957831c46daacba62f7.tar.gz Qt-4b4d4b3d7ae4ad019963d957831c46daacba62f7.tar.bz2 |
Prevent copy back from FBO when initializing render FBO from texture.
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 6 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl_p.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 19163a8..d0f0ad6 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1094,7 +1094,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) if (source) { d->transferMode(ImageDrawingMode); - source->bind(); + source->bind(false); glDisable(GL_BLEND); diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 1c5056d..1fa5b47 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -301,7 +301,7 @@ void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const GL_NEAREST); if (keepCurrentFboBound) - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_ctx->d_ptr->current_fbo); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo); } void QGLPixmapData::swapBuffers() @@ -394,9 +394,9 @@ QPaintEngine* QGLPixmapData::paintEngine() const return m_engine; } -GLuint QGLPixmapData::bind() const +GLuint QGLPixmapData::bind(bool copyBack) const { - if (m_renderFbo) + if (m_renderFbo && copyBack) copyBackFromRenderFbo(true); else ensureCreated(); diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 7dda653..536f33d 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -82,7 +82,7 @@ public: QImage toImage() const; QPaintEngine* paintEngine() const; - GLuint bind() const; + GLuint bind(bool copyBack = true) const; GLuint textureId() const; bool isValidContext(const QGLContext *ctx) const; |