46 fConicWeights.
clear();
53 fLastMovePoint = {0, 0};
55 fNeedsMoveVerb =
true;
103 fNeedsMoveVerb =
false;
156 if (!fVerbs.
empty()) {
162 fNeedsMoveVerb =
true;
200 pr->setIsOval(fIsACCW, fIsAStart,
true);
205 pr->setIsRRect(fIsACCW, fIsAStart);
216 auto path =
SkPath(std::move(pr), fFillType, fIsVolatile, convexity,
dir);
220 const uint8_t*
start =
path.fPathRef->verbsBegin();
221 const uint8_t* stop =
path.fPathRef->verbsEnd();
226 path.fLastMoveToIndex = isClosed ? ~fLastMoveIndex : fLastMoveIndex;
242 std::move(fConicWeights),
291 if (*startV == *stopV) {
301 }
while (*startV == *stopV);
321 matrix.mapXY(stop.
x(), stop.
y(), singlePt);
337 if (fVerbs.
empty()) {
343 return forceMoveTo ? this->
moveTo(lonePt) : this->
lineTo(lonePt);
355 auto addPt = [forceMoveTo,
this](
const SkPoint& pt) {
366 if (startV == stopV) {
386 this->
conicTo(conics[
i].fPts[1], conics[
i].
fPts[2], conics[
i].fW);
409 SkScalar startIndex = std::fmod(startOver90I + 1.f, 4.f);
410 startIndex = startIndex < 0 ? startIndex + 4.f : startIndex;
412 (
unsigned) startIndex);
431 double cosh =
dot(befored, afterd);
432 double sinh =
cross(befored, afterd);
451 return this->
conicTo(p1, p1 + after, weight);
469 if (!rad.
fX || !rad.
fY) {
470 return this->
lineTo(endPt);
474 if (srcPts[0] == srcPts[1]) {
475 return this->
lineTo(endPt);
479 SkVector midPointDistance = srcPts[0] - srcPts[1];
480 midPointDistance *= 0.5f;
486 pointTransform.
mapPoints(&transformedMidPoint, &midPointDistance, 1);
489 SkScalar squareX = transformedMidPoint.
fX * transformedMidPoint.
fX;
490 SkScalar squareY = transformedMidPoint.
fY * transformedMidPoint.
fY;
494 SkScalar radiiScale = squareX / squareRx + squareY / squareRy;
495 if (radiiScale > 1) {
501 pointTransform.
setScale(1 / rx, 1 / ry);
513 scaleFactor = -scaleFactor;
515 delta.scale(scaleFactor);
516 SkPoint centerPoint = unitPts[0] + unitPts[1];
519 unitPts[0] -= centerPoint;
520 unitPts[1] -= centerPoint;
523 SkScalar thetaArc = theta2 - theta1;
535 return this->
lineTo(endPt);
543 SkScalar thetaWidth = thetaArc / segments;
550 auto scalar_is_integer = [](
SkScalar scalar) ->
bool {
554 scalar_is_integer(rx) && scalar_is_integer(ry) &&
555 scalar_is_integer(endPt.
fX) && scalar_is_integer(endPt.
fY);
557 for (
int i = 0;
i < segments; ++
i) {
558 SkScalar endTheta = startTheta + thetaWidth,
562 unitPts[1].
set(cosEndTheta, sinEndTheta);
563 unitPts[1] += centerPoint;
564 unitPts[0] = unitPts[1];
565 unitPts[0].
offset(t * sinEndTheta, -t * cosEndTheta);
573 if (expectIntegers) {
574 for (
SkPoint& point : mapped) {
579 this->
conicTo(mapped[0], mapped[1],
w);
580 startTheta = endTheta;
592 template <
unsigned N>
class PointIterator {
595 : fCurrent(startIndex %
N)
599 const SkPoint& current()
const {
601 return fPts[fCurrent];
605 fCurrent = (fCurrent + fAdvance) %
N;
606 return this->current();
617 class RectPointIterator :
public PointIterator<4> {
620 : PointIterator(
dir, startIndex) {
629 class OvalPointIterator :
public PointIterator<4> {
632 : PointIterator(
dir, startIndex) {
644 class RRectPointIterator :
public PointIterator<8> {
647 : PointIterator(
dir, startIndex)
670 const int kVerbs = 5;
673 RectPointIterator iter(
rect,
dir, index);
675 this->
moveTo(iter.current());
676 this->
lineTo(iter.next());
677 this->
lineTo(iter.next());
678 this->
lineTo(iter.next());
679 return this->
close();
683 const IsA prevIsA = fIsA;
686 const int kVerbs = 6;
689 OvalPointIterator ovalIter(
oval,
dir, index);
694 this->
moveTo(ovalIter.current());
695 for (
unsigned i = 0;
i < 4; ++
i) {
700 if (prevIsA == kIsA_JustMoves) {
703 fIsAStart = index % 4;
709 const IsA prevIsA = fIsA;
723 const int kVerbs = startsWithConic
728 RRectPointIterator rrectIter(
rrect,
dir, index);
732 RectPointIterator rectIter(
bounds,
dir, rectStartIndex);
734 this->
moveTo(rrectIter.current());
735 if (startsWithConic) {
736 for (
unsigned i = 0;
i < 3; ++
i) {
737 this->
conicTo(rectIter.next(), rrectIter.next(), weight);
738 this->
lineTo(rrectIter.next());
740 this->
conicTo(rectIter.next(), rrectIter.next(), weight);
743 for (
unsigned i = 0;
i < 4; ++
i) {
744 this->
lineTo(rrectIter.next());
745 this->
conicTo(rectIter.next(), rrectIter.next(), weight);
751 if (prevIsA == kIsA_JustMoves) {
754 fIsAStart = index % 8;
794 for (
auto&
p : fPts) {
822 const uint8_t* verbsBegin =
src.fPathRef->verbsBegin();
823 const uint8_t* verbs =
src.fPathRef->verbsEnd();
824 const SkPoint* pts =
src.fPathRef->pointsEnd();
825 const SkScalar* conicWeights =
src.fPathRef->conicWeightsEnd();
827 bool needMove =
true;
828 bool needClose =
false;
829 while (verbs > verbsBegin) {
830 uint8_t v = *--verbs;
852 this->
quadTo(pts[1], pts[0]);
855 this->
conicTo(pts[1], pts[0], *--conicWeights);
858 this->
cubicTo(pts[2], pts[1], pts[0]);
static float next(float f)
#define SkDEBUGFAIL(message)
static bool SkIsFinite(T x, Pack... values)
@ kCW_SkRotationDirection
@ kCCW_SkRotationDirection
static bool nearly_equal(const SkPoint &a, const SkPoint &b)
static int build_arc_conics(const SkRect &oval, const SkVector &start, const SkVector &stop, SkRotationDirection dir, SkConic conics[SkConic::kMaxConicsForArc], SkPoint *singlePt)
static bool arc_is_lone_point(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, SkPoint *pt)
static void angles_to_unit_vectors(SkScalar startAngle, SkScalar sweepAngle, SkVector *startV, SkVector *stopV, SkRotationDirection *dir)
@ kCubic_SkPathSegmentMask
@ kConic_SkPathSegmentMask
@ kQuad_SkPathSegmentMask
@ kLine_SkPathSegmentMask
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
static constexpr int32_t Sk32_sat_add(int32_t a, int32_t b)
#define SkDegreesToRadians(degrees)
#define SkScalarCopySign(x, y)
#define SkScalarFloorToScalar(x)
static float SkScalarSinSnapToZero(SkScalar radians)
#define SkScalarTan(radians)
#define SkScalarATan2(y, x)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkScalarSin(radians)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkDoubleToScalar(x)
#define SkScalarCeilToInt(x)
#define SkScalarRoundToScalar(x)
#define SkScalarCos(radians)
#define SK_ScalarRoot2Over2
static float SkScalarCosSnapToZero(SkScalar radians)
constexpr int SkToInt(S x)
static constexpr bool SkToBool(const T &x)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & preRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
SkPathBuilder & conicTo(SkPoint pt1, SkPoint pt2, SkScalar w)
SkPathBuilder & arcTo(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg, bool forceMoveTo)
SkPathBuilder & lineTo(SkPoint pt)
SkRect computeBounds() const
SkPathBuilder & rLineTo(SkPoint pt)
SkPathBuilder & operator=(const SkPath &)
SkPathBuilder & addArc(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg)
SkPathBuilder & addPath(const SkPath &)
SkPathBuilder & polylineTo(const SkPoint pts[], int count)
SkPathBuilder & addRect(const SkRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & setFillType(SkPathFillType ft)
SkPathBuilder & addRRect(const SkRRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & cubicTo(SkPoint pt1, SkPoint pt2, SkPoint pt3)
void incReserve(int extraPtCount, int extraVerbCount)
SkPathBuilder & addCircle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPathBuilder & moveTo(SkPoint pt)
SkPathBuilder & addOval(const SkRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & addPolygon(const SkPoint pts[], int count, bool isClosed)
SkPathBuilder & offset(SkScalar dx, SkScalar dy)
SkPathBuilder & rQuadTo(SkPoint pt1, SkPoint pt2)
SkPathBuilder & rCubicTo(SkPoint pt1, SkPoint pt2, SkPoint pt3)
SkPathBuilder & quadTo(SkPoint pt1, SkPoint pt2)
SkPathBuilder & rConicTo(SkPoint p1, SkPoint p2, SkScalar w)
static int PtsInVerb(unsigned verb)
SkScalar conicWeight() const
SkPathFillType getFillType() const
SkVector radii(Corner corner) const
@ kUpperLeft_Corner
index of top-left corner radii
@ kLowerRight_Corner
index of bottom-right corner radii
@ kUpperRight_Corner
index of top-right corner radii
@ kLowerLeft_Corner
index of bottom-left corner radii
const SkRect & getBounds() const
void reserve_exact(int n)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
const uint8_t uint32_t uint32_t GError ** error
static float max(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
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
int64_t cross(Point d0, Point d1)
static constexpr SkPoint kPts[kPtsCount]
SINT bool isfinite(const Vec< N, T > &v)
SINT T dot(const Vec< N, T > &a, const Vec< N, T > &b)
SIN Vec< N, float > normalize(const Vec< N, float > &v)
static int BuildUnitArc(const SkVector &start, const SkVector &stop, SkRotationDirection, const SkMatrix *, SkConic conics[kMaxConicsForArc])
bool setLength(float length)
void offset(float dx, float dy)
static constexpr SkPoint Make(float x, float y)
void set(float x, float y)
constexpr float y() const
constexpr float x() const
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
constexpr float centerX() const
constexpr float height() const
constexpr float centerY() const
constexpr float width() const
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
SkScalar fTop
smaller y-axis bounds