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);
210 p.setAntiAlias(
true);
212 p.setStrokeWidth(1.0720f);
214 path.moveTo(-6000,-6000);
215 path.cubicTo(-3500,5500,-500,5500,2500,-6500);
217 p.setStrokeWidth(1.0721f);
220 p.setStrokeWidth(1.0722f);
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]);
277 path.quadTo(pts[1], pts[2]);
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");
366 r.
inset(bounds.width() / 10, -bounds.height() / 10);
374 r.
inset(bounds.width() / 10, -bounds.height() / 10);
376 title->
set(
"CW CCW");
393 SkPaint strokePaint(origPaint);
397 make0, make1, make2, make3, make4, make5
406 for (
size_t i = 0; i < std::size(procs); ++i) {
409 procs[i](&orig, bounds, &str);
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);
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 } ) {
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},
585 for (
size_t i = 0; i < std::size(pathPoints) / 3; i++) {
591 canvas->
drawPath(fillPath, skeletonPaint);
594 if ((i + 1) % 4 == 0) {
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);
#define SkAssertResult(cond)
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 drawRect(const SkRect &rect, const SkPaint &paint)
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 clear(SkColor color)
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
SkString getName() const override
SkISize getISize() 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
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
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)