diff options
author | Lei Zhang <thestig@chromium.org> | 2017-04-07 12:28:21 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-07 20:21:11 +0000 |
commit | 868d52be4e78f6dff330a1b931b5e2f8c55e87b4 (patch) | |
tree | a75cec71545d32ff8d48d9ec28e5ccd349e5cc7a | |
parent | cf20f7881cf6a546ecb369e2ced55608f6ddeaf3 (diff) |
Make SkColorSetA() a constexpr function.
This gives compilers a strong hint that SkColor constants to be computed
at compile time.
Change-Id: I09c8a7fd23e4488f8b101f53d67a155f64d5d423
Reviewed-on: https://skia-review.googlesource.com/12056
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
-rw-r--r-- | include/core/SkColor.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/core/SkColor.h b/include/core/SkColor.h index 4d54773c38..5ee86fbee6 100644 --- a/include/core/SkColor.h +++ b/include/core/SkColor.h @@ -67,7 +67,7 @@ static inline SkColor SkColorSetARGBInline(U8CPU a, U8CPU r, U8CPU g, U8CPU b) /** return the blue byte from a SkColor value */ #define SkColorGetB(color) (((color) >> 0) & 0xFF) -static inline SkColor SkColorSetA(SkColor c, U8CPU a) { +static constexpr inline SkColor SkColorSetA(SkColor c, U8CPU a) { return (c & 0x00FFFFFF) | (a << 24); } |