29#define MAX_REASONABLE_ITERATIONS 100000
41 while (distance < length && --governor >= 0) {
77 SkASSERT(advance > 0 && !path.isEmpty());
87 if (phase > advance) {
91 if (phase > advance) {
94 phase = advance - phase;
97 if (phase >= advance) {
103 fInitialOffset = phase;
114 return fInitialOffset;
129 buffer.writeScalar(fAdvance);
131 buffer.writeScalar(fInitialOffset);
136 const char*
getTypeName()
const override {
return "SkPath1DPathEffect"; }
149 for (
int i = 0; i <
count; i++) {
164 matrix.setSinCos(tangent.
fY, tangent.
fX, 0, 0);
165 matrix.preTranslate(-sx, 0);
167 matrix.mapPoints(&dst[i], &pt, 1);
188 dst->moveTo(dstP[0]);
198 dst->quadTo(dstP[0], dstP[1]);
203 dst->conicTo(dstP[0], dstP[1], iter.
conicWeight());
208 dst->cubicTo(dstP[0], dstP[1], dstP[2]);
223#if defined(SK_BUILD_FOR_FUZZER)
224 if (dst->countPoints() > 100000) {
238 dst->addPath(fPath, matrix);
252 if (advance <= 0 || !
SkIsFinite(advance, phase) || path.isEmpty()) {
static bool morphpoints(SkPoint dst[], const SkPoint src[], int count, SkPathMeasure &meas, SkScalar dist)
static void morphpath(SkPath *dst, const SkPath &src, SkPathMeasure &meas, SkScalar dist)
#define MAX_REASONABLE_ITERATIONS
#define SkDEBUGFAIL(message)
#define SK_REGISTER_FLATTENABLE(type)
static bool SkIsFinite(T x, Pack... values)
#define SkScalarMod(x, y)
#define SkScalarAve(a, b)
virtual SkScalar next(SkPath *dst, SkScalar dist, SkPathMeasure &) const =0
bool onFilterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *, const SkMatrix &) const override
bool computeFastBounds(SkRect *) const override
virtual SkScalar begin(SkScalar contourLength) const =0
sk_sp< SkFlattenable >(* Factory)(SkReadBuffer &)
SkPath1DPathEffectImpl(const SkPath &path, SkScalar advance, SkScalar phase, SkPath1DPathEffect::Style style)
void flatten(SkWriteBuffer &buffer) const override
SkScalar next(SkPath *, SkScalar, SkPathMeasure &) const override
const char * getTypeName() const override
bool onFilterPath(SkPath *dst, const SkPath &src, SkStrokeRec *rec, const SkRect *cullRect, const SkMatrix &ctm) const override
static sk_sp< SkFlattenable > CreateProc(SkReadBuffer &buffer)
Factory getFactory() const override
SkScalar begin(SkScalar contourLength) const override
static void RegisterFlattenables()
static sk_sp< SkPathEffect > Make(const SkPath &path, SkScalar advance, SkScalar phase, Style)
bool getMatrix(SkScalar distance, SkMatrix *matrix, MatrixFlags flags=kGetPosAndTan_MatrixFlag)
bool getPosTan(SkScalar distance, SkPoint *position, SkVector *tangent)
Verb next(SkPoint pts[4])
SkScalar conicWeight() const
uint32_t getGenerationID() const
void updateBoundsCache() const
static const uint8_t buffer[]
void set(float x, float y)