• Home
  • Raw
  • Download

Lines Matching full:segments

66 static bool center_of_mass(const SegmentArray& segments, SkPoint* c) {  in center_of_mass()  argument
69 int count = segments.count(); in center_of_mass()
75 p0 = segments[0].endPt(); in center_of_mass()
81 pj = segments[1].endPt() - p0; in center_of_mass()
84 pj = segments[i + 1].endPt() - p0; in center_of_mass()
99 const SkPoint& pt = segments[i].endPt(); in center_of_mass()
116 static bool compute_vectors(SegmentArray* segments, in compute_vectors() argument
121 if (!center_of_mass(*segments, fanPt)) { in compute_vectors()
124 int count = segments->count(); in compute_vectors()
138 Segment& sega = (*segments)[a]; in compute_vectors()
140 Segment& segb = (*segments)[b]; in compute_vectors()
159 // compute mid-vectors where segments meet. TODO: Detect shallow corners in compute_vectors()
160 // and leave out the wedges and close gaps by stitching segments together. in compute_vectors()
162 const Segment& sega = (*segments)[a]; in compute_vectors()
164 Segment& segb = (*segments)[b]; in compute_vectors()
238 SegmentArray* segments) { in add_line_to_segment() argument
239 segments->push_back(); in add_line_to_segment()
240 segments->back().fType = Segment::kLine; in add_line_to_segment()
241 segments->back().fPts[0] = pt; in add_line_to_segment()
245 SegmentArray* segments) { in add_quad_segment() argument
249 add_line_to_segment(pts[2], segments); in add_quad_segment()
252 segments->push_back(); in add_quad_segment()
253 segments->back().fType = Segment::kQuad; in add_quad_segment()
254 segments->back().fPts[0] = pts[1]; in add_quad_segment()
255 segments->back().fPts[1] = pts[2]; in add_quad_segment()
261 SegmentArray* segments) { in add_cubic_segments() argument
266 add_quad_segment(&quads[q], segments); in add_cubic_segments()
272 SegmentArray* segments, in get_segments() argument
302 add_line_to_segment(pts[1], segments); in get_segments()
309 add_quad_segment(pts, segments); in get_segments()
319 add_quad_segment(quadPts + 2*i, segments); in get_segments()
328 add_cubic_segments(pts, dir, segments); in get_segments()
335 return compute_vectors(segments, fanPt, dir, vCount, iCount); in get_segments()
351 static void create_vertices(const SegmentArray& segments, in create_vertices() argument
364 int count = segments.count(); in create_vertices()
366 const Segment& sega = segments[a]; in create_vertices()
368 const Segment& segb = segments[b]; in create_vertices()
429 // TODO: Detect and combine colinear segments. This will ensure we catch every case in create_vertices()
499 // 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()