[skottie] Explicit seek(0) in tools

With recent deferred image loading changes, Skottie relies on clients
to always/explicitly seek() before drawing a frame.

Some of the existing tools are still attempt to draw before the first
seek() fires (the animation callback is not guaranteed to occur before
the first draw).  For these, add an explicit seek(0) after loading the
animation, to ensure valid state.

TBR=
Change-Id: Ie453559af2d96560602b5e6508c25169dffb484d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258805
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/modules/skottie/gm/SkottieGM.cpp b/modules/skottie/gm/SkottieGM.cpp
index e81b406..f0d8c50 100644
--- a/modules/skottie/gm/SkottieGM.cpp
+++ b/modules/skottie/gm/SkottieGM.cpp
@@ -180,6 +180,7 @@
             fAnimation = skottie::Animation::Builder()
                             .setResourceProvider(sk_make_sp<MultiFrameResourceProvider>())
                             .make(stream.get());
+            fAnimation->seek(0);
         }
     }
 
diff --git a/tools/viewer/SkottieSlide.cpp b/tools/viewer/SkottieSlide.cpp
index 5ddc2f4..a40571c 100644
--- a/tools/viewer/SkottieSlide.cpp
+++ b/tools/viewer/SkottieSlide.cpp
@@ -107,6 +107,7 @@
     fTimeBase       = 0; // force a time reset
 
     if (fAnimation) {
+        fAnimation->seek(0);
         SkDebugf("Loaded Bodymovin animation v: %s, size: [%f %f]\n",
                  fAnimation->version().c_str(),
                  fAnimation->size().width(),