29#if defined(SK_GRAPHITE)
49 r->
offset(-
w/2 + woffset, -
h/2 + hoffset);
52 paint->setAlphaf(1.0f);
65#if defined(SK_GRAPHITE)
67 options->fMaxPathAtlasTextureSize = 0;
68 options->fAllowMultipleAtlasTextures =
false;
77 for (
int y = 0;
y < 2;
y++) {
87 for (
int i = 0;
i <
N;
i++) {
107 SkPath fMoveHfPath, fMoveZfPath, fDashedfPath, fRefPath[4];
108 SkPath fCubicPath, fQuadPath, fLinePath;
119 for (
int i = 0;
i < 3; ++
i) {
122 fRefPath[2].
addRect(
i * 10.f - 4, -2,
i * 10.f + 4, 6);
123 fRefPath[3].
addRect(
i * 10.f - 10, -10,
i * 10.f + 10, 10);
132 SkPaint fillPaint, strokePaint, dashPaint;
134 strokePaint = fillPaint;
136 for (
int i = 0;
i < 2; ++
i) {
143 canvas->
drawPath(fMoveHfPath, strokePaint);
145 canvas->
drawPath(fMoveZfPath, strokePaint);
146 dashPaint = strokePaint;
147 const SkScalar intervals[] = { 0, 10 };
152 canvas->
drawPath(fDashedfPath, dashPaint);
154 canvas->
drawPath(fRefPath[
i * 2], fillPaint);
158 canvas->
drawPath(fMoveHfPath, strokePaint);
160 canvas->
drawPath(fMoveZfPath, strokePaint);
163 canvas->
drawPath(fRefPath[1 +
i * 2], fillPaint);
165 canvas->
drawPath(fCubicPath, strokePaint);
167 canvas->
drawPath(fQuadPath, strokePaint);
169 canvas->
drawPath(fLinePath, strokePaint);
185 p.setAntiAlias(
true);
190 p.setStrokeWidth(
scale * 5);
197 void onDraw(
SkCanvas* canvas)
override {
210 p.setAntiAlias(
true);
212 p.setStrokeWidth(1.0720f);
214 path.moveTo(-6000,-6000);
215 path.cubicTo(-3500,5500,-500,5500,2500,-6500);
216 canvas->drawPath(
path,
p);
217 p.setStrokeWidth(1.0721f);
218 canvas->translate(10, 10);
219 canvas->drawPath(
path,
p);
220 p.setStrokeWidth(1.0722f);
221 canvas->translate(10, 10);
222 canvas->drawPath(
path,
p);
228 paint.setStrokeWidth(20);
229 paint.setAntiAlias(
true);
253 p.setAntiAlias(
true);
257 SkPoint pts[] = {{105.738571f,13.126318f},
258 {105.738571f,13.126318f},
263 memcpy(pts2, pts,
sizeof(pts));
265 pts2[0].
fX += tangent.
fX * capOutset;
266 pts2[0].
fY += tangent.
fY * capOutset;
267 pts2[1].
fX += tangent.
fX * capOutset;
268 pts2[1].
fY += tangent.
fY * capOutset;
269 pts2[2].
fX += -tangent.
fX * capOutset;
270 pts2[2].
fY += -tangent.
fY * capOutset;
271 path.moveTo(pts2[0]);
272 path.quadTo(pts2[1], pts2[2]);
273 canvas->drawPath(
path,
p);
277 path.quadTo(pts[1], pts[2]);
279 canvas->translate(30, 0);
280 canvas->drawPath(
path,
p);
289 for (
int i = 0;
i < 13;
i++) {
307 for (
int y = 0;
y < 2;
y++) {
317 for (
int i = 0;
i <
N/2;
i++) {
348 title->
set(
"CW CCW");
360 title->
set(
"CW CCW");
376 title->
set(
"CW CCW");
393 SkPaint strokePaint(origPaint);
397 make0, make1, make2, make3, make4, make5
412 for (
int j = 0; j < 13; ++j) {
414 canvas->
drawPath(orig, strokePaint);
442 paint.setStrokeWidth(0.055f);
444 canvas->
scale(1000, 1000);
465 p.setAntiAlias(
true);
467 p.setStrokeWidth(40);
471 path.moveTo(157.474f,111.753f);
472 path.cubicTo(128.5f,111.5f,35.5f,29.5f,35.5f,29.5f);
475 path.moveTo(250, 50);
476 path.quadTo(280, 80, 280, 80);
479 path.moveTo(150, 50);
480 path.conicTo(180, 80, 180, 80, 0.707f);
484 path.moveTo(157.474f,311.753f);
485 path.cubicTo(157.474f,311.753f,85.5f,229.5f,35.5f,229.5f);
488 path.moveTo(280, 250);
489 path.quadTo(280, 250, 310, 280);
492 path.moveTo(180, 250);
493 path.conicTo(180, 250, 210, 280, 0.707f);
518 paint.setStrokeWidth(11);
525 canvas->drawLine(100, 100, 100, 100,
paint);
528#ifdef PDF_IS_FIXED_SO_THIS_DOESNT_BREAK_IT
534 paint.setStrokeWidth(5);
541 for (
auto left : { 20.f, -100001.f } ) {
542 for (
auto top : { 20.f, -100001.f } ) {
543 for (
auto right : { 40.f, 100001.f } ) {
544 for (
auto bottom : { 40.f, 100001.f } ) {
546 canvas->clipRect({10, 10, 50, 50});
549 canvas->translate(60, 0);
552 canvas->translate(-60 * 4, 60);
563 {119, 71}, {129, 151}, {230, 24},
564 {200, 144}, {129, 151}, {230, 24},
565 {192, 176}, {224, 175}, {281, 103},
566 {233, 205}, {224, 175}, {281, 103},
567 {121, 216}, {234, 189}, {195, 147},
568 {141, 216}, {254, 189}, {238, 250},
569 {159, 202}, {269, 197}, {289, 165},
570 {159, 202}, {269, 197}, {287, 227},
584 canvas->translate(0, 50);
585 for (
size_t i = 0;
i <
std::size(pathPoints) / 3;
i++) {
587 canvas->drawPath(
path, pathPaint);
591 canvas->drawPath(fillPath, skeletonPaint);
593 canvas->translate(200, 0);
594 if ((
i + 1) % 4 == 0) {
595 canvas->translate(-800, 200);
607 path.moveTo(2.7854299545288085938, -6.9635753631591796875);
608 path.lineTo( 120.194366455078125, 40);
609 path.lineTo(-7.5000004768371582031, 91.07775115966796875);
610 path.lineTo(-7.5000004768371582031, -11.077748298645019531);
611 path.lineTo(2.7854299545288085938, -6.9635753631591796875);
612 path.moveTo(-2.7854299545288085938, 6.9635753631591796875);
614 path.lineTo( 7.5, 0);
615 path.lineTo(7.5000004768371582031, 68.92224884033203125);
616 path.lineTo( 79.805633544921875, 40);
617 path.lineTo(-2.7854299545288085938, 6.9635753631591796875);
622 canvas->translate(20.f, 20.f);
623 canvas->drawPath(
path,
p);
628 paint.setAntiAlias(
true);
631 path.moveTo(30.23983f, 48.5674667f);
632 path.lineTo(1.30884242f, 45.5222702f);
633 path.lineTo(2.97688866f, 29.6749554f);
634 path.lineTo(17.4423828f, 31.1975555f);
635 path.lineTo(2.94269657f, 30.0452003f);
636 path.lineTo(4.38597536f, 11.8849154f);
637 path.lineTo(33.3853493f, 14.1896257f);
643 path.moveTo(73.3853455f, 4.18963623f);
644 path.lineTo(69.995636f, 39.1360626f);
645 path.lineTo(42.83145142f, 21.056778f);
646 path.lineTo(42.97689819f, 19.6749573f);
647 path.lineTo(57.4423828f, 21.1975555f);
648 path.lineTo(42.94268799f, 20.0451965f);
649 path.lineTo(44.38595581f, 1.88491821f);
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void rotate(SkScalar degrees)
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kButt_Cap
no stroke extension
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
@ kStroke_Style
set to stroke geometry
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
SkScalar getStrokeWidth() const
@ kBevel_Join
connects outside edges
void setStrokeWidth(SkScalar width)
static bool FromSVGString(const char str[], SkPath *)
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPath & moveTo(SkScalar x, SkScalar y)
SkPath & lineTo(SkScalar x, SkScalar y)
static SkPath Polygon(const SkPoint pts[], int count, bool isClosed, SkPathFillType=SkPathFillType::kWinding, bool isVolatile=false)
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
void set(const SkString &src)
void onOnceBeforeDraw() override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
SkString getName() const override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
void onOnceBeforeDraw() override
SkString getName() const override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
virtual void modifyGraphiteContextOptions(skgpu::graphite::ContextOptions *) const
Optional< SkRect > bounds
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
DEF_SIMPLE_GM(CubicStroke, canvas, 384, 384)
static void rnd_rect(SkRect *r, SkPaint *paint, SkRandom &rand)
static SkRect inset(const SkRect &r)
static constexpr SkISize Make(int32_t w, int32_t h)
void inset(float dx, float dy)
void setXYWH(float x, float y, float width, float height)
void offset(float dx, float dy)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)