From 8524c30a971cd22fe1e3e0fd3db5988fe23272b6 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 22 Jan 2018 12:31:21 -0500 Subject: Make SkAnimatedImage::update return sentinel when stopped Bug: b/63908092 Change-Id: I585f3d3efde1db4d5be36b11f19fe6e88f131608 Reviewed-on: https://skia-review.googlesource.com/98062 Reviewed-by: Leon Scroggins Commit-Queue: Leon Scroggins --- include/android/SkAnimatedImage.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/android') diff --git a/include/android/SkAnimatedImage.h b/include/android/SkAnimatedImage.h index d2f4e3d66c..dc1ce0ac64 100644 --- a/include/android/SkAnimatedImage.h +++ b/include/android/SkAnimatedImage.h @@ -74,13 +74,17 @@ public: */ bool isFinished() const { return fFinished; } + /** + * Returned by update if the animation is not running. + */ + static constexpr double kNotRunning = -2.0; + /** * Update the current time. If the image is animating, this may decode * a new frame. * - * @return the time to show the next frame. - * Returns numeric_limits::max() if there is no max frame to - * show, and -1.0 if the animation is not running. + * @return the time to show the next frame, or kNotRunning if the animation + * is not running. */ double update(double msecs); -- cgit v1.2.3