From: Bjørn Erik Nilsen Date: Thu, 26 May 2011 13:12:37 +0000 (+0200) Subject: Textures not scheduled for deletion while scrolling QML view. X-Git-Tag: qt-v5.0.0-alpha1~2170^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfb347a463ceff05628abea6a105f6c83f100725;p=profile%2Fivi%2Fqtdeclarative.git 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 --- diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index fa3be22..f138741 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; }