115 {
117
118
119 if (dxy.
fX && dxy.
fY) {
120 return false;
121 }
123
124 SkScalar minXY = (&pts[0].fX)[xyOffset];
125 SkScalar maxXY = (&pts[1].fX)[xyOffset];
126 bool swapped = maxXY < minXY;
127 if (swapped) {
130 }
131
135 if (maxXY < leftTop || minXY > rightBottom) {
136 return false;
137 }
138
139
140
141
142
143 if (minXY < leftTop) {
144 minXY = leftTop -
SkScalarMod(leftTop - minXY, intervalLength);
145 if (!swapped) {
146 minXY -= priorPhase;
147 }
148 }
149 if (maxXY > rightBottom) {
150 maxXY = rightBottom +
SkScalarMod(maxXY - rightBottom, intervalLength);
151 if (swapped) {
152 maxXY += priorPhase;
153 }
154 }
155
157 if (swapped) {
160 }
161 (&pts[0].fX)[xyOffset] = minXY;
162 (&pts[1].fX)[xyOffset] = maxXY;
163
164 if (minXY == maxXY) {
166 }
167 return true;
168}
static void adjust_zero_length_line(SkPoint pts[2])
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define SkScalarMod(x, y)
static constexpr bool SkToBool(const T &x)
Optional< SkRect > bounds