Lines Matching refs:dash

104 static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix& transform)  in _dashLineTo()  argument
106 Line cur = {dash.ptCur, *to}; in _dashLineTo()
110 _outlineMoveTo(*dash.outline, &dash.ptCur, transform); in _dashLineTo()
112 } else if (len <= dash.curLen) { in _dashLineTo()
113 dash.curLen -= len; in _dashLineTo()
114 if (!dash.curOpGap) { in _dashLineTo()
115 if (dash.move) { in _dashLineTo()
116 _outlineMoveTo(*dash.outline, &dash.ptCur, transform); in _dashLineTo()
117 dash.move = false; in _dashLineTo()
119 _outlineLineTo(*dash.outline, to, transform); in _dashLineTo()
123 while (len - dash.curLen > 0.0001f) { in _dashLineTo()
125 if (dash.curLen > 0) { in _dashLineTo()
126 len -= dash.curLen; in _dashLineTo()
127 cur.split(dash.curLen, left, right); in _dashLineTo()
128 if (!dash.curOpGap) { in _dashLineTo()
129 if (dash.move || dash.pattern[dash.curIdx] - dash.curLen < FLOAT_EPSILON) { in _dashLineTo()
130 _outlineMoveTo(*dash.outline, &left.pt1, transform); in _dashLineTo()
131 dash.move = false; in _dashLineTo()
133 _outlineLineTo(*dash.outline, &left.pt2, transform); in _dashLineTo()
138 dash.curIdx = (dash.curIdx + 1) % dash.cnt; in _dashLineTo()
139 dash.curLen = dash.pattern[dash.curIdx]; in _dashLineTo()
140 dash.curOpGap = !dash.curOpGap; in _dashLineTo()
142 dash.ptCur = cur.pt1; in _dashLineTo()
143 dash.move = true; in _dashLineTo()
146 dash.curLen -= len; in _dashLineTo()
147 if (!dash.curOpGap) { in _dashLineTo()
148 if (dash.move) { in _dashLineTo()
149 _outlineMoveTo(*dash.outline, &cur.pt1, transform); in _dashLineTo()
150 dash.move = false; in _dashLineTo()
152 _outlineLineTo(*dash.outline, &cur.pt2, transform); in _dashLineTo()
154 if (dash.curLen < 1 && TO_SWCOORD(len) > 1) { in _dashLineTo()
156 dash.curIdx = (dash.curIdx + 1) % dash.cnt; in _dashLineTo()
157 dash.curLen = dash.pattern[dash.curIdx]; in _dashLineTo()
158 dash.curOpGap = !dash.curOpGap; in _dashLineTo()
161 dash.ptCur = *to; in _dashLineTo()
165 static void _dashCubicTo(SwDashStroke& dash, const Point* ctrl1, const Point* ctrl2, const Point* t… in _dashCubicTo() argument
167 Bezier cur = {dash.ptCur, *ctrl1, *ctrl2, *to}; in _dashCubicTo()
172 _outlineMoveTo(*dash.outline, &dash.ptCur, transform); in _dashCubicTo()
173 } else if (len <= dash.curLen) { in _dashCubicTo()
174 dash.curLen -= len; in _dashCubicTo()
175 if (!dash.curOpGap) { in _dashCubicTo()
176 if (dash.move) { in _dashCubicTo()
177 _outlineMoveTo(*dash.outline, &dash.ptCur, transform); in _dashCubicTo()
178 dash.move = false; in _dashCubicTo()
180 _outlineCubicTo(*dash.outline, ctrl1, ctrl2, to, transform); in _dashCubicTo()
184 while ((len - dash.curLen) > 0.0001f) { in _dashCubicTo()
186 if (dash.curLen > 0) { in _dashCubicTo()
187 len -= dash.curLen; in _dashCubicTo()
188 cur.split(dash.curLen, left, right); in _dashCubicTo()
189 if (!dash.curOpGap) { in _dashCubicTo()
190 if (dash.move || dash.pattern[dash.curIdx] - dash.curLen < FLOAT_EPSILON) { in _dashCubicTo()
191 _outlineMoveTo(*dash.outline, &left.start, transform); in _dashCubicTo()
192 dash.move = false; in _dashCubicTo()
194 _outlineCubicTo(*dash.outline, &left.ctrl1, &left.ctrl2, &left.end, transform); in _dashCubicTo()
199 dash.curIdx = (dash.curIdx + 1) % dash.cnt; in _dashCubicTo()
200 dash.curLen = dash.pattern[dash.curIdx]; in _dashCubicTo()
201 dash.curOpGap = !dash.curOpGap; in _dashCubicTo()
203 dash.ptCur = right.start; in _dashCubicTo()
204 dash.move = true; in _dashCubicTo()
207 dash.curLen -= len; in _dashCubicTo()
208 if (!dash.curOpGap) { in _dashCubicTo()
209 if (dash.move) { in _dashCubicTo()
210 _outlineMoveTo(*dash.outline, &cur.start, transform); in _dashCubicTo()
211 dash.move = false; in _dashCubicTo()
213 _outlineCubicTo(*dash.outline, &cur.ctrl1, &cur.ctrl2, &cur.end, transform); in _dashCubicTo()
215 if (dash.curLen < 0.1f && TO_SWCOORD(len) > 1) { in _dashCubicTo()
217 dash.curIdx = (dash.curIdx + 1) % dash.cnt; in _dashCubicTo()
218 dash.curLen = dash.pattern[dash.curIdx]; in _dashCubicTo()
219 dash.curOpGap = !dash.curOpGap; in _dashCubicTo()
222 dash.ptCur = *to; in _dashCubicTo()
226 static void _dashClose(SwDashStroke& dash, const Matrix& transform) in _dashClose() argument
228 _dashLineTo(dash, &dash.ptStart, transform); in _dashClose()
232 static void _dashMoveTo(SwDashStroke& dash, const Point* pts) in _dashMoveTo() argument
234 dash.ptCur = *pts; in _dashMoveTo()
235 dash.ptStart = *pts; in _dashMoveTo()
236 dash.move = true; in _dashMoveTo()
240 static void _dashMoveTo(SwDashStroke& dash, uint32_t offIdx, float offset, const Point* pts) in _dashMoveTo() argument
242 dash.curIdx = offIdx % dash.cnt; in _dashMoveTo()
243 dash.curLen = dash.pattern[dash.curIdx] - offset; in _dashMoveTo()
244 dash.curOpGap = offIdx % 2; in _dashMoveTo()
245 dash.ptStart = dash.ptCur = *pts; in _dashMoveTo()
246 dash.move = true; in _dashMoveTo()
250 static void _trimPattern(SwDashStroke* dash, const RenderShape* rshape, float length, float trimBeg… in _trimPattern() argument
257 if (begin > 0.0f) dash->cnt = 4; in _trimPattern()
258 else dash->cnt = 2; in _trimPattern()
260 } else dash->cnt = 3; in _trimPattern()
262 if (dash->cnt == 2) { in _trimPattern()
263 dash->pattern[0] = end - begin; in _trimPattern()
264 dash->pattern[1] = length - (end - begin); in _trimPattern()
265 } else if (dash->cnt == 3) { in _trimPattern()
266 dash->pattern[0] = end; in _trimPattern()
267 dash->pattern[1] = (begin - end); in _trimPattern()
268 dash->pattern[2] = length - begin; in _trimPattern()
270 dash->pattern[0] = 0; //zero dash to start with a space. in _trimPattern()
271 dash->pattern[1] = begin; in _trimPattern()
272 dash->pattern[2] = end - begin; in _trimPattern()
273 dash->pattern[3] = length - end; in _trimPattern()
342 SwDashStroke dash; in _genDashOutline() local
344 dash.cnt = rshape->strokeDash((const float**)&dash.pattern, &offset); in _genDashOutline()
349 if (dash.cnt == 0) { in _genDashOutline()
350 if (trimmed) dash.pattern = (float*)malloc(sizeof(float) * 4); in _genDashOutline()
361 for (size_t i = 0; i < dash.cnt; ++i) patternLength += dash.pattern[i]; in _genDashOutline()
362 bool isOdd = dash.cnt % 2; in _genDashOutline()
368 for (size_t i = 0; i < dash.cnt * (1 + (size_t)isOdd); ++i, ++offIdx) { in _genDashOutline()
369 auto curPattern = dash.pattern[i % dash.cnt]; in _genDashOutline()
375 dash.outline = mpoolReqDashOutline(mpool, tid); in _genDashOutline()
379 …if (trimmed) _trimPattern(&dash, rshape, _outlineLength(rshape, 0, 0, simultaneous), trimBegin, tr… in _genDashOutline()
380 _dashMoveTo(dash, offIdx, offset, pts); in _genDashOutline()
388 _dashClose(dash, transform); in _genDashOutline()
394 …_trimPattern(&dash, rshape, _outlineLength(rshape, pts - startPts, cmds - startCmds, true), trimBe… in _genDashOutline()
395 _dashMoveTo(dash, offIdx, offset, pts); in _genDashOutline()
396 } else _dashMoveTo(dash, pts); in _genDashOutline()
397 } else _dashMoveTo(dash, offIdx, offset, pts); in _genDashOutline()
402 _dashLineTo(dash, pts, transform); in _genDashOutline()
407 _dashCubicTo(dash, pts, pts + 1, pts + 2, transform); in _genDashOutline()
415 _outlineEnd(*dash.outline); in _genDashOutline()
417 if (trimmed) free(dash.pattern); in _genDashOutline()
419 return dash.outline; in _genDashOutline()