47#include <initializer_list>
61 canvas->saveLayer(rec);
63 canvas->drawCircle(128, 128, 96,
paint);
120 for (
int i = 0;
i < 8; ++
i) {
122 c = (c & 0xFFFFFF) | 0x80000000;
132 const char text[] =
"This is a very long line of text";
135 for (
bool useDrawBehind : {
false,
true}) {
139 canvas->translate(0, 350);
140 canvas->saveLayer({0, 0, 400, 320},
nullptr);
145 canvas->translate(430, 0);
160 canvas->drawOval(r,
paint);
162 paint.setAlphaf(1.0f/n);
166 canvas->translate(r.width(), 0);
170 canvas->saveLayer(rec);
171 for (
int i = 0;
i < n; ++
i) {
172 canvas->drawOval(r,
paint);
180 SkRect tex[] = {{0, 0, 100, 100}, {0, 0, 100, 100}};
196 SkPoint pts[] = {{0, 0}, {0, 100}, {100, 100}, {100, 0}, {100, 100}, {0, 100}};
207 SkPoint pts[] = {{50, 50}, {75, 75}};
210 paint.setStrokeWidth(100);
243 for (
bool injectExtraOp : {
false,
true}) {
256 canvas->drawPicture(pic);
257 canvas->translate(160, 0);
260 canvas->translate(0, 160);
const char *(* DrawProc)(const BezierRec *, int)
@ kSrcOver
r = s + (1-sa)*d
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
sk_sp< T > sk_ref_sp(T *obj)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static void DrawBehind(SkCanvas *canvas, const SkPaint &paint)
static int SaveBehind(SkCanvas *canvas, const SkRect *subset)
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void experimental_DrawEdgeAAImageSet(const ImageSetEntry imageSet[], int cnt, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *paint=nullptr, SrcRectConstraint constraint=kStrict_SrcRectConstraint)
@ kInitWithPrevious_SaveLayerFlag
initializes with previous contents
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
@ kPoints_PointMode
draw each point separately
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
int saveLayerAlphaf(const SkRect *bounds, float alpha)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
@ kStroke_Style
set to stroke geometry
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
FlutterSemanticsFlag flags
sk_sp< const SkImage > image
PODArray< SkRSXform > xforms
PODArray< SkColor > colors
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
font
Font Metadata and Metrics.
static void draw_list(SkCanvas *canvas, sk_sp< SkTextBlob > blob, bool useDrawBehind)
static void draw_points(SkCanvas *canvas, SkImage *image)
static void draw_image_set(SkCanvas *canvas, SkImage *image)
static void draw_vertices(SkCanvas *canvas, SkImage *image)
static void draw_atlas(SkCanvas *canvas, SkImage *image)
DEF_SIMPLE_GM(savelayer_initfromprev, canvas, 256, 256)
static void draw_cell(SkCanvas *canvas, sk_sp< SkTextBlob > blob, SkColor c, SkScalar w, SkScalar h, bool useDrawBehind)
SaveLayerFlags fSaveLayerFlags
constexpr SkRect makeOffset(float dx, float dy) const
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
static constexpr SkRect MakeWH(float w, float h)