[skottie] Add animation in/out point getters

We already expose frame-index-based seek methods, makes sense to also
allow querying the in/out points.

Change-Id: I3b805f6df3484c8bdc7cd6c81e54b5073710e222
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308598
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Florin Malita 2020-08-07 09:05:50 -04:00 committed by Skia Commit-Bot
parent ad3db40d78
commit 8bfe39160d
2 changed files with 13 additions and 0 deletions

View File

@ -221,6 +221,16 @@ public:
*/
double fps() const { return fFPS; }
/**
* Animation in point, in frame index units.
*/
double inPoint() const { return fInPoint; }
/**
* Animation out point, in frame index units.
*/
double outPoint() const { return fOutPoint; }
const SkString& version() const { return fVersion; }
const SkSize& size() const { return fSize; }

View File

@ -383,6 +383,9 @@ DEF_TEST(Skottie_Annotations, reporter) {
.make(&stream);
REPORTER_ASSERT(reporter, animation);
REPORTER_ASSERT(reporter, animation->duration() == 10);
REPORTER_ASSERT(reporter, animation->inPoint() == 0.0);
REPORTER_ASSERT(reporter, animation->outPoint() == 100.0);
REPORTER_ASSERT(reporter, observer->fMarkers.size() == 2ul);
REPORTER_ASSERT(reporter, std::get<0>(observer->fMarkers[0]) == "marker_1");