From 2d9c59fa8caefa48d46c8c9f880e54a7a6ad3945 Mon Sep 17 00:00:00 2001 From: caryclark Date: Fri, 30 Oct 2015 13:56:50 -0700 Subject: path ops; remove obsolete reduce Cubics and quads tried to detect linearness directly, once. This is handled later in the pipeline and need not be handled here. TBR=reed@google.com Review URL: https://codereview.chromium.org/1421553010 --- src/pathops/SkReduceOrder.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/pathops/SkReduceOrder.cpp') diff --git a/src/pathops/SkReduceOrder.cpp b/src/pathops/SkReduceOrder.cpp index 9c19bc5686..43a91901f7 100644 --- a/src/pathops/SkReduceOrder.cpp +++ b/src/pathops/SkReduceOrder.cpp @@ -36,16 +36,7 @@ static int horizontal_line(const SkDQuad& quad, SkDQuad& reduction) { static int check_linear(const SkDQuad& quad, int minX, int maxX, int minY, int maxY, SkDQuad& reduction) { - int startIndex = 0; - int endIndex = 2; - while (quad[startIndex].approximatelyEqual(quad[endIndex])) { - --endIndex; - if (endIndex == 0) { - SkDebugf("%s shouldn't get here if all four points are about equal", __FUNCTION__); - SkASSERT(0); - } - } - if (!quad.isLinear(startIndex, endIndex)) { + if (!quad.isLinear(0, 2)) { return 0; } // four are colinear: return line formed by outside @@ -156,16 +147,7 @@ static int check_quadratic(const SkDCubic& cubic, SkDCubic& reduction) { static int check_linear(const SkDCubic& cubic, int minX, int maxX, int minY, int maxY, SkDCubic& reduction) { - int startIndex = 0; - int endIndex = 3; - while (cubic[startIndex].approximatelyEqual(cubic[endIndex])) { - --endIndex; - if (endIndex == 0) { - endIndex = 3; - break; - } - } - if (!cubic.isLinear(startIndex, endIndex)) { + if (!cubic.isLinear(0, 3)) { return 0; } // four are colinear: return line formed by outside -- cgit v1.2.3