Go to file
Leon Scroggins III 4aafb3a8d1 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>
2018-05-23 20:49:42 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Remove ColorCodecBench 2018-05-23 15:20:21 +00:00
bin Update gn 2018-05-23 12:11:06 +00:00
dm Use skcms for ICC parsing in HP codec test 2018-05-23 16:18:41 +00:00
docker [docker] Move to testing-slim as the base image. 2018-05-16 13:32:54 +00:00
docs Add usage of SkYUVAIndex as pre-step to transfer to new YUVA API 2018-05-23 18:50:53 +00:00
example Compile with GCC 7.2.0. 2018-03-13 22:18:18 +00:00
experimental [skottie] Sanitize polystar point counts 2018-05-14 21:41:39 +00:00
fuzz remove SkColorSpace::MakeICC() fuzzer 2018-05-23 16:31:11 +00:00
gm drawPosText no longer obeys paint alignment 2018-05-21 21:53:54 +00:00
gn Remove ColorCodecBench 2018-05-23 15:20:21 +00:00
include Alternate between two SkBitmaps in SkAnimatedImage 2018-05-23 20:49:42 +00:00
infra Upgrade Pixel devices. 2018-05-23 15:07:51 +00:00
platform_tools Remove "/" from the generated jUnit method names. 2018-05-23 15:12:41 +00:00
resources update ColorSpaceTest.cpp to remove MakeICC 2018-05-23 17:11:11 +00:00
samplecode Update SampleLua and lua files. 2018-05-22 15:51:25 +00:00
site Update markdown files 2018-05-22 06:51:44 +00:00
src Alternate between two SkBitmaps in SkAnimatedImage 2018-05-23 20:49:42 +00:00
tests Alternate between two SkBitmaps in SkAnimatedImage 2018-05-23 20:49:42 +00:00
third_party Roll skia/third_party/skcms 5bfec77..b01dbd2 (1 commits) 2018-05-23 15:16:11 +00:00
tools Remove "/" from the generated jUnit method names. 2018-05-23 15:12:41 +00:00
.clang-format Update clang-format matching more of Chromium 2018-05-23 18:04:41 +00:00
.gitignore [lottiecap] Moved over from buildbot repo. 2018-03-20 13:25:23 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Fixed SkVertices crashing on Windows DLL builds 2018-04-22 14:42:01 +00:00
BUILD.gn Remove include/gpu/mtl from include directories. 2018-05-23 17:42:41 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll third_party/externals/angle2/ be7f44fb5..586750168 (1 commit) 2018-05-23 18:59:41 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
OWNERS add OWNERS file 2017-12-01 19:50:19 +00:00
PRESUBMIT.py Revert "Update docs preview URL in presubmit" 2018-05-22 15:29:15 +00:00
public.bzl Remove SK_SUPPORT_LEGACY_BACKEND_OBJECTS from public.bzl. 2018-05-03 18:14:41 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Reland "Whitespace change" 2018-04-14 01:24:11 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.