diff options
author | 2015-10-30 13:56:50 -0700 | |
---|---|---|
committer | 2015-10-30 13:56:50 -0700 | |
commit | 2d9c59fa8caefa48d46c8c9f880e54a7a6ad3945 (patch) | |
tree | ffb242289321d248b9d6b0a00df02737a5f63ce2 /src/pathops/SkReduceOrder.cpp | |
parent | a8bd38e1787417cb472ee5381bd9ce6e126afb41 (diff) |
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
Diffstat (limited to 'src/pathops/SkReduceOrder.cpp')
-rw-r--r-- | src/pathops/SkReduceOrder.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
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 |