aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPath.h
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-11-08 11:44:31 -0500
committerGravatar Ravi Mistry <rmistry@google.com>2017-11-08 18:25:17 +0000
commitdf429f3beac1c191289ba1e3bd918bf84df57bf5 (patch)
tree65f7f049b218ef8984d054524c05dd3fcea392a3 /include/core/SkPath.h
parent21ad53fd8839af82bcb11da6ab3e256ee7752f2b (diff)
move parts of SkPoint to SkPointPriv
Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'include/core/SkPath.h')
-rw-r--r--include/core/SkPath.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index d39d4efcd3..25aa7fcc1d 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -421,9 +421,7 @@ public:
@param exact if false, allow nearly equals
@return true if line is degenerate; its length is effectively zero
*/
- static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact) {
- return exact ? p1 == p2 : p1.equalsWithinTolerance(p2);
- }
+ static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact);
/** Test if quad is degenerate.
Quad with no length or that moves a very short distance is degenerate; it is
@@ -437,10 +435,7 @@ public:
@return true if quad is degenerate; its length is effectively zero
*/
static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2,
- const SkPoint& p3, bool exact) {
- return exact ? p1 == p2 && p2 == p3 : p1.equalsWithinTolerance(p2) &&
- p2.equalsWithinTolerance(p3);
- }
+ const SkPoint& p3, bool exact);
/** Test if cubic is degenerate.
Cubic with no length or that moves a very short distance is degenerate; it is
@@ -455,11 +450,7 @@ public:
@return true if cubic is degenerate; its length is effectively zero
*/
static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2,
- const SkPoint& p3, const SkPoint& p4, bool exact) {
- return exact ? p1 == p2 && p2 == p3 && p3 == p4 : p1.equalsWithinTolerance(p2) &&
- p2.equalsWithinTolerance(p3) &&
- p3.equalsWithinTolerance(p4);
- }
+ const SkPoint& p3, const SkPoint& p4, bool exact);
/** Returns true if SkPath contains only one line;
SkPath::Verb array has two entries: kMove_Verb, kLine_Verb.