#include <Skottie.h>
Definition at line 93 of file Skottie.h.
◆ RenderFlags
◆ RenderFlag
Enumerator |
---|
kSkipTopLevelIsolation | |
kDisableTopLevelClipping | |
Definition at line 210 of file Skottie.h.
210 : uint32_t {
211
212
213
215
216
217
219 };
@ kDisableTopLevelClipping
◆ ~Animation()
skottie::Animation::~Animation |
( |
| ) |
|
|
default |
◆ duration()
double skottie::Animation::duration |
( |
| ) |
const |
|
inline |
Returns the animation duration in seconds.
Definition at line 268 of file Skottie.h.
◆ fps()
double skottie::Animation::fps |
( |
| ) |
const |
|
inline |
Returns the animation frame rate (frames / second).
Definition at line 273 of file Skottie.h.
◆ inPoint()
double skottie::Animation::inPoint |
( |
| ) |
const |
|
inline |
◆ Make() [1/2]
sk_sp< Animation > skottie::Animation::Make |
( |
const char * |
data, |
|
|
size_t |
length |
|
) |
| |
|
static |
Animation factories.
Use the Builder helper above for more options/control.
Definition at line 534 of file Skottie.cpp.
534 {
536}
DlVertices::Builder Builder
◆ Make() [2/2]
◆ MakeFromFile()
sk_sp< Animation > skottie::Animation::MakeFromFile |
( |
const char |
path[] | ) |
|
|
static |
◆ outPoint()
double skottie::Animation::outPoint |
( |
| ) |
const |
|
inline |
◆ render() [1/2]
Definition at line 486 of file Skottie.cpp.
486 {
488
489 if (!fSceneRoot)
490 return;
491
493
495 if (dstR) {
497 }
498
501 }
502
503 if ((fFlags & Flags::kRequiresTopLevelIsolation) &&
505
506
508 }
509
510 fSceneRoot->
render(canvas);
511}
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void concat(const SkMatrix &matrix)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
@ kCenter_ScaleToFit
scales and aligns to center
const SkSize & size() const
void render(SkCanvas *, const RenderContext *=nullptr) const
static constexpr SkRect MakeSize(const SkSize &size)
#define TRACE_EVENT0(category_group, name)
◆ render() [2/2]
void skottie::Animation::render |
( |
SkCanvas * |
canvas, |
|
|
const SkRect * |
dst = nullptr |
|
) |
| const |
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.
- Parameters
-
canvas | destination canvas |
dst | optional destination rect |
flags | optional RenderFlags |
Definition at line 482 of file Skottie.cpp.
482 {
483 this->
render(canvas, dstR, 0);
484}
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
◆ seek()
[Deprecated: use one of the other versions.]
Updates the animation state for |t|.
- Parameters
-
t | normalized [0..1] frame selector (0 -> first frame, 1 -> final frame) |
ic | optional invalidation controller (dirty region tracking) |
Definition at line 244 of file Skottie.h.
244 {
246 }
void seekFrameTime(double t, sksg::InvalidationController *=nullptr)
◆ seekFrame()
Update the animation state to match |t|, specified as a frame index i.e. relative to duration() * fps().
Fractional values are allowed and meaningful - e.g.
0.0 -> first frame 1.0 -> second frame 0.5 -> halfway between first and second frame
Definition at line 513 of file Skottie.cpp.
513 {
515
516 if (!fSceneRoot)
517 return;
518
519
520 const auto kLastValidFrame = std::nextafterf(fOutPoint, fInPoint),
521 comp_time = SkTPin<float>(fInPoint + t, fInPoint, kLastValidFrame);
522
523 for (const auto& anim : fAnimators) {
524 anim->seek(comp_time);
525 }
526
528}
static const SkMatrix & I()
const SkRect & revalidate(InvalidationController *, const SkMatrix &)
◆ seekFrameTime()
Update the animation state to match t, specifed in frame time i.e. relative to duration().
Definition at line 530 of file Skottie.cpp.
530 {
532}
void seekFrame(double t, sksg::InvalidationController *ic=nullptr)
◆ size()
const SkSize & skottie::Animation::size |
( |
| ) |
const |
|
inline |
◆ version()
const SkString & skottie::Animation::version |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: