Implement cache property for QQuickAnimatedImage
authorDaiwei Li <daiweili@suitabletech.com>
Sat, 28 Feb 2015 07:56:12 +0000 (23:56 -0800)
committerDaiwei Li <daiweili@suitabletech.com>
Fri, 6 Mar 2015 18:07:01 +0000 (18:07 +0000)
commit2a28bebdc8548c1171a3f255651edafe685da003
treee4239adb905c33df2f9f31dbe2234c65118ae6f9
parent1d2d771f552ff43a508ff301ff0906d8d61b729f
Implement cache property for QQuickAnimatedImage

Some longer and larger .gifs can consume a lot of memory
if every decoded frame is cached. Just as the backing QMovie
provides the ability to not cache frame, so should AnimatedImage.

This also allows a workaround for some animated image types
that can contain loops that aren't handled correctly (QTBUG-24869)
to not leak memory.

Change-Id: I0639461d75bb2c758917893e7a6ae5c215fffa9d
Task-number: QTBUG-44447
Task-number: QTBUG-24869
Task-number: QTBUG-28844
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/quick/items/qquickanimatedimage.cpp
src/quick/items/qquickanimatedimage_p.h
tests/auto/quick/qquickanimatedimage/data/colors_nocache.qml [new file with mode: 0644]
tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp