aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsCubicIntersectionTestData.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-08 11:50:00 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-08 11:50:00 +0000
commit9166dcb3a0e8784bea83d76ae01aa338c049ae05 (patch)
treea5c450613d4fa7d2153162b5ac9d4670b1b4f0bc /tests/PathOpsCubicIntersectionTestData.h
parent07393cab57ce74a4aae89a31fae9aaa9780fc19d (diff)
Add intersections for path ops
This CL depends on https://codereview.chromium.org/12827020/ "Add base types for path ops" The intersection of a line, quadratic, or cubic with another curve (or with itself) is found by solving the implicit equation for the curve pair. The curves are first reduced to find the simplest form that will describe the original, and to detect degenerate or special-case data like horizontal and vertical lines. For cubic self-intersection, and for a pair of cubics, the intersection is found by recursively approximating the cubic with a series of quadratics. The implicit solutions depend on the root finding contained in the DCubic and DQuad structs, and the quartic root finder included here. Review URL: https://codereview.chromium.org/12880016 git-svn-id: http://skia.googlecode.com/svn/trunk@8552 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PathOpsCubicIntersectionTestData.h')
-rw-r--r--tests/PathOpsCubicIntersectionTestData.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/PathOpsCubicIntersectionTestData.h b/tests/PathOpsCubicIntersectionTestData.h
new file mode 100644
index 0000000000..9e7ad7348e
--- /dev/null
+++ b/tests/PathOpsCubicIntersectionTestData.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include "SkPathOpsCubic.h"
+
+extern const SkDCubic pointDegenerates[];
+extern const SkDCubic notPointDegenerates[];
+extern const SkDCubic tests[][2];
+extern SkDCubic hexTests[][2];
+
+extern void convert_testx();
+
+extern const SkDCubic lines[];
+extern const SkDCubic notLines[];
+extern const SkDCubic modEpsilonLines[];
+extern const SkDCubic lessEpsilonLines[];
+extern const SkDCubic negEpsilonLines[];
+
+extern const size_t pointDegenerates_count;
+extern const size_t notPointDegenerates_count;
+extern const size_t tests_count;
+extern const size_t hexTests_count;
+extern const size_t lines_count;
+extern const size_t notLines_count;
+extern const size_t modEpsilonLines_count;
+extern const size_t lessEpsilonLines_count;
+extern const size_t negEpsilonLines_count;