[skottie] Remove defensive seek(0) from Animation ctor
It potentially causes unnecessary image frame loads.
Well-behaved clients should always seek() before calling render().
Bug: skia:9686
Change-Id: If16257dc947941541d9ae8906b5ec7b1754dd7df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257625
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/modules/skottie/include/Skottie.h b/modules/skottie/include/Skottie.h
index 0741d91..723f674 100644
--- a/modules/skottie/include/Skottie.h
+++ b/modules/skottie/include/Skottie.h
@@ -148,6 +148,9 @@
/**
* Draws the current animation frame.
*
+ * It is undefined behavior to call render() on a newly created Animation
+ * before specifying an initial frame via one of the seek() variants.
+ *
* @param canvas destination canvas
* @param dst optional destination rect
* @param flags optional RenderFlags
diff --git a/modules/skottie/src/Skottie.cpp b/modules/skottie/src/Skottie.cpp
index 9479806..25be33d 100644
--- a/modules/skottie/src/Skottie.cpp
+++ b/modules/skottie/src/Skottie.cpp
@@ -550,11 +550,7 @@
, fOutPoint(outPoint)
, fDuration(duration)
, fFPS(fps)
- , fFlags(flags) {
-
- // In case the client calls render before the first tick.
- this->seek(0);
-}
+ , fFlags(flags) {}
Animation::~Animation() = default;