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

Unified Diff: src/pathops/SkReduceOrder.cpp

Issue 2128633003: pathops coincidence and security rewrite (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: require resulting t to be between 0 and 1 Created 4 years, 5 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
Index: src/pathops/SkReduceOrder.cpp
diff --git a/src/pathops/SkReduceOrder.cpp b/src/pathops/SkReduceOrder.cpp
index 52a19d6138aaa38dbe257090cebaeb60ba283601..48624baee9acc8e1870abf18e085778940ea59a6 100644
--- a/src/pathops/SkReduceOrder.cpp
+++ b/src/pathops/SkReduceOrder.cpp
@@ -78,10 +78,12 @@ int SkReduceOrder::reduce(const SkDQuad& quad) {
minYSet |= 1 << index;
}
}
+ if ((minXSet & 0x05) == 0x5 && (minYSet & 0x05) == 0x5) { // test for degenerate
+ // this quad starts and ends at the same place, so never contributes
+ // to the fill
+ return coincident_line(quad, fQuad);
+ }
if (minXSet == 0x7) { // test for vertical line
- if (minYSet == 0x7) { // return 1 if all three are coincident
- return coincident_line(quad, fQuad);
- }
return vertical_line(quad, fQuad);
}
if (minYSet == 0x7) { // test for horizontal line

Powered by Google App Engine
This is Rietveld 408576698