29 bool fRunning =
false;
30 double fCurrentTime = 0.0;
31 double fLastWallTime = 0.0;
32 double fTimeToShowNextFrame = 0.0;
46 fYOffset =
bounds.height();
66 const double lastWallTime = fLastWallTime;
70 fCurrentTime += fLastWallTime - lastWallTime;
71 if (fCurrentTime > fTimeToShowNextFrame) {
105 fRunning = !fRunning;
112 fCurrentTime = fLastWallTime;
static constexpr char kPauseKey
static constexpr char kResetKey
sk_sp< SkData > GetResourceAsData(const char *resource)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
void draw(SkCanvas *canvas) override
bool onChar(SkUnichar uni) override
void load(SkScalar w, SkScalar h) override
bool animate(double nanos) override
static std::unique_ptr< SkAndroidCodec > MakeFromCodec(std::unique_ptr< SkCodec >)
static sk_sp< SkAnimatedImage > Make(std::unique_ptr< SkAndroidCodec >, const SkImageInfo &info, SkIRect cropRect, sk_sp< SkPicture > postProcess)
int currentFrameDuration()
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawDrawable(SkDrawable *drawable, const SkMatrix *matrix=nullptr)
static std::unique_ptr< SkCodec > MakeFromData(sk_sp< SkData >, SkSpan< const SkCodecs::Decoder > decoders, SkPngChunkReader *=nullptr)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkDrawable > finishRecordingAsDrawable()
const char * c_str() const
Optional< SkRect > bounds
static SkMSec NanosToMSec(double nanos)
font
Font Metadata and Metrics.
constexpr float width() const