Lines Matching full:segments
65 static bool center_of_mass(const SegmentArray& segments, SkPoint* c) { in center_of_mass() argument
68 int count = segments.count(); in center_of_mass()
74 p0 = segments[0].endPt(); in center_of_mass()
80 pj = segments[1].endPt() - p0; in center_of_mass()
83 pj = segments[i + 1].endPt() - p0; in center_of_mass()
98 const SkPoint& pt = segments[i].endPt(); in center_of_mass()
115 static bool compute_vectors(SegmentArray* segments, in compute_vectors() argument
120 if (!center_of_mass(*segments, fanPt)) { in compute_vectors()
123 int count = segments->count(); in compute_vectors()
137 Segment& sega = (*segments)[a]; in compute_vectors()
139 Segment& segb = (*segments)[b]; in compute_vectors()
158 // compute mid-vectors where segments meet. TODO: Detect shallow corners in compute_vectors()
159 // and leave out the wedges and close gaps by stitching segments together. in compute_vectors()
161 const Segment& sega = (*segments)[a]; in compute_vectors()
163 Segment& segb = (*segments)[b]; in compute_vectors()
237 SegmentArray* segments) { in add_line_to_segment() argument
238 segments->push_back(); in add_line_to_segment()
239 segments->back().fType = Segment::kLine; in add_line_to_segment()
240 segments->back().fPts[0] = pt; in add_line_to_segment()
244 SegmentArray* segments) { in add_quad_segment() argument
248 add_line_to_segment(pts[2], segments); in add_quad_segment()
251 segments->push_back(); in add_quad_segment()
252 segments->back().fType = Segment::kQuad; in add_quad_segment()
253 segments->back().fPts[0] = pts[1]; in add_quad_segment()
254 segments->back().fPts[1] = pts[2]; in add_quad_segment()
260 SegmentArray* segments) { in add_cubic_segments() argument
265 add_quad_segment(&quads[q], segments); in add_cubic_segments()
271 SegmentArray* segments, in get_segments() argument
301 add_line_to_segment(pts[1], segments); in get_segments()
308 add_quad_segment(pts, segments); in get_segments()
318 add_quad_segment(quadPts + 2*i, segments); in get_segments()
327 add_cubic_segments(pts, dir, segments); in get_segments()
334 return compute_vectors(segments, fanPt, dir, vCount, iCount); in get_segments()
350 static void create_vertices(const SegmentArray& segments, in create_vertices() argument
363 int count = segments.count(); in create_vertices()
365 const Segment& sega = segments[a]; in create_vertices()
367 const Segment& segb = segments[b]; in create_vertices()
428 // TODO: Detect and combine colinear segments. This will ensure we catch every case in create_vertices()
498 // TODO: Detect and combine colinear segments. This will ensure we catch every case in create_vertices()
730 // TODO generate all segments for all paths and use one vertex buffer in onPrepareDraws()
756 SkSTArray<kPreallocSegmentCnt, Segment, true> segments; in onPrepareDraws() local
759 if (!get_segments(*pathPtr, *viewMatrix, &segments, &fanPt, &vertexCount, in onPrepareDraws()
786 create_vertices(segments, fanPt, color, &draws, verts, idxs, kVertexStride); in onPrepareDraws()