diff options
author | Cary Clark <caryclark@skia.org> | 2018-03-08 17:31:48 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-09 20:20:20 +0000 |
commit | 429a5406733e44cd9d379fc9aa0e2e206cc8867d (patch) | |
tree | fa659b006d3d702772018be11d6f82b44aae0ac2 /include | |
parent | e6b04a1407c5be8c84b233fd1cbc9523f2102be3 (diff) |
start hardening pathmeasure
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
R=reed@google.com
Bug: skia:7675
Change-Id: Ibfcfd4379cabd86b4ef4ea9ff6788d5ccb137ac1
Reviewed-on: https://skia-review.googlesource.com/113269
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-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); |