aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops
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 /src/pathops
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 'src/pathops')
-rw-r--r--src/pathops/SkOpSegment.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index 402f6664de..451a155c58 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -8,6 +8,7 @@
#include "SkOpContour.h"
#include "SkOpSegment.h"
#include "SkPathWriter.h"
+#include "SkPointPriv.h"
/*
After computing raw intersections, post process all segments to:
@@ -1351,7 +1352,7 @@ bool SkOpSegment::spansNearby(const SkOpSpanBase* refSpan, const SkOpSpanBase* c
goto nextRef;
}
}
- SkScalar distSq = ref->fPt.distanceToSqd(check->fPt);
+ SkScalar distSq = SkPointPriv::DistanceToSqd(ref->fPt, check->fPt);
if (distSqBest > distSq && (refSeg != check->segment()
|| !refSeg->ptsDisjoint(*ref, *check))) {
distSqBest = distSq;
@@ -1448,8 +1449,9 @@ bool SkOpSegment::ptsDisjoint(double t1, const SkPoint& pt1, double t2, const Sk
// on the other hand, the below check is relatively inexpensive
double midT = (t1 + t2) / 2;
SkPoint midPt = this->ptAtT(midT);
- double seDistSq = SkTMax(pt1.distanceToSqd(pt2) * 2, FLT_EPSILON * 2);
- return midPt.distanceToSqd(pt1) > seDistSq || midPt.distanceToSqd(pt2) > seDistSq;
+ double seDistSq = SkTMax(SkPointPriv::DistanceToSqd(pt1, pt2) * 2, FLT_EPSILON * 2);
+ return SkPointPriv::DistanceToSqd(midPt, pt1) > seDistSq ||
+ SkPointPriv::DistanceToSqd(midPt, pt2) > seDistSq;
}
void SkOpSegment::setUpWindings(SkOpSpanBase* start, SkOpSpanBase* end, int* sumMiWinding,