aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColorPriv.h
diff options
context:
space:
mode:
authorGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
committerGravatar rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-23 18:09:54 +0000
commitfbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (patch)
treed8b4815d15946c32ee9d254e932411e93be942bb /include/core/SkColorPriv.h
parent2abed834789bb64c7da740df4c47efc142b7311a (diff)
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkColorPriv.h')
-rw-r--r--include/core/SkColorPriv.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h
index 073a4f58f8..a2e1bc5df6 100644
--- a/include/core/SkColorPriv.h
+++ b/include/core/SkColorPriv.h
@@ -67,7 +67,7 @@ static inline int SkAlphaBlend255(S16CPU src, S16CPU dst, U8CPU alpha) {
SkASSERT((int16_t)src == src);
SkASSERT((int16_t)dst == dst);
SkASSERT((uint8_t)alpha == alpha);
-
+
int prod = SkMulS16(src - dst, alpha) + 128;
prod = (prod + (prod >> 8)) >> 8;
return dst + prod;
@@ -242,7 +242,7 @@ static inline SkPMColor SkFourByteInterp256(SkPMColor src, SkPMColor dst,
unsigned r = SkAlphaBlend(SkGetPackedR32(src), SkGetPackedR32(dst), scale);
unsigned g = SkAlphaBlend(SkGetPackedG32(src), SkGetPackedG32(dst), scale);
unsigned b = SkAlphaBlend(SkGetPackedB32(src), SkGetPackedB32(dst), scale);
-
+
return SkPackARGB32(a, r, g, b);
}
@@ -754,32 +754,32 @@ static inline int SkBlend32(int src, int dst, int scale) {
}
static inline SkPMColor SkBlendLCD16(int srcA, int srcR, int srcG, int srcB,
- SkPMColor dst, uint16_t mask) {
+ SkPMColor dst, uint16_t mask) {
if (mask == 0) {
return dst;
}
-
+
/* We want all of these in 5bits, hence the shifts in case one of them
* (green) is 6bits.
*/
int maskR = SkGetPackedR16(mask) >> (SK_R16_BITS - 5);
int maskG = SkGetPackedG16(mask) >> (SK_G16_BITS - 5);
int maskB = SkGetPackedB16(mask) >> (SK_B16_BITS - 5);
-
+
// Now upscale them to 0..32, so we can use blend32
maskR = SkUpscale31To32(maskR);
maskG = SkUpscale31To32(maskG);
maskB = SkUpscale31To32(maskB);
-
+
// srcA has been upscaled to 256 before passed into this function
maskR = maskR * srcA >> 8;
maskG = maskG * srcA >> 8;
maskB = maskB * srcA >> 8;
-
+
int dstR = SkGetPackedR32(dst);
int dstG = SkGetPackedG32(dst);
int dstB = SkGetPackedB32(dst);
-
+
// LCD blitting is only supported if the dst is known/required
// to be opaque
return SkPackARGB32(0xFF,
@@ -790,7 +790,7 @@ static inline SkPMColor SkBlendLCD16(int srcA, int srcR, int srcG, int srcB,
static inline SkPMColor SkBlendLCD16Opaque(int srcR, int srcG, int srcB,
SkPMColor dst, uint16_t mask,
- SkPMColor opaqueDst) {
+ SkPMColor opaqueDst) {
if (mask == 0) {
return dst;
}
@@ -798,23 +798,23 @@ static inline SkPMColor SkBlendLCD16Opaque(int srcR, int srcG, int srcB,
if (0xFFFF == mask) {
return opaqueDst;
}
-
+
/* We want all of these in 5bits, hence the shifts in case one of them
* (green) is 6bits.
*/
int maskR = SkGetPackedR16(mask) >> (SK_R16_BITS - 5);
int maskG = SkGetPackedG16(mask) >> (SK_G16_BITS - 5);
int maskB = SkGetPackedB16(mask) >> (SK_B16_BITS - 5);
-
+
// Now upscale them to 0..32, so we can use blend32
maskR = SkUpscale31To32(maskR);
maskG = SkUpscale31To32(maskG);
maskB = SkUpscale31To32(maskB);
-
+
int dstR = SkGetPackedR32(dst);
int dstG = SkGetPackedG32(dst);
int dstB = SkGetPackedB32(dst);
-
+
// LCD blitting is only supported if the dst is known/required
// to be opaque
return SkPackARGB32(0xFF,
@@ -829,24 +829,24 @@ static inline void SkBlitLCD16Row(SkPMColor dst[], const uint16_t src[],
int srcR = SkColorGetR(color);
int srcG = SkColorGetG(color);
int srcB = SkColorGetB(color);
-
+
srcA = SkAlpha255To256(srcA);
-
+
for (int i = 0; i < width; i++) {
dst[i] = SkBlendLCD16(srcA, srcR, srcG, srcB, dst[i], src[i]);
}
}
static inline void SkBlitLCD16OpaqueRow(SkPMColor dst[], const uint16_t src[],
- SkColor color, int width,
+ SkColor color, int width,
SkPMColor opaqueDst) {
int srcR = SkColorGetR(color);
int srcG = SkColorGetG(color);
int srcB = SkColorGetB(color);
-
+
for (int i = 0; i < width; i++) {
dst[i] = SkBlendLCD16Opaque(srcR, srcG, srcB, dst[i], src[i],
- opaqueDst);
+ opaqueDst);
}
}