diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2011-05-26 15:12:37 +0200 |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2011-05-26 16:04:18 +0200 |
commit | bfb347a463ceff05628abea6a105f6c83f100725 (patch) | |
tree | 2ceb062b292ef9b30e71c61defeb3101c571c247 /src/declarative | |
parent | 8d2c87d357dea140c607a755c8a5c3fff5697721 (diff) |
Textures not scheduled for deletion while scrolling QML view.
This happened when scrolling a view using an Image delegate (containing
QSGTexture). All textures were deleted at exit, but it is important to
immediately schedule the texture for deletion whenever the delegate is
destroyed to avoid unnecessary high memory consumption.
Task-number: QTBUG-19511
Reviewed-by: gunnar
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index fa3be223a7..f1387418ef 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -876,6 +876,10 @@ bool QDeclarativePixmapReply::event(QEvent *event) int QDeclarativePixmapData::cost() const { + if (texture) { + const QSize textureSize = texture->textureSize(); + return textureSize.width() * textureSize.height(); + } return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8; } |