27 fName =
"animated-rects";
35 fRect[
i].size = 10.0 + fRand.
nextF() * 40.0;
36 fRect[
i].speed = 1.0 + fRand.
nextF();
53 const AnimatedRect& r = fRect[
i];
54 canvas->
drawRect(
SkRect{r.
x, r.y, r.x + r.size, r.y + r.size}, fStrokePaint);
55 canvas->
drawRect(
SkRect{r.
x, r.y, r.x + r.size, r.y + r.size}, fFillPaint);
60 float seconds = 1
e-9 * nanos;
61 if (0.0f != fLastTime) {
62 float scale = (seconds - fLastTime) * 60;
65 AnimatedRect& r = fRect[
i];
66 r.x -= r.speed *
scale;
67 if (r.x + r.size < 0) {
84 SkPaint fStrokePaint, fFillPaint;
85 float fLastTime = 0.0f;
static constexpr int kNumRects
static constexpr int kWidth
static constexpr int kHeight
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
void load(SkScalar, SkScalar) override
bool animate(double nanos) override
void draw(SkCanvas *canvas) override
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
void setStrokeWidth(SkScalar width)
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
constexpr float x() const