aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColorPriv.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-04 00:42:07 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-04 00:42:07 +0000
commite76a3225d5d791a631f70a6a45f6772721710eee (patch)
tree0a9a3fc62e0548a201c616fe548194b25241f30a /include/core/SkColorPriv.h
parentfe9d8a44d62aced3d99295bcb727af386907786a (diff)
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
Diffstat (limited to 'include/core/SkColorPriv.h')
-rw-r--r--include/core/SkColorPriv.h8
1 files 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