path ops -- handle non-finite numbers
Op() and Simplify() do nothing if the input
is non-finite. Add code and tests.
Review URL: https://codereview.chromium.org/14407006
git-svn-id: http://skia.googlecode.com/svn/trunk@8882 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index 4626454..8d7ca28 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -449,7 +449,11 @@
if (gShowPath) {
showPath(path);
}
- Simplify(path, &out);
+ if (!Simplify(path, &out)) {
+ SkDebugf("%s did not expect failure\n", __FUNCTION__);
+ REPORTER_ASSERT(state.fReporter, 0);
+ return false;
+ }
if (!gComparePaths) {
return true;
}
@@ -478,7 +482,11 @@
showPathData(path);
#endif
SkPath out;
- Simplify(path, &out);
+ if (!Simplify(path, &out)) {
+ SkDebugf("%s did not expect failure\n", __FUNCTION__);
+ REPORTER_ASSERT(reporter, 0);
+ return false;
+ }
SkBitmap bitmap;
int result = comparePaths(reporter, path, out, bitmap);
if (result && gPathStrAssert) {
@@ -496,7 +504,11 @@
showPathData(b);
#endif
SkPath out;
- Op(a, b, shapeOp, &out);
+ if (!Op(a, b, shapeOp, &out) ) {
+ SkDebugf("%s did not expect failure\n", __FUNCTION__);
+ REPORTER_ASSERT(reporter, 0);
+ return false;
+ }
SkPath pathOut, scaledPathOut;
SkRegion rgnA, rgnB, openClip, rgnOut;
openClip.setRect(-16000, -16000, 16000, 16000);