aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsTypes.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-18 15:58:21 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-18 15:58:21 +0000
commit0361032c0b53401030a720bc8b4930c3ec59f19e (patch)
tree9bb66d560604ef23c9d015c10d6d73fece0928e7 /src/pathops/SkPathOpsTypes.h
parentf707adc4f8b22fd1a59a900b64333480de653c5b (diff)
path ops work in progress
fix bugs in tests on 32 bit release Most changes revolve around pinning computed t values very close to zero and one. git-svn-id: http://skia.googlecode.com/svn/trunk@8745 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsTypes.h')
-rw-r--r--src/pathops/SkPathOpsTypes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsTypes.h b/src/pathops/SkPathOpsTypes.h
index aadaca8ccb..c3c0cd5b91 100644
--- a/src/pathops/SkPathOpsTypes.h
+++ b/src/pathops/SkPathOpsTypes.h
@@ -177,6 +177,11 @@ inline bool approximately_between(double a, double b, double c) {
: approximately_negative(b - a) && approximately_negative(c - b);
}
+inline bool precisely_between(double a, double b, double c) {
+ return a <= c ? precisely_negative(a - b) && precisely_negative(b - c)
+ : precisely_negative(b - a) && precisely_negative(c - b);
+}
+
// returns true if (a <= b <= c) || (a >= b >= c)
inline bool between(double a, double b, double c) {
SkASSERT(((a <= b && b <= c) || (a >= b && b >= c)) == ((a - b) * (c - b) <= 0));