aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/AnimatedImageTest.cpp
Commit message (Collapse)AuthorAge
* remove linear-blended sRGB dst support in softwareGravatar Mike Klein2018-06-06
| | | | | | | | | | | | | | | | | This is the mechanism we'd want to add back if we add an sRGBA SkColorType. This will break the DM "srgb" config hard. Landing this first should help flush out GMs that are incidentally using sRGB offscreens. Updated tests/AnimatedImageTest.cpp to avoid linear sRGB 8888 surfaces. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Change-Id: Idb5035cf4d60fcd1dc24c303d43a406fc4a603fa Reviewed-on: https://skia-review.googlesource.com/132261 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Alternate between two SkBitmaps in SkAnimatedImageGravatar Leon Scroggins III2018-05-23
| | | | | | | | | | | | | | | | | | | | | | 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>
* 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>