diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-09-15 23:21:11 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-09-15 23:21:11 (GMT) |
commit | d3b03a7d6c4ad023572d7099ee9f9ec3f0711d04 (patch) | |
tree | 5326031090ee5921eaf5c3259153194ddc352afc /src/opengl | |
parent | 45c13a0064281d0e2b9a10c7dfb0cef7f3b6720f (diff) | |
parent | 669afa2337ad5791502fe3af2e3de648cb60ea9b (diff) | |
download | Qt-d3b03a7d6c4ad023572d7099ee9f9ec3f0711d04.zip Qt-d3b03a7d6c4ad023572d7099ee9f9ec3f0711d04.tar.gz Qt-d3b03a7d6c4ad023572d7099ee9f9ec3f0711d04.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
configure.exe
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index d5398a9..3bc0d4f 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -98,7 +98,7 @@ QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize sz.setHeight(qMax(requestSize.height(), qRound(sz.height() * 1.5))); // wasting too much space? - if (sz.width() * sz.height() > requestSize.width() * requestSize.height() * 2.5) + if (sz.width() * sz.height() > requestSize.width() * requestSize.height() * 4) sz = requestSize; if (sz != fboSize) { @@ -162,12 +162,14 @@ void QGLPixmapGLPaintDevice::beginPaint() glDisable(GL_SCISSOR_TEST); glDisable(GL_BLEND); - glMatrixMode(GL_MODELVIEW_MATRIX); +#if !defined(QT_OPENGL_ES_2) + glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glMatrixMode(GL_PROJECTION_MATRIX); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, data->width(), data->height(), 0, -999999, 999999); +#endif glViewport(0, 0, data->width(), data->height()); @@ -183,12 +185,11 @@ void QGLPixmapGLPaintDevice::endPaint() data->copyBackFromRenderFbo(false); - data->m_renderFbo->release(); - qgl_fbo_pool()->release(data->m_renderFbo); - data->m_renderFbo = 0; - // Base's endPaint will restore the previous FBO binding QGLPaintDevice::endPaint(); + + qgl_fbo_pool()->release(data->m_renderFbo); + data->m_renderFbo = 0; } QGLContext* QGLPixmapGLPaintDevice::context() const @@ -466,8 +467,8 @@ void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const if (!ctx->d_ptr->fbo) glGenFramebuffers(1, &ctx->d_ptr->fbo); - glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->fbo); - glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, ctx->d_ptr->fbo); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture.id, 0); const int x0 = 0; @@ -475,7 +476,8 @@ void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const const int y0 = 0; const int y1 = h; - glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_renderFbo->handle()); + if (!m_renderFbo->isBound()) + glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_renderFbo->handle()); glDisable(GL_SCISSOR_TEST); |