Get the image of the FBO of a effect texture
authorMarco Bubke <marco.bubke@nokia.com>
Wed, 24 Aug 2011 13:48:03 +0000 (15:48 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 25 Aug 2011 06:26:20 +0000 (08:26 +0200)
The Qml Designer needs this image because every item in the text file is
rendered in an external process in an image and send over a socket to the
main process.

Change-Id: I73cbc798d783098d3e1937181259c227b008082e
Reviewed-on: http://codereview.qt.nokia.com/3509
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/declarative/items/qsgshadereffectsource.cpp
src/declarative/items/qsgshadereffectsource_p.h

index d7653b5..e05d20e 100644 (file)
@@ -365,6 +365,14 @@ void QSGShaderEffectTexture::grab()
         markDirtyTexture(); // Continuously update if 'live' and 'recursive'.
 }
 
+QImage QSGShaderEffectTexture::toImage() const
+{
+    if (m_fbo)
+        return m_fbo->toImage();
+
+    return QImage();
+}
+
 /*!
     \qmlclass ShaderEffectSource QSGShaderEffectSource
     \since 5.0
index ac8fde5..0cb449a 100644 (file)
@@ -114,6 +114,8 @@ public:
 
     void scheduleUpdate();
 
+    QImage toImage() const;
+
 Q_SIGNALS:
     void textureChanged();