aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsTSect.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-04-20 08:31:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-20 08:31:59 -0700
commit1049f1246e7be4ccb68001361efceb8933e6f81c (patch)
tree9c71ceb245856cbe2173913eaec3b0ebb490dd74 /src/pathops/SkPathOpsTSect.cpp
parent5c476fb2776639bdbf0e974dd38d1c5d4c4ff1aa (diff)
Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops. TBR=reed BUG=skia:3588 Review URL: https://codereview.chromium.org/1037953004
Diffstat (limited to 'src/pathops/SkPathOpsTSect.cpp')
-rw-r--r--src/pathops/SkPathOpsTSect.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsTSect.cpp b/src/pathops/SkPathOpsTSect.cpp
new file mode 100644
index 0000000000..1549e6b8fd
--- /dev/null
+++ b/src/pathops/SkPathOpsTSect.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkPathOpsTSect.h"
+
+int SkIntersections::intersect(const SkDQuad& quad1, const SkDQuad& quad2) {
+ SkTSect<SkDQuad, SkDQuad> sect1(quad1 PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDQuad, SkDQuad> sect2(quad2 PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDQuad, SkDQuad>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}
+
+int SkIntersections::intersect(const SkDConic& conic, const SkDQuad& quad) {
+ SkTSect<SkDConic, SkDQuad> sect1(conic PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDQuad, SkDConic> sect2(quad PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDConic, SkDQuad>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}
+
+int SkIntersections::intersect(const SkDConic& conic1, const SkDConic& conic2) {
+ SkTSect<SkDConic, SkDConic> sect1(conic1 PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDConic, SkDConic> sect2(conic2 PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDConic, SkDConic>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}
+
+int SkIntersections::intersect(const SkDCubic& cubic, const SkDQuad& quad) {
+ SkTSect<SkDCubic, SkDQuad> sect1(cubic PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDQuad, SkDCubic> sect2(quad PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDCubic, SkDQuad>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}
+
+int SkIntersections::intersect(const SkDCubic& cubic, const SkDConic& conic) {
+ SkTSect<SkDCubic, SkDConic> sect1(cubic PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDConic, SkDCubic> sect2(conic PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDCubic, SkDConic>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}
+
+int SkIntersections::intersect(const SkDCubic& cubic1, const SkDCubic& cubic2) {
+ SkTSect<SkDCubic, SkDCubic> sect1(cubic1 PATH_OPS_DEBUG_T_SECT_PARAMS(1));
+ SkTSect<SkDCubic, SkDCubic> sect2(cubic2 PATH_OPS_DEBUG_T_SECT_PARAMS(2));
+ SkTSect<SkDCubic, SkDCubic>::BinarySearch(&sect1, &sect2, this);
+ return used();
+}