From e76a3225d5d791a631f70a6a45f6772721710eee Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 4 Dec 2013 00:42:07 +0000 Subject: [PATCH] SkSplay and SkUnsplay work on any uint32_t, not just SkPMColor. BUG= R=reed@google.com, tfarina@chromium.org Author: mtklein@google.com Review URL: https://codereview.chromium.org/102813002 git-svn-id: http://skia.googlecode.com/svn/trunk@12476 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkColorPriv.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h index cd6fc2cfd2..7a74c4a034 100644 --- a/include/core/SkColorPriv.h +++ b/include/core/SkColorPriv.h @@ -271,7 +271,7 @@ static inline SkPMColor SkFourByteInterp(SkPMColor src, SkPMColor dst, /** * 0xAARRGGBB -> 0x00AA00GG, 0x00RR00BB */ -static inline void SkSplay(SkPMColor color, uint32_t* ag, uint32_t* rb) { +static inline void SkSplay(uint32_t color, uint32_t* ag, uint32_t* rb) { const uint32_t mask = 0x00FF00FF; *ag = (color >> 8) & mask; *rb = color & mask; @@ -281,7 +281,7 @@ static inline void SkSplay(SkPMColor color, uint32_t* ag, uint32_t* rb) { * 0xAARRGGBB -> 0x00AA00GG00RR00BB * (note, ARGB -> AGRB) */ -static inline uint64_t SkSplay(SkPMColor color) { +static inline uint64_t SkSplay(uint32_t color) { const uint32_t mask = 0x00FF00FF; uint64_t agrb = (color >> 8) & mask; // 0x0000000000AA00GG agrb <<= 32; // 0x00AA00GG00000000 @@ -292,7 +292,7 @@ static inline uint64_t SkSplay(SkPMColor color) { /** * 0xAAxxGGxx, 0xRRxxBBxx-> 0xAARRGGBB */ -static inline SkPMColor SkUnsplay(uint32_t ag, uint32_t rb) { +static inline uint32_t SkUnsplay(uint32_t ag, uint32_t rb) { const uint32_t mask = 0xFF00FF00; return (ag & mask) | ((rb & mask) >> 8); } @@ -301,7 +301,7 @@ static inline SkPMColor SkUnsplay(uint32_t ag, uint32_t rb) { * 0xAAxxGGxxRRxxBBxx -> 0xAARRGGBB * (note, AGRB -> ARGB) */ -static inline SkPMColor SkUnsplay(uint64_t agrb) { +static inline uint32_t SkUnsplay(uint64_t agrb) { const uint32_t mask = 0xFF00FF00; return SkPMColor( ((agrb & mask) >> 8) | // 0x00RR00BB