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

Unified Diff: include/core/SkPathMeasure.h

Issue 1608353002: resolution dependent path measure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkDraw.h ('k') | include/core/SkStrokeRec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPathMeasure.h
diff --git a/include/core/SkPathMeasure.h b/include/core/SkPathMeasure.h
index 415ee2709c05891c631b0040c6ed7f3f81207bb9..d3fe617db8de1745eb6d224b05a50be1abca5d3c 100644
--- a/include/core/SkPathMeasure.h
+++ b/include/core/SkPathMeasure.h
@@ -20,8 +20,11 @@ public:
for the lifetime of the measure object, or until setPath() is called with
a different path (or null), since the measure object keeps a pointer to the
path object (does not copy its data).
+
+ resScale controls the precision of the measure. values > 1 increase the
+ precision (and possible slow down the computation).
*/
- SkPathMeasure(const SkPath& path, bool forceClosed);
+ SkPathMeasure(const SkPath& path, bool forceClosed, SkScalar resScale = 1);
~SkPathMeasure();
/** Reset the pathmeasure with the specified path. The path must remain valid
@@ -82,6 +85,7 @@ public:
private:
SkPath::Iter fIter;
const SkPath* fPath;
+ SkScalar fTolerance;
SkScalar fLength; // relative to the current contour
int fFirstPtIndex; // relative to the current contour
bool fIsClosed; // relative to the current contour
@@ -117,6 +121,12 @@ private:
SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance,
int mint, int maxt, int ptIndex);
const Segment* distanceToSegment(SkScalar distance, SkScalar* t);
+ bool quad_too_curvy(const SkPoint pts[3]);
+#ifndef SK_SUPPORT_LEGACY_CONIC_MEASURE
+ bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkPoint& lastPt);
+#endif
+ bool cheap_dist_exceeds_limit(const SkPoint& pt, SkScalar x, SkScalar y);
+ bool cubic_too_curvy(const SkPoint pts[4]);
};
#endif
« no previous file with comments | « include/core/SkDraw.h ('k') | include/core/SkStrokeRec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698