Make SkASSERT and co. constexpr compatible.

One of the nice bits of constexpr is that an expression is constexpr if
there exists any set of argument values that make it constant.  It
doesn't have to be constant for _all_ argument values.

This means that this expression is constexpr:

   condition ? constexpr_value
             : []{ arbitrary non-constexpr code; }();

... it's constant when condition is true.

We can use this to rewrite SkASSERT(condition) as

    ( (condition) ? (void)0
                  : []{ SK_ABORT(#condition); }() )

Both sides of the ?: are void, and when condition is true at compile
time the right hand side disappears completely.  In C++11 constexpr
functions we just have to use the comma operator to jam SkASSERT()
into the order of evaluation:

    constexpr uint32_t foo(int x, int y) {
        return SkASSERT(x > y),
               x - y;
    }

Change-Id: I21878d14fb2af76d93591d2ae229460ee825cfde
Reviewed-on: https://skia-review.googlesource.com/52663
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/include/core/SkColor.h b/include/core/SkColor.h
index c8c6a6a..b1b83e3 100644
--- a/include/core/SkColor.h
+++ b/include/core/SkColor.h
@@ -28,29 +28,13 @@
 
 /** Return a SkColor value from 8 bit component values
 */
-static inline SkColor SkColorSetARGBInline(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
-{
-    SkASSERT(a <= 255 && r <= 255 && g <= 255 && b <= 255);
-
-    return (a << 24) | (r << 16) | (g << 8) | (b << 0);
+static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
+    return SkASSERT(a <= 255 && r <= 255 && g <= 255 && b <= 255),
+           (a << 24) | (r << 16) | (g << 8) | (b << 0);
 }
-
-#define SkColorSetARGBMacro(a, r, g, b) \
-    static_cast<SkColor>( \
-        (static_cast<U8CPU>(a) << 24) | \
-        (static_cast<U8CPU>(r) << 16) | \
-        (static_cast<U8CPU>(g) << 8) | \
-        (static_cast<U8CPU>(b) << 0))
-
-/** gcc will generate static initializers for code of this form:
- * static const SkColor kMyColor = SkColorSetARGB(0xFF, 0x01, 0x02, 0x03)
- * if SkColorSetARGB() is a static inline, but not if it's a macro.
- */
-#if defined(NDEBUG)
-#define SkColorSetARGB(a, r, g, b) SkColorSetARGBMacro(a, r, g, b)
-#else
-#define SkColorSetARGB(a, r, g, b) SkColorSetARGBInline(a, r, g, b)
-#endif
+// Legacy aliases.
+#define SkColorSetARGBInline SkColorSetARGB
+#define SkColorSetARGBMacro  SkColorSetARGB
 
 /** Return a SkColor value from 8 bit component values, with an implied value
     of 0xFF for alpha (fully opaque)