diff options
author | reed <reed@google.com> | 2015-02-09 13:54:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-09 13:54:43 -0800 |
commit | d5d27d9b146731b871b1bcc6d6de36fba2d5ea44 (patch) | |
tree | c0cb8e1ce8b63f321988e5d16bd24432adb04755 /src/core/SkGeometry.h | |
parent | 8e85761e5a4a0b169cf101c4d72142ee4b87d266 (diff) |
use conics for arcTo
guarded by SK_SUPPORT_LEGACY_ARCTO_QUADS
BUG=skia:
Review URL: https://codereview.chromium.org/892703002
Diffstat (limited to 'src/core/SkGeometry.h')
-rw-r--r-- | src/core/SkGeometry.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/SkGeometry.h b/src/core/SkGeometry.h index b14a2ddb98..ad4bffcb62 100644 --- a/src/core/SkGeometry.h +++ b/src/core/SkGeometry.h @@ -226,7 +226,6 @@ enum SkRotationDirection { int SkBuildQuadArc(const SkVector& unitStart, const SkVector& unitStop, SkRotationDirection, const SkMatrix*, SkPoint quadPoints[]); -// experimental struct SkConic { SkConic() {} SkConic(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w) { @@ -248,6 +247,13 @@ struct SkConic { fW = w; } + void set(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w) { + fPts[0] = p0; + fPts[1] = p1; + fPts[2] = p2; + fW = w; + } + /** * Given a t-value [0...1] return its position and/or tangent. * If pos is not null, return its position at the t-value. @@ -292,6 +298,12 @@ struct SkConic { bool findMaxCurvature(SkScalar* t) const; static SkScalar TransformW(const SkPoint[3], SkScalar w, const SkMatrix&); + + enum { + kMaxConicsForArc = 5 + }; + static int BuildUnitArc(const SkVector& start, const SkVector& stop, SkRotationDirection, + const SkMatrix*, SkConic conics[kMaxConicsForArc]); }; #include "SkTemplates.h" |