aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsTypes.h
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-07-21 05:48:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 05:48:44 -0700
commit1597628fa38d24f23ad505bfb40e70e7c8617457 (patch)
tree1404694d03aa87c0d78d73701b710f4ab880f4bc /src/pathops/SkPathOpsTypes.h
parentec336deffbf5945f2249f822b1ccc4628a9906a4 (diff)
fix fuzzer bug
Fix another fuzzer bug. Some PathOps asserts only make sense if the incoming data is well-behaved. Well-behaved tests set debugging state to trigger these additional asserts. Formalize this by creating macros similar to SkASSERT that check to see if the assert should be skipped. TBR=reed@google.com BUG=629962 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2169863002 Review-Url: https://codereview.chromium.org/2169863002
Diffstat (limited to 'src/pathops/SkPathOpsTypes.h')
-rw-r--r--src/pathops/SkPathOpsTypes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsTypes.h b/src/pathops/SkPathOpsTypes.h
index ad2ad463e6..ad9c931795 100644
--- a/src/pathops/SkPathOpsTypes.h
+++ b/src/pathops/SkPathOpsTypes.h
@@ -183,6 +183,10 @@ private:
#endif
};
+#define SkOPASSERT(cond) SkASSERT(this->globalState()->debugSkipAssert() || cond)
+#define SkOPOBJASSERT(obj, cond) SkASSERT((obj->debugGlobalState() && \
+ obj->debugGlobalState()->debugSkipAssert()) || cond)
+
// Use Almost Equal when comparing coordinates. Use epsilon to compare T values.
bool AlmostEqualUlps(float a, float b);
inline bool AlmostEqualUlps(double a, double b) {