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.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 8d94c8bff5..98c406b0a8 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -389,6 +389,11 @@ QPaintEngine* QGLPixmapData::paintEngine() const
sz.setWidth(qMax(m_width, qRound(sz.width() * 1.5)));
if (sz.height() < m_height)
sz.setHeight(qMax(m_height, qRound(sz.height() * 1.5)));
+
+ // wasting too much space?
+ if (sz.width() * sz.height() > m_width * m_height * 2.5)
+ sz = QSize(m_width, m_height);
+
delete textureBufferStack.at(currentTextureBuffer).fbo;
textureBufferStack[currentTextureBuffer] =
createTextureBuffer(sz, textureBufferStack.at(currentTextureBuffer).engine);