diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2012-03-05 10:11:16 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-05 12:30:26 +0100 |
commit | 43ffdc3fc02eb058d7d458cb16a9c3cf07ea68eb (patch) | |
tree | b802cdb7cda03c1cf2df9a6c1b98760457adff06 /src/qml | |
parent | 416786d0f7fee72e235814c98eb2d887b6098ae3 (diff) |
Do not store an explicit QImage in the declarative pixmap cache.
This opens up for the scene graph adaptation only storing textures which
effectively halves the memory usage for textures and images.
Change-Id: I3452a15844ceeb4fc3a465865f99ee16e3e05607
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlimageprovider.cpp | 17 | ||||
-rw-r--r-- | src/qml/qml/qqmlimageprovider.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlimageprovider.cpp b/src/qml/qml/qqmlimageprovider.cpp index 863093033a..756b943fc0 100644 --- a/src/qml/qml/qqmlimageprovider.cpp +++ b/src/qml/qml/qqmlimageprovider.cpp @@ -70,6 +70,23 @@ QQuickTextureFactory::~QQuickTextureFactory() } +/*! + \fn QImage QQuickTextureFactory::image() const + + Returns an image version of this texture. + + The lifespan of the returned image is unknown, so the implementation should + return a self contained QImage, not make use of the QImage(uchar *, ...) + constructor. + + This function is not commonly used and is expected to be slow. + */ + +QImage QQuickTextureFactory::image() const +{ + return QImage(); +} + /*! \fn QSGTexture *QQuickTextureFactory::createTexture() const diff --git a/src/qml/qml/qqmlimageprovider.h b/src/qml/qml/qqmlimageprovider.h index fe06925123..da4d8c8248 100644 --- a/src/qml/qml/qqmlimageprovider.h +++ b/src/qml/qml/qqmlimageprovider.h @@ -64,6 +64,7 @@ public: virtual QSGTexture *createTexture(QQuickCanvas *canvas) const = 0; virtual QSize textureSize() const = 0; virtual int textureByteCount() const = 0; + virtual QImage image() const; }; class Q_QML_EXPORT QQmlImageProvider |