34 bool requires_moveto =
true) {
40 size_t contour_count = 1;
43 const auto next_offset = current_segment_offset + measure.getLength();
45 if (
start < next_offset) {
46 measure.getSegment(
start - current_segment_offset,
47 stop - current_segment_offset,
48 dst, requires_moveto);
50 if (stop <= next_offset)
55 current_segment_offset = next_offset;
56 }
while (measure.nextContour());
64 : fStartT(startT), fStopT(stopT),
fMode(mode) {}
68 if (fStartT >= fStopT) {
80 const auto arcStart = len * fStartT,
81 arcStop = len * fStopT;
86 if (arcStart < arcStop) {
87 add_segments(src, arcStart, arcStop, dst);
97 bool requires_moveto =
true;
100 const auto contour_count = add_segments(src, arcStop, len, dst);
104 if (contour_count == 1 && src.isLastContourClosed()) {
105 requires_moveto =
false;
109 add_segments(src, 0, arcStart, dst, requires_moveto);
117 buffer.writeScalar(fStartT);
118 buffer.writeScalar(fStopT);
119 buffer.writeUInt(
static_cast<uint32_t
>(fMode));
124 stop =
buffer.readScalar();
125 const auto mode =
buffer.readUInt();
142 startT =
SkTPin(startT, 0.f, 1.f);
143 stopT =
SkTPin(stopT, 0.f, 1.f);
static bool SkIsFinite(T x, Pack... values)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
bool onFilterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *, const SkMatrix &) const override
void flatten(SkWriteBuffer &) const override
SkTrimPE(SkScalar startT, SkScalar stopT, SkTrimPathEffect::Mode)
static sk_sp< SkPathEffect > Make(SkScalar startT, SkScalar stopT, Mode=Mode::kNormal)
@ kNormal
Default priority level.
static const uint8_t buffer[]