diff options
author | caryclark <caryclark@google.com> | 2014-12-12 09:11:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-12 09:11:24 -0800 |
commit | 8dd31cf69e24ff82865309781107dfab948b6a02 (patch) | |
tree | ed60702e6a075a3ec1eb992a9492a989b55b7c8e /src/core/SkGeometry.h | |
parent | 09acfc8d1fd1723d01b7103f58a6f1502648f428 (diff) |
Extract cubic classification from gpu into geometry
Move code from the GPU path utilities into geometry so that
path ops can share.
Review URL: https://codereview.chromium.org/787763007
Diffstat (limited to 'src/core/SkGeometry.h')
-rw-r--r-- | src/core/SkGeometry.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/SkGeometry.h b/src/core/SkGeometry.h index 5075643750..c8a69a97e3 100644 --- a/src/core/SkGeometry.h +++ b/src/core/SkGeometry.h @@ -191,6 +191,20 @@ bool SkXRayCrossesMonotonicCubic(const SkXRay& pt, const SkPoint cubic[4], int SkNumXRayCrossingsForCubic(const SkXRay& pt, const SkPoint cubic[4], bool* ambiguous = NULL); +enum SkCubicType { + kSerpentine_SkCubicType, + kCusp_SkCubicType, + kLoop_SkCubicType, + kQuadratic_SkCubicType, + kLine_SkCubicType, + kPoint_SkCubicType +}; + +/** Returns the cubic classification. Pass scratch storage for computing inflection data, + which can be used with additional work to find the loop intersections and so on. +*/ +SkCubicType SkClassifyCubic(const SkPoint p[4], SkScalar inflection[3]); + /////////////////////////////////////////////////////////////////////////////// enum SkRotationDirection { |