summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@nokia.com>2011-08-24 15:48:03 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-25 08:26:20 +0200
commit15e62e98ad6fa73f052113c158b24549b7b28e4f (patch)
tree575664c4c0f3f7ff7e63fc31e39ed53dcde210c8
parent0d84e957297b4ffa6ab5b0b5bcf8b169d567d298 (diff)
Get the image of the FBO of a effect texture
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>
-rw-r--r--src/declarative/items/qsgshadereffectsource.cpp8
-rw-r--r--src/declarative/items/qsgshadereffectsource_p.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp
index d7653b578b..e05d20ed69 100644
--- a/src/declarative/items/qsgshadereffectsource.cpp
+++ b/src/declarative/items/qsgshadereffectsource.cpp
@@ -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
diff --git a/src/declarative/items/qsgshadereffectsource_p.h b/src/declarative/items/qsgshadereffectsource_p.h
index ac8fde50d9..0cb449a46c 100644
--- a/src/declarative/items/qsgshadereffectsource_p.h
+++ b/src/declarative/items/qsgshadereffectsource_p.h
@@ -114,6 +114,8 @@ public:
void scheduleUpdate();
+ QImage toImage() const;
+
Q_SIGNALS:
void textureChanged();