21 explicit operator bool()
const {
return fAnimation !=
nullptr; }
26 if (fAnimationSize.
width() > 0 && fAnimationSize.
height() > 0) {
41 fAnimation->
render(canvas);
48 fAnimationSize = fAnimation ? fAnimation->
size() :
SkSize{0, 0};
71 double fStartTime = 0;
72 float fAnimationMoment = 0;
75 bool fStopAtEnd =
false;
85 return fAnimationMoment;
88 if (fStopAtEnd &&
time >= fDuration) {
90 fAnimationMoment = fDuration;
91 return fAnimationMoment;
93 return std::fmod(
time, fDuration);
108 fAnimationMoment = std::fmod(seconds, fDuration);
116 double offset = (fAnimationMoment >= fDuration) ? 0 : -1e9 * fAnimationMoment;
133- (bool)loadAnimation:(NSData*) data {
145- (void)seek:(
float)seconds {
151- (CGSize)
size {
return {(CGFloat)fDraw.size().width(), (CGFloat)fDraw.size().height()}; }
153- (bool)togglePaused {
160- (void)
draw:(CGRect)rect toCanvas:(
SkCanvas*)canvas atSize:(CGSize)size {
162 if (
rect.size.width > 0 &&
rect.size.height > 0 && fDraw && canvas) {
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void load(const void *data, size_t length)
void draw(SkSize size, SkCanvas *canvas)
~SkAnimationDraw()=default
SkAnimationDraw()=default
void drawRect(const SkRect &rect, const SkPaint &paint)
void concat(const SkMatrix &matrix)
void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty)
void setStopAtEnd(bool s)
void setDuration(float d)
const SkSize & size() const
void seekFrameTime(double t, sksg::InvalidationController *=nullptr)
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
static float min(float r, float g, float b)
constexpr SkColor4f kWhite
sk_sp< SkBlender > blender SkRect rect
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static double time(int loops, Benchmark *bench, Target *target)
std::shared_ptr< const fml::Mapping > data