class Sk2DPathEffect : public SkPathEffectBase {
public:
Sk2DPathEffect(const SkMatrix& mat) : fMatrix(mat) { // Calling invert will set the type mask on both matrices, making them thread safe.
fMatrixIsInvertible = fMatrix.invert(&fInverse);
}
protected: /** New virtual, to be overridden by subclasses. ThisiscalledoncefromfilterPath,andprovidesthe uvparameterboundsforthepath.Subsequentcallsto next()willreceiveuandvvalueswithinthesebounds, andthenacalltoend()willsignaltheendofprocessing.
*/
virtual void begin(const SkIRect& uvBounds, SkPathBuilder* dst) const {}
virtual void next(const SkPoint& loc, int u, int v, SkPathBuilder* dst) const {}
virtual void end(SkPathBuilder* dst) const {}
/** Low-level virtual called per span of locations in the u-direction. Thedefaultimplementationcallsnext()repeatedlywitheach location.
*/
virtual void nextSpan(int x, int y, int ucount, SkPathBuilder* builder) const { if (!fMatrixIsInvertible) { return;
} #ifdefined(SK_BUILD_FOR_FUZZER) if (ucount > 100) { return;
} #endif
const SkMatrix& mat = this->getMatrix();
SkPoint src, dst;
src.set(SkIntToScalar(x) + SK_ScalarHalf, SkIntToScalar(y) + SK_ScalarHalf); do {
dst = mat.mapPoint(src);
this->next(dst, x++, y, builder);
src.fX += SK_Scalar1;
} while (--ucount > 0);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.