28 fSecondHalf = preFetch();
64 if (fUnparseable || !walk()) {
75void SkOpEdgeBuilder::closeContour(
const SkPoint& curveEnd,
const SkPoint& curveStart) {
78 *fPathPts.
append() = curveStart;
80 int verbCount = fPathVerbs.
size();
81 int ptsCount = fPathPts.
size();
83 && fPathPts[ptsCount - 2] == curveStart) {
87 fPathPts[ptsCount - 1] = curveStart;
93int SkOpEdgeBuilder::preFetch() {
100 bool lastCurve =
false;
105 if (!fAllowOpenContours && lastCurve) {
106 closeContour(curve[0], curveStart);
108 *fPathVerbs.
append() = verb;
110 *fPathPts.
append() = curve[0];
111 curveStart = curve[0];
117 uint8_t lastVerb = fPathVerbs.
back();
119 fPathPts.
back() = curve[0] = curve[1];
152 closeContour(curve[0], curveStart);
158 *fPathVerbs.
append() = verb;
160 fPathPts.
append(ptCount, &curve[1]);
164 curve[0] = curve[ptCount];
167 if (!fAllowOpenContours && lastCurve) {
168 closeContour(curve[0], curveStart);
171 return fPathVerbs.
size() - 1;
174bool SkOpEdgeBuilder::close() {
179bool SkOpEdgeBuilder::walk() {
180 uint8_t* verbPtr = fPathVerbs.
begin();
181 uint8_t* endOfFirstHalf = &verbPtr[fSecondHalf];
186 int moveToPtrBump = 0;
188 if (verbPtr == endOfFirstHalf) {
195 if (fAllowOpenContours) {
197 }
else if (!close()) {
204 contour->init(fGlobalState, fOperand,
206 pointsPtr += moveToPtrBump;
210 fContourBuilder.
addLine(pointsPtr);
214 SkVector vec1 = pointsPtr[1] - pointsPtr[0];
215 SkVector vec2 = pointsPtr[2] - pointsPtr[1];
216 if (vec1.
dot(vec2) < 0) {
224 for (
unsigned index = 0; index <
std::size(pair); ++index) {
233 fContourBuilder.
addCurve(v1, curve1);
240 fContourBuilder.
addQuad(pointsPtr);
243 SkVector vec1 = pointsPtr[1] - pointsPtr[0];
244 SkVector vec2 = pointsPtr[2] - pointsPtr[1];
246 if (vec1.
dot(vec2) < 0) {
249 if (0 < maxCurvature && maxCurvature < 1) {
252 if (!
conic.chopAt(maxCurvature, pair)) {
254 fContourBuilder.
addConic(pointsPtr, weight);
263 fContourBuilder.
addCurve(v1, curve1, pair[0].fW);
264 fContourBuilder.
addCurve(
v2, curve2, pair[1].fW);
269 fContourBuilder.
addConic(pointsPtr, weight);
279 fContourBuilder.
addCubic(pointsPtr);
292 for (
int index = 0; index <= breaks; ++index) {
293 Splitsville* split = &splits[index];
294 split->fT[0] = index ? splitT[index - 1] : 0;
295 split->fT[1] = index < breaks ? splitT[index] : 1;
302 ? split->fPts : split->fReduced;
305 for (
int index = 0; index <= breaks; ++index) {
306 Splitsville* split = &splits[index];
307 if (!split->fCanAdd) {
311 while (prior > 0 && !splits[prior - 1].fCanAdd) {
315 split->fT[0] = splits[prior].fT[0];
316 split->fPts[0] = splits[prior].fPts[0];
320 while (
next < breakLimit && !splits[
next + 1].fCanAdd) {
324 split->fT[1] = splits[
next].fT[1];
325 split->fPts[3] = splits[
next].fPts[3];
327 if (prior < index || next > index) {
331 ? split->fPts : split->fReduced;
335 fContourBuilder.
addCurve(split->fVerb, curve);
356 fContourBuilder.
flush();
357 if (
contour &&
contour->count() &&!fAllowOpenContours && !close()) {
static float next(float f)
#define SkDEBUGFAIL(message)
static bool SkIsFinite(T x, Pack... values)
SkScalar SkFindQuadMaxCurvature(const SkPoint src[3])
int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5])
static SkPoint force_small_to_zero(const SkPoint &pt)
static bool can_add_curve(SkPath::Verb verb, SkPoint *curve)
const double FLT_EPSILON_ORDERABLE_ERR
int SkPathOpsVerbToPoints(SkPath::Verb verb)
void SkTQSort(T *begin, T *end, const C &lessThan)
void addConic(SkPoint pts[3], SkScalar weight)
void addCurve(SkPath::Verb verb, const SkPoint pts[4], SkScalar weight=1)
void setContour(SkOpContour *contour)
void addCubic(SkPoint pts[4])
void addQuad(SkPoint pts[3])
void addLine(const SkPoint pts[2])
SkOpContour * appendContour()
void remove(SkOpContour *contour)
void addOperand(const SkPath &path)
SkPathFillType getFillType() const
static float min(float r, float g, float b)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
bool toFloatPoints(SkPoint *) const
static SkDCubic SubDivide(const SkPoint a[kPointCount], double t1, double t2)
static int ComplexBreak(const SkPoint pts[4], SkScalar *t)
static bool ApproximatelyEqual(const SkPoint &a, const SkPoint &b)
float dot(const SkVector &vec) const
static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint *reducePts)
static SkPath::Verb Conic(const SkConic &conic, SkPoint *reducePts)
static SkPath::Verb Quad(const SkPoint pts[3], SkPoint *reducePts)