Lines Matching refs:rs

36     RenderShape rs;                     //shape data  member
78 …if (!rs.stroke || rs.stroke->width < FLOAT_EPSILON || (!rs.stroke->fill && rs.stroke->color[3] == … in needComposition()
79 if (!rs.fill && rs.color[3] == 0) return false; in needComposition()
117 …rd = renderer->prepare(rs, rd, transform, clips, opacity, static_cast<RenderUpdateFlag>(pFlag | fl… in update()
131 if (rs.path.pts.count > 0 ) { in bounds()
132 auto pts = rs.path.pts.begin(); in bounds()
136 for (auto pts2 = pts + 1; pts2 < rs.path.pts.end(); ++pts2) { in bounds()
150 if (stroking && rs.stroke) { in bounds()
151 if (x) *x -= rs.stroke->width * 0.5f; in bounds()
152 if (y) *y -= rs.stroke->width * 0.5f; in bounds()
153 if (w) *w += rs.stroke->width; in bounds()
154 if (h) *h += rs.stroke->width; in bounds()
156 return rs.path.pts.count > 0 ? true : false; in bounds()
161 rs.path.cmds.reserve(cmdCnt); in reserveCmd()
166 rs.path.pts.reserve(ptsCnt); in reservePts()
171 rs.path.cmds.grow(cmdCnt); in grow()
172 rs.path.pts.grow(ptsCnt); in grow()
177 memcpy(rs.path.cmds.end(), cmds, sizeof(PathCommand) * cmdCnt); in append()
178 memcpy(rs.path.pts.end(), pts, sizeof(Point) * ptsCnt); in append()
179 rs.path.cmds.count += cmdCnt; in append()
180 rs.path.pts.count += ptsCnt; in append()
185 rs.path.cmds.push(PathCommand::MoveTo); in moveTo()
186 rs.path.pts.push({x, y}); in moveTo()
191 rs.path.cmds.push(PathCommand::LineTo); in lineTo()
192 rs.path.pts.push({x, y}); in lineTo()
197 rs.path.cmds.push(PathCommand::CubicTo); in cubicTo()
198 rs.path.pts.push({cx1, cy1}); in cubicTo()
199 rs.path.pts.push({cx2, cy2}); in cubicTo()
200 rs.path.pts.push({x, y}); in cubicTo()
206 if (rs.path.cmds.count > 0 && rs.path.cmds.last() == PathCommand::Close) return; in close()
208 rs.path.cmds.push(PathCommand::Close); in close()
213 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeWidth()
214 rs.stroke->width = width; in strokeWidth()
220 if (!rs.stroke) { in strokeTrim()
222 rs.stroke = new RenderStroke(); in strokeTrim()
225 if (tvg::equal(rs.stroke->trim.begin, begin) && tvg::equal(rs.stroke->trim.end, end) && in strokeTrim()
226 rs.stroke->trim.simultaneous == simultaneous) return; in strokeTrim()
228 rs.stroke->trim.begin = begin; in strokeTrim()
229 rs.stroke->trim.end = end; in strokeTrim()
230 rs.stroke->trim.simultaneous = simultaneous; in strokeTrim()
236 if (rs.stroke) { in strokeTrim()
237 if (begin) *begin = rs.stroke->trim.begin; in strokeTrim()
238 if (end) *end = rs.stroke->trim.end; in strokeTrim()
239 return rs.stroke->trim.simultaneous; in strokeTrim()
249 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeCap()
250 rs.stroke->cap = cap; in strokeCap()
256 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeJoin()
257 rs.stroke->join = join; in strokeJoin()
263 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeMiterlimit()
264 rs.stroke->miterlimit = miterlimit; in strokeMiterlimit()
270 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeColor()
271 if (rs.stroke->fill) { in strokeColor()
272 delete(rs.stroke->fill); in strokeColor()
273 rs.stroke->fill = nullptr; in strokeColor()
277 rs.stroke->color[0] = r; in strokeColor()
278 rs.stroke->color[1] = g; in strokeColor()
279 rs.stroke->color[2] = b; in strokeColor()
280 rs.stroke->color[3] = a; in strokeColor()
290 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeFill()
291 if (rs.stroke->fill && rs.stroke->fill != p) delete(rs.stroke->fill); in strokeFill()
292 rs.stroke->fill = p; in strokeFill()
293 rs.stroke->color[3] = 0; in strokeFill()
313 free(rs.stroke->dashPattern); in strokeDash()
314 rs.stroke->dashPattern = nullptr; in strokeDash()
316 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeDash()
317 if (rs.stroke->dashCnt != cnt) { in strokeDash()
318 free(rs.stroke->dashPattern); in strokeDash()
319 rs.stroke->dashPattern = nullptr; in strokeDash()
321 if (!rs.stroke->dashPattern) { in strokeDash()
322 rs.stroke->dashPattern = static_cast<float*>(malloc(sizeof(float) * cnt)); in strokeDash()
323 if (!rs.stroke->dashPattern) return Result::FailedAllocation; in strokeDash()
326 rs.stroke->dashPattern[i] = pattern[i]; in strokeDash()
329 rs.stroke->dashCnt = cnt; in strokeDash()
330 rs.stroke->dashOffset = offset; in strokeDash()
338 if (!rs.stroke) return true; in strokeFirst()
339 return rs.stroke->strokeFirst; in strokeFirst()
344 if (!rs.stroke) rs.stroke = new RenderStroke(); in strokeFirst()
345 rs.stroke->strokeFirst = strokeFirst; in strokeFirst()
361 delete(dup->rs.fill); in duplicate()
365 dup->rs.rule = rs.rule; in duplicate()
368 memcpy(dup->rs.color, rs.color, sizeof(rs.color)); in duplicate()
371 dup->rs.path.cmds.push(rs.path.cmds); in duplicate()
372 dup->rs.path.pts.push(rs.path.pts); in duplicate()
375 if (rs.stroke) { in duplicate()
376 if (!dup->rs.stroke) dup->rs.stroke = new RenderStroke; in duplicate()
377 *dup->rs.stroke = *rs.stroke; in duplicate()
379 delete(dup->rs.stroke); in duplicate()
380 dup->rs.stroke = nullptr; in duplicate()
384 if (rs.fill) dup->rs.fill = rs.fill->duplicate(); in duplicate()
385 else dup->rs.fill = nullptr; in duplicate()
393 rs.path.cmds.clear(); in reset()
394 rs.path.pts.clear(); in reset()
396 rs.color[3] = 0; in reset()
397 rs.rule = FillRule::Winding; in reset()
399 delete(rs.stroke); in reset()
400 rs.stroke = nullptr; in reset()
402 delete(rs.fill); in reset()
403 rs.fill = nullptr; in reset()