From 2cb6cb1f338e655f63fa258efeaa38988ec6a7b3 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Sun, 21 Jan 2018 15:50:12 -0500 Subject: Add SkAnimatedImage::isFinished 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 Commit-Queue: Leon Scroggins --- include/android/SkAnimatedImage.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/android') diff --git a/include/android/SkAnimatedImage.h b/include/android/SkAnimatedImage.h index d74c6bec49..d2f4e3d66c 100644 --- a/include/android/SkAnimatedImage.h +++ b/include/android/SkAnimatedImage.h @@ -66,6 +66,14 @@ public: */ bool isRunning() const { return fRunning && !fFinished; } + /** + * Whether the animation completed. + * + * Returns true after all repetitions are complete, or an error stops the + * animation. Gets reset to false if the animation is restarted. + */ + bool isFinished() const { return fFinished; } + /** * Update the current time. If the image is animating, this may decode * a new frame. -- cgit v1.2.3