blink::Image has an API for resetting animations. If the animation is running on the impl thread then this will need to go with a commit but it can not be put on PaintImage. Investigate the use-cases for it and add support for it if necessary.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5af90d3a1e0bf88131443a22d272a3c89329ce66 commit 5af90d3a1e0bf88131443a22d272a3c89329ce66 Author: Khushal <khushalsagar@chromium.org> Date: Mon Sep 25 19:09:54 2017 blink: Apply ImageAnimationPolicy override to repetition count. The ImageAnimationPolicy can be used to override the number of repetitions made for an animated image in blink. Plumb this override to cc using PaintImage for the case where the animation is being ticked in the compositor. R=pdr@chromium.org Bug: 735743 Change-Id: I0bb65afc256274aadc9e76b007bbb402c93f1a99 Reviewed-on: https://chromium-review.googlesource.com/663531 Commit-Queue: Khushal <khushalsagar@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#504120} [modify] https://crrev.com/5af90d3a1e0bf88131443a22d272a3c89329ce66/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp [modify] https://crrev.com/5af90d3a1e0bf88131443a22d272a3c89329ce66/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp [modify] https://crrev.com/5af90d3a1e0bf88131443a22d272a3c89329ce66/third_party/WebKit/Source/platform/graphics/BitmapImage.h [modify] https://crrev.com/5af90d3a1e0bf88131443a22d272a3c89329ce66/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4 commit 3e58f9b7f44eadc1b5456a88939ab4fe861f42b4 Author: Khushal <khushalsagar@chromium.org> Date: Tue Sep 26 05:28:55 2017 cc/blink: Plumb resetting of image animations from blink to cc. The animation can be reset to start from the beginning in blink. Plumb this to cc to replicate this behaviour if image animations are being ticked by the compositor. This uses a counter sequence incremented on the main thread each time the animation is reset to act as a synchronization point, which is necessary since recordings can be cached and resued by blink. Bug: 735743 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I7ff6fe22b1c5179a1ea8ec893f5d239895a4d2a4 Reviewed-on: https://chromium-review.googlesource.com/664245 Commit-Queue: Khushal <khushalsagar@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/master@{#504290} [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/paint/discardable_image_map.cc [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/paint/discardable_image_map.h [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/paint/paint_image.h [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/paint/paint_image_builder.h [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/trees/image_animation_controller.cc [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/trees/image_animation_controller.h [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/cc/trees/image_animation_controller_unittest.cc [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/third_party/WebKit/Source/platform/graphics/BitmapImage.h [modify] https://crrev.com/3e58f9b7f44eadc1b5456a88939ab4fe861f42b4/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
Comment 1 by khushals...@chromium.org
, Jun 22 2017