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

Unified Diff: src/pathops/SkPathOpsDebug.h

Issue 2273293004: path ops stream-lining (Closed)
Patch Set: remove commented out code Created 4 years, 4 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 | « src/pathops/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsDebug.h
diff --git a/src/pathops/SkPathOpsDebug.h b/src/pathops/SkPathOpsDebug.h
index c1b1adb7072a750cf3e883cec1f8d3d9f2bf8171..5ea1dd8b2655a9993699140ad56b071d8f0e64ff 100644
--- a/src/pathops/SkPathOpsDebug.h
+++ b/src/pathops/SkPathOpsDebug.h
@@ -156,12 +156,19 @@
#include "SkTLS.h"
#endif
-#define FAIL_IF(cond) do { bool fail = (cond); SkOPASSERT(!fail); if (fail) return false; } \
- while (false)
+// Tests with extreme numbers may fail, but all other tests should never fail.
+#define FAIL_IF(cond) \
+ do { bool fail = (cond); SkOPASSERT(!fail); if (fail) return false; } while (false)
+#define FAIL_WITH_NULL_IF(cond) \
+ do { bool fail = (cond); SkOPASSERT(!fail); if (fail) return nullptr; } while (false)
+
+// Some functions serve two masters: one allows the function to fail, the other expects success
+// always. If abort is true, tests with normal numbers may not fail and assert if they do so.
+// If abort is false, both normal and extreme numbers may return false without asserting.
#define RETURN_FALSE_IF(abort, cond) \
- do { bool fail = (cond); SkOPASSERT(!(abort) || !fail); if (fail) return false; } \
- while (false)
+ do { bool fail = (cond); SkOPASSERT(!(abort) || !fail); if (fail) return false; \
+ } while (false)
class SkPathOpsDebug {
public:
« no previous file with comments | « src/pathops/SkOpSpan.cpp ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698