summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp22
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);