From 7a10b332a37dab94b1c59685714f6d8c28fc84b9 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Fri, 12 Jan 2018 11:24:30 -0500 Subject: Add an SkDrawable for animated images (e.g. GIF) Bug: b/63909536 SkAnimatedImage is a simple drawable for animating a GIF. Thread-safety is left up to the client. At most two bitmaps are stored in the drawable; one for the current frame and one for a frame that may need to be restored. The backup frame prevents some cases where we would otherwise have to re-decode from the beginning of the image. The API lets the client set the time value, and decodes to match that time. TODO: - Callback for when the animation is complete - Ability to use SkAndroidCodec - Modify the loop count (or leave that up to client?) - Better and/or client-specific caching Other changes: - Add a sample which animates a GIF - Reenable SK_CODEC_PRINTF for debug builds and Android Change-Id: I945ffbccdb6008f2a05ed4d9b2af869a261fb300 Reviewed-on: https://skia-review.googlesource.com/93420 Reviewed-by: Derek Sollenberger Commit-Queue: Leon Scroggins --- gn/samples.gni | 1 + 1 file changed, 1 insertion(+) (limited to 'gn/samples.gni') diff --git a/gn/samples.gni b/gn/samples.gni index fe2ab4eba7..3ee15aed85 100644 --- a/gn/samples.gni +++ b/gn/samples.gni @@ -16,6 +16,7 @@ samples_sources = [ "$_samplecode/SampleAARects.cpp", "$_samplecode/SampleAll.cpp", "$_samplecode/SampleAndroidShadows.cpp", + "$_samplecode/SampleAnimatedImage.cpp", "$_samplecode/SampleAnimatedText.cpp", "$_samplecode/SampleAnimBlur.cpp", "$_samplecode/SampleArc.cpp", -- cgit v1.2.3