49 {
59 int wedges[] = { 6, 12, 36 };
61 for (int wedge : wedges) {
66 int dashUnits = 0;
67 for (int index = 0; index < dashExample.length; ++index) {
68 dashUnits += dashExample.pattern[index];
69 }
70 SkScalar unitLength = arcLength / dashUnits;
72 for (int index = 0; index < wedge; ++index) {
73 for (int i2 = 0; i2 < dashExample.length; i2 += 2) {
74 SkScalar span = dashExample.pattern[i2] * unitLength;
78 angle += span + (dashExample.pattern[i2 + 1]) * unitLength;
79 }
80 }
90 int intervalCount = dashExample.length;
91 SkScalar dashLength = circumference / wedge / dashUnits;
92 for (int index = 0; index < dashExample.length; ++index) {
93 intervals[index] = dashExample.pattern[index] * dashLength;
94 }
101 }
104 }
105 }
void translate(SkScalar dx, SkScalar dy)
void rotate(SkScalar degrees)
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeWidth(SkScalar width)
SkPathBuilder & arcTo(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg, bool forceMoveTo)
SkPathBuilder & moveTo(SkPoint pt)
static SkPath Circle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
struct DashExample dashExamples[]
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)