36 int32_t* index,
int count) {
39 if (phase > gap || (phase == gap && gap)) {
55 SkScalar* initialDashLength, int32_t* initialDashIndex,
61 *intervalLength =
len;
79 }
else if (phase >=
len) {
82 *adjustedPhase = phase;
87 initialDashIndex,
count);
90 SkASSERT(*initialDashIndex >= 0 && *initialDashIndex <
count);
101 rect->outset(radius, radius);
119 if (dxy.
fX && dxy.
fY) {
126 bool swapped = maxXY < minXY;
135 if (maxXY < leftTop || minXY > rightBottom) {
143 if (minXY < leftTop) {
144 minXY = leftTop -
SkScalarMod(leftTop - minXY, intervalLength);
149 if (maxXY > rightBottom) {
150 maxXY = rightBottom +
SkScalarMod(maxXY - rightBottom, intervalLength);
161 (&pts[0].
fX)[xyOffset] = minXY;
162 (&pts[1].
fX)[xyOffset] = maxXY;
164 if (minXY == maxXY) {
177 if (srcPath.
isLine(pts) && pts[0] == pts[1]) {
192 if (srcPath.
isLine(pts)) {
202 if (srcPath.
isRect(
nullptr)) {
215 if (
clip_line(pts,
bounds, intervalLength, std::fmod(accum, intervalLength))) {
219 if (!dstPath->
getLastPt(&last) || last != pts[0]) {
238 int intervalCount,
SkScalar intervalLength) {
250 fTangent = fPts[1] - fPts[0];
255 fPathLength = pathLength;
267 SkScalar ptCount = pathLength * intervalCount / (
float)intervalLength;
283 if (d1 > fPathLength) {
293 pts[0].
set(x0 + fNormal.
fX, y0 + fNormal.
fY);
294 pts[1].
set(x1 + fNormal.
fX, y1 + fNormal.
fY);
295 pts[2].
set(x1 - fNormal.
fX, y1 - fNormal.
fY);
296 pts[3].
set(x0 - fNormal.
fX, y0 - fNormal.
fY);
311 int32_t
count,
SkScalar initialDashLength, int32_t initialDashIndex,
323 const SkScalar* intervals = aIntervals;
329 if (
cull_path(
src, *rec, cullRect, intervalLength, &cullPathStorage)) {
332 if (
src.isRect(
nullptr) &&
src.isLastContourClosed() &&
is_even(initialDashIndex)) {
334#if defined(SK_LEGACY_RECT_DASHING_BUG)
340 while (endPhase > intervals[index]) {
341 endPhase -= intervals[index++];
343 if (index ==
count) {
353 if (
is_even(index) == (endPhase > 0)) {
356 int last =
src.countPoints() - 1;
357 while (midPoint ==
src.getPoint(last)) {
363 while (midPoint ==
src.getPoint(
next)) {
371 cullPathStorage.
moveTo(midPoint - v);
372 cullPathStorage.
lineTo(midPoint);
373 v = midPoint -
src.getPoint(
next);
376 cullPathStorage.
lineTo(midPoint - v);
379 srcPtr = &cullPathStorage;
383 bool specialLine = (StrokeRecApplication::kAllow == strokeRecApplication) &&
384 lineRec.
init(*srcPtr,
dst, rec,
count >> 1, intervalLength);
389 bool skipFirstSegment = meas.
isClosed();
390 bool addedSegment =
false;
392 int index = initialDashIndex;
402 dashCount +=
length * (
count >> 1) / intervalLength;
411 double dlen = initialDashLength;
415 addedSegment =
false;
416 if (
is_even(index) && !skipFirstSegment) {
433 skipFirstSegment =
false;
438 if (index ==
count) {
443 dlen = intervals[index];
448 initialDashLength >= 0) {
468 int32_t initialDashIndex = 0;
471 &initialDashLength, &initialDashIndex, &intervalLength);
473 initialDashIndex, intervalLength,
info.fPhase);
482 if (intervals[
i] < 0) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static float next(float f)
static constexpr bool SkIsAlign2(T x)
static void adjust_zero_length_line(SkPoint pts[2])
static int is_even(int x)
static bool cull_path(const SkPath &srcPath, const SkStrokeRec &rec, const SkRect *cullRect, SkScalar intervalLength, SkPath *dstPath)
static bool clip_line(SkPoint pts[2], const SkRect &bounds, SkScalar intervalLength, SkScalar priorPhase)
static void outset_for_stroke(SkRect *rect, const SkStrokeRec &rec)
static SkScalar find_first_interval(const SkScalar intervals[], SkScalar phase, int32_t *index, int count)
static constexpr bool SkIsNaN(T x)
static bool SkIsFinite(T x, Pack... values)
static constexpr float sk_ieee_float_divide(float numer, float denom)
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define SkScalarMod(x, y)
#define SkDoubleToScalar(x)
#define SkScalarCeilToInt(x)
#define SK_ScalarNearlyZero
static constexpr bool SkToBool(const T &x)
@ kButt_Cap
no stroke extension
@ kMiter_Join
extends to miter limit
bool getSegment(SkScalar startD, SkScalar stopD, SkPath *dst, bool startWithMoveTo)
static void SetConvexity(const SkPath &path, SkPathConvexity c)
Verb next(SkPoint pts[4])
SkPath & moveTo(SkScalar x, SkScalar y)
bool isLine(SkPoint line[2]) const
bool getLastPt(SkPoint *lastPt) const
SkPath & lineTo(SkScalar x, SkScalar y)
bool isRect(SkRect *rect, bool *isClosed=nullptr, SkPathDirection *direction=nullptr) const
static void RotateCCW(const SkPoint &src, SkPoint *dst)
bool isHairlineStyle() const
SkScalar getWidth() const
SkPaint::Join getJoin() const
SkPaint::Cap getCap() const
SkScalar getResScale() const
SkScalar getMiter() const
bool init(const SkPath &src, SkPath *dst, SkStrokeRec *rec, int intervalCount, SkScalar intervalLength)
void addSegment(SkScalar d0, SkScalar d1, SkPath *path) const
static float max(float r, float g, float b)
static float min(float r, float g, float b)
const SkScalar kMaxDashCount
bool FilterDashPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *, const SkPathEffect::DashInfo &info)
bool InternalFilter(SkPath *dst, const SkPath &src, SkStrokeRec *rec, const SkRect *cullRect, const SkScalar aIntervals[], int32_t count, SkScalar initialDashLength, int32_t initialDashIndex, SkScalar intervalLength, SkScalar startPhase, StrokeRecApplication=StrokeRecApplication::kAllow)
void CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count, SkScalar *initialDashLength, int32_t *initialDashIndex, SkScalar *intervalLength, SkScalar *adjustedPhase=nullptr)
bool ValidDashPath(SkScalar phase, const SkScalar intervals[], int32_t count)
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
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
void set(float x, float y)
static float Distance(const SkPoint &a, const SkPoint &b)
void scale(float scale, SkPoint *dst) const