/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/
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. This is called once from filterPath, and provides the uv parameter bounds for the path. Subsequent calls to next() will receive u and v values within these bounds, and then a call to end() will signal the end of processing.
*/ virtualvoid begin(const SkIRect& uvBounds, SkPath* dst) const {} virtualvoid next(const SkPoint& loc, int u, int v, SkPath* dst) const {} virtualvoid end(SkPath* dst) const {}
/** Low-level virtual called per span of locations in the u-direction. The default implementation calls next() repeatedly with each location.
*/ virtualvoid nextSpan(int x, int y, int ucount, SkPath* path) 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 {
mat.mapPoints(&dst, &src, 1);
this->next(dst, x++, y, path);
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.