DescriptionDon't recreate SkImages for high-res (GIF) animations.
Since original patch [1], pixel data caching got moved to skia discardable
memory and recently to SoftwareImageDecodeController.
As ImageDecoder already caches only one (2 in some cases) frame, this code's
effect was to remove SkImage for animations where all combined frames data is
over 5 MB.
[1] original patch, @pkasting, Dec 2008
https://chromium.googlesource.com/chromium/src/+/f868b0862a903e2a4ffa0fc975080a09ad73cb64
The problem caused here (re-decoding and increased memory allocation) is that
SkImage::uniqueID() is used as SoftwareImageDecodeController::decoded_images_
cache key - clearing it causes that cache is filled for every loop and every
frame rendered (always decoding and adding to cache). Next loop's SkImages
have different uniqueId and keep filling up the cache with duplicates of
same frames, evicting useful content. Detailed information about the issue
is in comment here [2]
[2]
https://bugs.chromium.org/p/chromium/issues/detail?id=165750#c13
BUG=165750
Patch Set 1 #Patch Set 2 : review #4 fix. Thanks @pkasting. #
Total comments: 1
Messages
Total messages: 14 (4 generated)
|