Consolidate SK_CRASH and sk_throw into SK_ABORT
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1648343003
Review URL: https://codereview.chromium.org/1648343003
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index c112b03..0d31efc 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -67,7 +67,7 @@
The platform implementation must not return, but should either throw
an exception or otherwise exit.
*/
-SK_API extern void sk_throw(void);
+SK_API extern void sk_abort_no_print(void);
enum {
SK_MALLOC_TEMP = 0x01, //!< hint to sk_malloc that the requested memory will be freed in the scope of the stack frame
@@ -128,8 +128,10 @@
SK_API void SkDebugf(const char format[], ...);
#endif
+#define SkASSERT_RELEASE(cond) if(!(cond)) { SK_ABORT(#cond); }
+
#ifdef SK_DEBUG
- #define SkASSERT(cond) SK_ALWAYSBREAK(cond)
+ #define SkASSERT(cond) SkASSERT_RELEASE(cond)
#define SkDEBUGFAIL(message) SkASSERT(false && message)
#define SkDEBUGFAILF(fmt, ...) SkASSERTF(false, fmt, ##__VA_ARGS__)
#define SkDEBUGCODE(code) code
@@ -150,7 +152,9 @@
#define SkAssertResult(cond) cond
#endif
-#define SkFAIL(message) SK_ALWAYSBREAK(false && message)
+// Legacy macro names for SK_ABORT
+#define SkFAIL(message) SK_ABORT(message)
+#define sk_throw() SK_ABORT("sk_throw")
// We want to evaluate cond only once, and inside the SkASSERT somewhere so we see its string form.
// So we use the comma operator to make an SkDebugf that always returns false: we'll evaluate cond,