diff options
author | 2018-03-09 16:55:35 -0500 | |
---|---|---|
committer | 2018-03-12 14:26:28 +0000 | |
commit | 689d02d4b480289aacaeb2da83b93d733cdfcb0f (patch) | |
tree | f9386ef1afc53a77a69e731ff5975a834d856a27 /include/core/SkPathMeasure.h | |
parent | 827af667bbe8e057f9ee08e9f9b598add232b491 (diff) |
harden pathmeasure and fix empty case
change int to unsigned (just make it uniform,
part of it was already unsigned)
change path by pointer to path by value
since it will be copied on write; fixes bug
where path changes from underneath measure
Allow empty paths to still initialize measure state.
This fixes the GM failure from the earlier check-in attempt
in CL 113269.
R=reed@google.com
Bug: skia:7675
Change-Id: I6296bbf75296ead826e54662b025277dd226e2b8
Reviewed-on: https://skia-review.googlesource.com/113246
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkPathMeasure.h')
-rw-r--r-- | include/core/SkPathMeasure.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/core/SkPathMeasure.h b/include/core/SkPathMeasure.h index 1044f7eeb0..287c292aeb 100644 --- a/include/core/SkPathMeasure.h +++ b/include/core/SkPathMeasure.h @@ -84,10 +84,10 @@ public: private: SkPath::Iter fIter; - const SkPath* fPath; + SkPath fPath; SkScalar fTolerance; SkScalar fLength; // relative to the current contour - int fFirstPtIndex; // relative to the current contour + unsigned fFirstPtIndex; // relative to the current contour bool fIsClosed; // relative to the current contour bool fForceClosed; @@ -107,12 +107,12 @@ private: void buildSegments(); SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, - int mint, int maxt, int ptIndex); + int mint, int maxt, unsigned ptIndex); SkScalar compute_conic_segs(const SkConic&, SkScalar distance, int mint, const SkPoint& minPt, - int maxt, const SkPoint& maxPt, int ptIndex); + int maxt, const SkPoint& maxPt, unsigned ptIndex); SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, - int mint, int maxt, int ptIndex); + int mint, int maxt, unsigned ptIndex); const Segment* distanceToSegment(SkScalar distance, SkScalar* t); bool quad_too_curvy(const SkPoint pts[3]); bool conic_too_curvy(const SkPoint& firstPt, const SkPoint& midTPt,const SkPoint& lastPt); |