429 {
431 if (!sdc) {
432 *errorMsg = kErrorMsg_DrawSkippedGpuOnly;
434 }
435
438
440 { { 0.31f *
w, 0.01f *
h}, { 0.48f *
w, 0.74f *
h }, { 0.19f *
w, 0.33f *
h } },
441 { { 0.00f *
w, 0.07f *
h}, { 0.30f *
w, 0.70f *
h }, { 0.47f *
w, 0.37f *
h } },
442 { { 0.15f *
w, 0.23f *
h}, { 0.49f *
w, 0.87f *
h }, { 0.85f *
w, 0.66f *
h } },
443 { { 0.09f *
w, 0.15f *
h}, { 0.42f *
w, 0.33f *
h }, { 0.17f *
w, 0.38f *
h } },
444 { { 0.98f *
w, 0.54f *
h}, { 0.83f *
w, 0.91f *
h }, { 0.62f *
w, 0.40f *
h } },
445 };
446
449
452
457
462
463 for (
int row = 0; row <
kNumQuads; ++row) {
467 {
x + baseControlPts[row][0].
fX,
y + baseControlPts[row][0].
fY},
468 {
x + baseControlPts[row][1].
fX,
y + baseControlPts[row][1].
fY},
469 {
x + baseControlPts[row][2].
fX,
y + baseControlPts[row][2].
fY}
470 };
471
472 for (
int i = 0;
i < 3; ++
i) {
473 canvas->
drawCircle(controlPts[
i], 6.f, ctrlPtPaint);
474 }
475
477
480
481 for (int c = 0; c < cnt; ++c) {
482 SkPoint* pts = chopped + 2 * c;
483
484 for (
int i = 0;
i < 3; ++
i) {
486 }
487
490
492
494
497 sdc->addDrawOp(std::move(op));
498 }
499 }
500
502 }
constexpr SkColor SK_ColorRED
int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5])
std::unique_ptr< GrOp > Owner
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
@ kPolygon_PointMode
draw the array of points as a open polygon
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
void setStrokeWidth(SkScalar width)
static GrOp::Owner Make(GrRecordingContext *context, const SkRect &rect, const SkPMColor4f &color, const GrPathUtils::QuadUVMatrix &devToUV)
Optional< SkRect > bounds
constexpr int kOpaqueBlack
SurfaceDrawContext * TopDeviceSurfaceDrawContext(const SkCanvas *canvas)
static SkRGBA4f FromBytes_RGBA(uint32_t color)