From a1f695f7b3b671c26925d41fba7dff1d3cb49da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 9 Feb 2011 13:31:04 +0100 Subject: Fixed tst_qpixmap::toImageDeepCopy autotest for GL graphicssystem. We need to copy the image if painting is active. Reviewed-by: Jani Hautakangas --- src/opengl/qpixmapdata_gl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 9980f2d..43e80c1 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -586,6 +586,12 @@ QImage QGLPixmapData::toImage() const if (m_renderFbo) { copyBackFromRenderFbo(true); } else if (!m_source.isNull()) { + QImageData *data = const_cast(m_source).data_ptr(); + if (data->paintEngine && data->paintEngine->isActive() + && data->paintEngine->paintDevice() == &m_source) + { + return m_source.copy(); + } return m_source; } else if (m_dirty || m_hasFillColor) { return fillImage(m_fillColor); -- cgit v0.12