remove pathop template
(fixing msan/asan/ubsan failure)
Pathops used templates for curve intersection.
Since only one template is required if curves share
an abstract base, remove the template altogether.
This makes the code easier to read, and incidentally
makes it slightly smaller and much faster.
This also removes debugging code specific to templates,
and removes Simplify code which isn't covered by tests
or fuzz.
This shaves the execution time of
pathops_unittest -V -x from 6m to 3m23s.
R=kjlubick@google.com
Bug: skia:
Change-Id: I3392df98244083d0327ce9c787dfe24d326ef4ed
Reviewed-on: https://skia-review.googlesource.com/c/162742
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/src/pathops/SkPathOpsConic.cpp b/src/pathops/SkPathOpsConic.cpp
index e1940a0..ffcaaa7 100644
--- a/src/pathops/SkPathOpsConic.cpp
+++ b/src/pathops/SkPathOpsConic.cpp
@@ -173,22 +173,18 @@
return chopped[1];
}
-#if PATH_OP_COMPILE_FOR_SIZE
+int SkTConic::intersectRay(SkIntersections* i, const SkDLine& line) const {
+ return i->intersectRay(fConic, line);
+}
- int SkTConic::intersectRay(SkIntersections* i, const SkDLine& line) const {
- return i->intersectRay(fConic, line);
- }
+bool SkTConic::hullIntersects(const SkDQuad& quad, bool* isLinear) const {
+ return quad.hullIntersects(fConic, isLinear);
+}
- bool SkTConic::hullIntersects(const SkDQuad& quad, bool* isLinear) const {
- return quad.hullIntersects(fConic, isLinear);
- }
+bool SkTConic::hullIntersects(const SkDCubic& cubic, bool* isLinear) const {
+ return cubic.hullIntersects(fConic, isLinear);
+}
- bool SkTConic::hullIntersects(const SkDCubic& cubic, bool* isLinear) const {
- return cubic.hullIntersects(fConic, isLinear);
- }
-
- void SkTConic::setBounds(SkDRect* rect) const {
- rect->setBounds(fConic);
- }
-
-#endif
+void SkTConic::setBounds(SkDRect* rect) const {
+ rect->setBounds(fConic);
+}