[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:
parent
ad3db40d78
commit
8bfe39160d
@ -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; }
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user