Improve ASSERT_RETURN in SkScan_Path

When this assert happens in a Chromium bug report it just states
"assert(false)". While the line number is present the line numbers
aren't always stable or easy to track down over time, so having the
condition that actually asserted present gives better certainty about
where in the code and which condition failed to hold in relation to the
crash report.

Change-Id: I7b0deb05c1736ba90c7642c90d8be44d2d17e9f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310156
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
Ben Wagner 2020-08-13 16:39:30 -04:00 committed by Skia Commit-Bot
parent 4914cbc495
commit 283c230fa1

View File

@ -210,12 +210,12 @@ static bool update_edge(SkEdge* edge, int last_y) {
}
// Unexpected conditions for which we need to return
#define ASSERT_RETURN(cond) \
do { \
if (!(cond)) { \
SkASSERT(false); \
return; \
} \
#define ASSERT_RETURN(cond) \
do { \
if (!(cond)) { \
SkDEBUGFAILF("assert(%s)", #cond); \
return; \
} \
} while (0)
// Needs Y to only change once (looser than convex in X)