Lines Matching defs:phase
20 static SkScalar find_first_interval(const SkScalar intervals[], SkScalar phase,
24 if (phase > gap || (phase == gap && gap)) {
25 phase -= gap;
28 return gap - phase;
31 // If we get here, phase "appears" to be larger than our length. This
39 void SkDashPath::CalcDashParameters(SkScalar phase, const SkScalar intervals[], int32_t count,
47 // Adjust phase to be between 0 and len, "flipping" phase if negative.
48 // e.g., if len is 100, then phase of -20 (or -120) is equivalent to 80
50 if (phase < 0) {
51 phase = -phase;
52 if (phase > len) {
53 phase = SkScalarMod(phase, len);
55 phase = len - phase;
57 // Due to finite precision, it's possible that phase == len,
58 // even after the subtract (if len >>> phase), so fix that here.
60 SkASSERT(phase <= len);
61 if (phase == len) {
62 phase = 0;
64 } else if (phase >= len) {
65 phase = SkScalarMod(phase, len);
67 *adjustedPhase = phase;
69 SkASSERT(phase >= 0 && phase < len);
71 *initialDashLength = find_first_interval(intervals, phase,
125 // right/bottom of the bounds (keeping our new line "in phase" with the dash,
131 minXY -= priorPhase; // for rectangles, adjust by prior phase
137 maxXY += priorPhase; // for rectangles, adjust by prior phase
194 double accum = 0; // Sum of unculled edge lengths to keep the phase correct.
454 bool SkDashPath::ValidDashPath(SkScalar phase, const SkScalar intervals[], int32_t count) {
466 return length > 0 && SkScalarIsFinite(phase) && SkScalarIsFinite(length);