aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/AnimatedImageTest.cpp
Commit message (Collapse)AuthorAge
* Fix drawing SkAnimatedImages with transparencyGravatar Leon Scroggins III2018-03-06
| | | | | | | | | | | | Bug: b/74195953 Do not use SkBlendMode::kSrc, which overwrites the pixels that were already present. Instead, blend normally. Change-Id: Ie6843c6278212fddddd0ba0ae292fdb5eaf2342e Reviewed-on: https://skia-review.googlesource.com/112200 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Leon Scroggins <scroggo@google.com>
* IWYU for test files starting with 'A'.Gravatar Ben Wagner2018-03-02
| | | | | | | | | | | | While testing some changes to iwyu, started fixing some files. Made it to AsADashTest.cpp before running into https://github.com/include-what-you-use/include-what-you-use/issues/364 Change-Id: I42b65df4f1f8116e0ea1b2cd774651990db1b132 Reviewed-on: https://skia-review.googlesource.com/111861 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Simplify SkAnimatedImageGravatar Leon Scroggins III2018-01-30
| | | | | | | | | | | | | Bug: b/63908092 Rather than keeping track of the time and whether the animation is running, leave that up to the client. Offer a single method to decode the next frame, allowing the client to stay one frame ahead. Change-Id: I546013e32e3a0874181b0dce1349bbec07aaadd4 Reviewed-on: https://skia-review.googlesource.com/101544 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add SkAnimatedImage::getRepetitionCountGravatar Leon Scroggins III2018-01-26
| | | | | | | | | | | | Bug: b/63908092 Android does not need to have its end listener attached if the repetition count is infinite. Provide an accessor so it will know. Change-Id: I481b048994a6e86ae88c913a5dcca3788b92bae2 Reviewed-on: https://skia-review.googlesource.com/99883 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Make SkAnimatedImage::update return sentinel when stoppedGravatar Leon Scroggins III2018-01-23
| | | | | | | | Bug: b/63908092 Change-Id: I585f3d3efde1db4d5be36b11f19fe6e88f131608 Reviewed-on: https://skia-review.googlesource.com/98062 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add SkAnimatedImage::isFinishedGravatar Leon Scroggins III2018-01-22
| | | | | | | | | | | Bug: b/63908092 Allows Android to know when to call onAnimationEnd. Change-Id: I9cc102fb485e944ad5983eed9f0b941153128e88 Reviewed-on: https://skia-review.googlesource.com/97401 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Respect repetition count in SkAnimatedImageGravatar Leon Scroggins III2018-01-22
Bug: b/63908092 By default use the repetition count stored in the encoded data (if any). Allow setting the repetition count manually, so that the animation will stop after n+1 total cycles (unless -1 is used for infinite). If the animation is complete, make start reset it. When the animation is not running, make update return max double (i.e. no need to update any time soon). Fix a bug where the first call to update returned -1. Share write_bm with CodecAnimTest, for debugging. Update Sample to check isRunning rather than keeping its own record of whether the animation is running. Change-Id: I883e4d7325f7a7b23a422fa9d756f9ea3018f0f8 Reviewed-on: https://skia-review.googlesource.com/97082 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>