aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2018-05-23 16:15:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-23 20:49:42 +0000
commit4aafb3a8d12015067fae1301c2f5951f398eb25b (patch)
tree99f3f8476851cc141d35cd5ec944866207e1315c /experimental
parent1530f390087e48bd88981eeee69086ef9a52c243 (diff)
Alternate between two SkBitmaps in SkAnimatedImage
Bug: 78866720 The client in Android calls newPictureSnapshot, which results in copying the mutable SkBitmap into a newly allocated one in each frame. Avoid this by calling SkMakeImageFromRasterBitmap with kNever_SkCopyPixelsMode. Make SkAnimatedImage copy on write, by copying before decoding if the bitmap's pixel ref is not unique. Android's AnimatedImageDrawable's current architecture only decodes one frame in advance, so it will never need to perform the copy on write. This will save one bitmap allocation per GIF frame. Add a test to verify that copy on write works as expected. Change-Id: I87eb6e84089096cd2d618b91fb627fc58677e66a Reviewed-on: https://skia-review.googlesource.com/129841 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com> Auto-Submit: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'experimental')
0 files changed, 0 insertions, 0 deletions