diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-09 12:31:04 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-09 12:33:04 (GMT) |
commit | a1f695f7b3b671c26925d41fba7dff1d3cb49da2 (patch) | |
tree | 0d0a0131c4fea30e667c7cc7c3f8730bcfe08567 /src/opengl | |
parent | e9ab35ef663e9562385c974dcbeb7cf2d03ab70f (diff) | |
download | Qt-a1f695f7b3b671c26925d41fba7dff1d3cb49da2.zip Qt-a1f695f7b3b671c26925d41fba7dff1d3cb49da2.tar.gz Qt-a1f695f7b3b671c26925d41fba7dff1d3cb49da2.tar.bz2 |
Fixed tst_qpixmap::toImageDeepCopy autotest for GL graphicssystem.
We need to copy the image if painting is active.
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<QImage &>(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); |