Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: src/pathops/SkReduceOrder.cpp

Issue 1421553010: path ops; remove obsolete reduce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkReduceOrder.cpp
diff --git a/src/pathops/SkReduceOrder.cpp b/src/pathops/SkReduceOrder.cpp
index 9c19bc56860d45ae4ffd0468fb46618ead0a3150..43a91901f76f9b4539545340d206d946a528c002 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698