aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpixmapcache_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2015-01-29 19:09:39 +0100
committerGunnar Sletta <gunnar@sletta.org>2015-02-03 13:58:03 +0000
commitfa78127622424fba161f5f42e9e76c72e653828a (patch)
treef9f1889a85a00dea67b0b54b80606ffc949822a7 /src/quick/util/qquickpixmapcache_p.h
parenta49b0ad7866046c28fb38f0f70ddf626e12c3099 (diff)
Introduce QSG_TRANSIENT_IMAGES.
This feature enables the same feature that we already have in the 'nonpreservedtexture' in the scene graph playground. This change also cleans up some leftover logic from the early Qt 5.2 days when we had to manually extract the image from the default texture factory rather than going through QQuickWindow::createTexture(). This cleanup is required for the logic to work. Change-Id: I7cdf15d981ba8af94f8d51781fc01e2b834b77c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/util/qquickpixmapcache_p.h')
-rw-r--r--src/quick/util/qquickpixmapcache_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h
index df56ee3a10..f7a76a69f8 100644
--- a/src/quick/util/qquickpixmapcache_p.h
+++ b/src/quick/util/qquickpixmapcache_p.h
@@ -55,12 +55,13 @@ class QQuickDefaultTextureFactory : public QQuickTextureFactory
public:
QQuickDefaultTextureFactory(const QImage &i);
QSGTexture *createTexture(QQuickWindow *window) const;
- QSize textureSize() const { return im.size(); }
- int textureByteCount() const { return im.byteCount(); }
+ QSize textureSize() const { return size; }
+ int textureByteCount() const { return size.width() * size.height() * 4; }
QImage image() const { return im; }
private:
QImage im;
+ QSize size;
};
class Q_QUICK_PRIVATE_EXPORT QQuickPixmap