Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: include/core/SkPathMeasure.h

Issue 2221203002: Move seg_to to a new header, define SkSegType enum there (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename addSegmentToPath to SkPathMeasure_segTo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkPathMeasure.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPathMeasure_DEFINED 8 #ifndef SkPathMeasure_DEFINED
9 #define SkPathMeasure_DEFINED 9 #define SkPathMeasure_DEFINED
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 SkScalar fTolerance; 88 SkScalar fTolerance;
89 SkScalar fLength; // relative to the current contour 89 SkScalar fLength; // relative to the current contour
90 int fFirstPtIndex; // relative to the current contour 90 int fFirstPtIndex; // relative to the current contour
91 bool fIsClosed; // relative to the current contour 91 bool fIsClosed; // relative to the current contour
92 bool fForceClosed; 92 bool fForceClosed;
93 93
94 struct Segment { 94 struct Segment {
95 SkScalar fDistance; // total distance up to this point 95 SkScalar fDistance; // total distance up to this point
96 unsigned fPtIndex; // index into the fPts array 96 unsigned fPtIndex; // index into the fPts array
97 unsigned fTValue : 30; 97 unsigned fTValue : 30;
98 unsigned fType : 2; 98 unsigned fType : 2; // actually the enum SkSegType
99 // See SkPathMeasurePriv.h
99 100
100 SkScalar getScalarT() const; 101 SkScalar getScalarT() const;
101 }; 102 };
102 SkTDArray<Segment> fSegments; 103 SkTDArray<Segment> fSegments;
103 SkTDArray<SkPoint> fPts; // Points used to define the segments 104 SkTDArray<SkPoint> fPts; // Points used to define the segments
104 105
105 static const Segment* NextSegment(const Segment*); 106 static const Segment* NextSegment(const Segment*);
106 107
107 void buildSegments(); 108 void buildSegments();
108 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, 109 SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance,
109 int mint, int maxt, int ptIndex); 110 int mint, int maxt, int ptIndex);
110 SkScalar compute_conic_segs(const SkConic&, SkScalar distance, 111 SkScalar compute_conic_segs(const SkConic&, SkScalar distance,
111 int mint, const SkPoint& minPt, 112 int mint, const SkPoint& minPt,
112 int maxt, const SkPoint& maxPt, int ptIndex); 113 int maxt, const SkPoint& maxPt, int ptIndex);
113 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, 114 SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance,
114 int mint, int maxt, int ptIndex); 115 int mint, int maxt, int ptIndex);
115 const Segment* distanceToSegment(SkScalar distance, SkScalar* t); 116 const Segment* distanceToSegment(SkScalar distance, SkScalar* t);
116 bool quad_too_curvy(const SkPoint pts[3]); 117 bool quad_too_curvy(const SkPoint pts[3]);
117 bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkP oint& lastPt); 118 bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkP oint& lastPt);
118 bool cheap_dist_exceeds_limit(const SkPoint& pt, SkScalar x, SkScalar y); 119 bool cheap_dist_exceeds_limit(const SkPoint& pt, SkScalar x, SkScalar y);
119 bool cubic_too_curvy(const SkPoint pts[4]); 120 bool cubic_too_curvy(const SkPoint pts[4]);
120 }; 121 };
121 122
122 #endif 123 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPathMeasure.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698