8#ifndef SkPathPriv_DEFINED
9#define SkPathPriv_DEFINED
56 return gOppositeDir[(unsigned)
dir];
68 int verbCount =
path.countVerbs();
72 auto verbs =
path.fPathRef->verbsBegin();
73 for (
int i = 0;
i < verbCount;
i++) {
75 case SkPath::Verb::kMove_Verb:
81 case SkPath::Verb::kClose_Verb:
82 if (
i == verbCount - 1) {
96 int verbCount =
path.countVerbs();
97 auto verbs =
path.fPathRef->verbsBegin();
98 for (
int i = 0;
i < verbCount;
i++) {
99 if (verbs[
i] != SkPath::Verb::kMove_Verb) {
107 path.fPathRef->addGenIDChangeListener(std::move(listener));
179 :
path.fPathRef->verbsEnd(),
184 : fVerbsBegin(verbsBegin), fVerbsEnd(verbsEnd), fPoints(
points), fWeights(weights) {
186 SkPath::RangeIter
begin() {
return {fVerbsBegin, fPoints, fWeights}; }
187 SkPath::RangeIter
end() {
return {fVerbsEnd,
nullptr,
nullptr}; }
189 const uint8_t* fVerbsBegin;
190 const uint8_t* fVerbsEnd;
199 return path.fPathRef->verbsBegin();
204 return path.fPathRef->points();
209 return path.fPathRef->countWeights();
214 return path.fPathRef->conicWeights();
219 return path.fPathRef->unique();
224 return path.hasComputedBounds();
293 constexpr SkScalar scale_down_to_allow_for_small_multiplies = 0.25f;
306 static const uint8_t gPtsInVerb[] = {
317 return gPtsInVerb[verb];
323 static const uint8_t gPtsInVerb[] = {
334 return gPtsInVerb[verb];
341 if (pts[0] != pts[
i]) {
369 return (
static_cast<int>(fill) & 2) != 0;
401 SkASSERT(index < path->countPoints());
404 path->dirtyAfterEdit();
408 return path.getConvexity();
411 return path.getConvexityOrUnknown();
414 path.setConvexity(c);
418 (void)
path.isConvex();
422 builder->privateReverseAddPath(reverseMe);
427 const uint8_t verbs[],
432 return SkPath::MakeInternal(analysis,
points, verbs, verbCount, conics, fillType,
443 const uint8_t* fVerbs;
444 const uint8_t* fVerbsStop;
449 bool fNeedsCloseLine;
450 bool fNextIsNewContour;
451 SkDEBUGCODE(
bool fIsConic;)
454 kIllegalEdgeValue = 99
462 return *fConicWeights;
482 explicit operator bool() {
return fPts !=
nullptr; }
486 auto closeline = [&]() {
487 fScratch[0] =
fPts[-1];
488 fScratch[1] = *fMoveToPtr;
489 fNeedsCloseLine =
false;
490 fNextIsNewContour =
true;
496 if (fVerbs == fVerbsStop) {
497 return fNeedsCloseLine
499 :
Result{
nullptr,
Edge(kIllegalEdgeValue),
false };
502 SkDEBUGCODE(fIsConic =
false;)
504 const auto v = *fVerbs++;
507 if (fNeedsCloseLine) {
508 auto res = closeline();
513 fNextIsNewContour =
true;
516 if (fNeedsCloseLine)
return closeline();
520 const int pts_count = (v+2) / 2,
521 cws_count = (v & (v-1)) / 2;
524 fNeedsCloseLine =
true;
526 fConicWeights += cws_count;
529 SkASSERT(fIsConic == (cws_count > 0));
531 bool isNewContour = fNextIsNewContour;
532 fNextIsNewContour =
false;
533 return { &
fPts[-(pts_count + 1)],
Edge(v), isNewContour };
static const int points[]
static bool isFinite(const SkRect &r)
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
SkPathEdgeIter(const SkPath &path)
SkScalar conicWeight() const
static SkPath::Verb EdgeToVerb(Edge e)
static bool IsInverseFillType(SkPathFillType fill)
static int PtsInVerb(unsigned verb)
static bool IsClosedSingleContour(const SkPath &path)
static SkPathConvexity GetConvexity(const SkPath &path)
static bool IsRRect(const SkPath &path, SkRRect *rrect, SkPathDirection *dir, unsigned *start)
static bool IsNestedFillRects(const SkPath &, SkRect rect[2], SkPathDirection dirs[2]=nullptr)
static int LastMoveToIndex(const SkPath &path)
static bool TooBigForMath(const SkPath &path)
static bool IsSimpleRect(const SkPath &path, bool isSimpleFill, SkRect *rect, SkPathDirection *direction, unsigned *start)
static int GenIDChangeListenersCount(const SkPath &)
static void SetConvexity(const SkPath &path, SkPathConvexity c)
static bool HasComputedBounds(const SkPath &path)
static const uint8_t * VerbData(const SkPath &path)
static SkPath MakePath(const SkPathVerbAnalysis &analysis, const SkPoint points[], const uint8_t verbs[], int verbCount, const SkScalar conics[], SkPathFillType fillType, bool isVolatile)
static void ForceComputeConvexity(const SkPath &path)
static bool IsOval(const SkPath &path, SkRect *rect, SkPathDirection *dir, unsigned *start)
static SkPathFirstDirection AsFirstDirection(SkPathDirection dir)
static bool IsAxisAligned(const SkPath &path)
static int PtsInIter(unsigned verb)
static bool TestingOnly_unique(const SkPath &path)
static void ReverseAddPath(SkPathBuilder *builder, const SkPath &reverseMe)
static void CreateDrawArcPath(SkPath *path, const SkArc &arc, bool isFillNoPathEffect)
static SkPathFirstDirection ComputeFirstDirection(const SkPath &)
static bool DrawArcIsConvex(SkScalar sweepAngle, SkArc::Type arcType, bool isFillNoPathEffect)
static int LeadingMoveToCount(const SkPath &path)
static constexpr SkScalar kW0PlaneDistance
static void AddGenIDChangeListener(const SkPath &path, sk_sp< SkIDChangeListener > listener)
static SkPathConvexity GetConvexityOrUnknown(const SkPath &path)
static void ShrinkToFit(SkPath *path)
static bool PerspectiveClip(const SkPath &src, const SkMatrix &, SkPath *result)
static void UpdatePathPoint(SkPath *path, int index, const SkPoint &pt)
static bool IsRectContour(const SkPath &, bool allowPartial, int *currVerb, const SkPoint **ptsPtr, bool *isClosed, SkPathDirection *direction, SkRect *rect)
static const SkScalar * ConicWeightData(const SkPath &path)
static const SkPoint * PointData(const SkPath &path)
static bool TooBigForMath(const SkRect &bounds)
static bool AllPointsEq(const SkPoint pts[], int count)
static int ConicWeightCnt(const SkPath &path)
SkPath::RangeIter RangeIter
static SkPathFirstDirection OppositeFirstDirection(SkPathFirstDirection dir)
static SkPathFillType ConvertToNonInverseFillType(SkPathFillType fill)
SkPoint * writablePoints()
const uint8_t * verbsEnd() const
const uint8_t * verbsBegin() const
static float max(float r, float g, float b)
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
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
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
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
const myers::Point & get(const myers::Segment &)
Iterate(const uint8_t *verbsBegin, const uint8_t *verbsEnd, const SkPoint *points, const SkScalar *weights)
Iterate(const SkPath &path)
SkPath::RangeIter begin()
bool operator!=(const Iter &b)
Verbs(const SkPath &path)