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

Unified Diff: src/pathops/SkPathOpsOp.cpp

Issue 14407006: path ops -- handle non-finite numbers (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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/SkPathOpsOp.cpp
===================================================================
--- src/pathops/SkPathOpsOp.cpp (revision 8862)
+++ src/pathops/SkPathOpsOp.cpp (working copy)
@@ -226,7 +226,7 @@
{{ false, true }, { false, false }}, // rev diff
};
-void Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
+bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
op = gOpInverse[op][one.isInverseFillType()][two.isInverseFillType()];
SkPath::FillType fillType = gOutInverse[op][one.isInverseFillType()][two.isInverseFillType()]
? SkPath::kInverseEvenOdd_FillType : SkPath::kEvenOdd_FillType;
@@ -246,7 +246,9 @@
SkOpEdgeBuilder builder(*minuend, contours);
const int xorMask = builder.xorMask();
builder.addOperand(*subtrahend);
- builder.finish();
+ if (!builder.finish()) {
+ return false;
+ }
result->reset();
result->setFillType(fillType);
const int xorOpMask = builder.xorMask();
@@ -255,7 +257,7 @@
xorOpMask == kEvenOdd_PathOpsMask);
SkOpContour** currentPtr = contourList.begin();
if (!currentPtr) {
- return;
+ return true;
}
SkOpContour** listEnd = contourList.end();
// find all intersections between segments
@@ -298,5 +300,7 @@
SkPathWriter assembled(temp);
Assemble(wrapper, &assembled);
*result = *assembled.nativePath();
+ result->setFillType(fillType);
}
+ return true;
}

Powered by Google App Engine
This is Rietveld 408576698