diff options
Diffstat (limited to 'modules/skottie/include/Skottie.h')
-rw-r--r-- | modules/skottie/include/Skottie.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/modules/skottie/include/Skottie.h b/modules/skottie/include/Skottie.h index 0a89ca0438..906ea82b68 100644 --- a/modules/skottie/include/Skottie.h +++ b/modules/skottie/include/Skottie.h @@ -48,9 +48,27 @@ public: ~Animation() override; - void render(SkCanvas*, const SkRect* dst = nullptr) const; - - void animationTick(SkMSec); + /** + * Draws the current animation frame. + * + * @param canvas destination canvas + * @param dst optional destination rect + */ + void render(SkCanvas* canvas, const SkRect* dst = nullptr) const; + + /** + * Updates the animation state for |t|. + * + * @param t normalized [0..1] frame selector, where 0 == inPoint and 1 == outPoint. + */ + void seek(SkScalar t); + + /** + * Returns the animation duration in seconds. + */ + SkScalar duration() const { + return (fOutPoint - fInPoint) / fFrameRate; + } const SkString& version() const { return fVersion; } const SkSize& size() const { return fSize; } |