diff options
author | Leon Scroggins III <scroggo@google.com> | 2018-01-12 11:24:30 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-12 19:36:11 +0000 |
commit | 7a10b332a37dab94b1c59685714f6d8c28fc84b9 (patch) | |
tree | 45a7847d658bd1d9ff3e6499633c512933c0b1e3 /src/codec/SkCodecPriv.h | |
parent | 65fa8ca85ef146340ddea61bb08c182df499ca62 (diff) |
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 <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'src/codec/SkCodecPriv.h')
-rw-r--r-- | src/codec/SkCodecPriv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h index 84215b9fb3..a2a5dbd648 100644 --- a/src/codec/SkCodecPriv.h +++ b/src/codec/SkCodecPriv.h @@ -16,7 +16,7 @@ #include "SkImageInfo.h" #include "SkTypes.h" -#ifdef SK_PRINT_CODEC_MESSAGES +#if defined(SK_PRINT_CODEC_MESSAGES) || defined(SK_DEBUG) #define SkCodecPrintf SkDebugf #else #define SkCodecPrintf(...) |