diff options
author | caryclark <caryclark@google.com> | 2016-01-19 08:07:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-19 08:07:50 -0800 |
commit | b6474dd1a530a543ae799c3822e8bc60180761c0 (patch) | |
tree | 2e42f77ea502e31ac7473806437adb6be680bd33 /include/core/SkPathMeasure.h | |
parent | a913275bda105fd545af471b724d7e8c1dacb9ae (diff) |
fix circular dashing
Path measure cannot use the same code approach for quadratics
and cubics. Subdividing cubics repeatedly does not result in
subdivided t values, e.g. a quarter circle cubic divided in
half twice does not have a t value equivalent to 1/4.
Instead, always compute the cubic segment from a pair of
t values.
When finding the length of the cubic through recursive measures,
it is enough to carry the point at a given t to the next
subdivision.
(Chrome suppression has landed already.)
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1602153002
Review URL: https://codereview.chromium.org/1602153002
Diffstat (limited to 'include/core/SkPathMeasure.h')
-rw-r--r-- | include/core/SkPathMeasure.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/core/SkPathMeasure.h b/include/core/SkPathMeasure.h index 7528736ba8..415ee2709c 100644 --- a/include/core/SkPathMeasure.h +++ b/include/core/SkPathMeasure.h @@ -107,7 +107,13 @@ private: void buildSegments(); SkScalar compute_quad_segs(const SkPoint pts[3], SkScalar distance, int mint, int maxt, int ptIndex); +#ifdef SK_SUPPORT_LEGACY_CONIC_MEASURE SkScalar compute_conic_segs(const SkConic&, SkScalar distance, int mint, int maxt, int ptIndex); +#else + SkScalar compute_conic_segs(const SkConic&, SkScalar distance, + int mint, const SkPoint& minPt, + int maxt, const SkPoint& maxPt, int ptIndex); +#endif SkScalar compute_cubic_segs(const SkPoint pts[3], SkScalar distance, int mint, int maxt, int ptIndex); const Segment* distanceToSegment(SkScalar distance, SkScalar* t); |