aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-09 16:01:36 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-09 16:01:36 +0000
commit0db5a7fae596e4914250554402e4874c33fdf0d4 (patch)
tree27f91d85ebb613abea5319ea163114ea994d9d7d /src/effects
parent5ebbe14f76da3028e5d4523c093a0f4a2cf8e982 (diff)
update dox for SkAvoidXfermode (as best I could)
fix 565 and 4444 implementations git-svn-id: http://skia.googlecode.com/svn/trunk@420 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkAvoidXfermode.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp
index eed40122c2..d26039cec9 100644
--- a/src/effects/SkAvoidXfermode.cpp
+++ b/src/effects/SkAvoidXfermode.cpp
@@ -174,7 +174,7 @@ void SkAvoidXfermode::xfer16(uint16_t dst[], const SkPMColor src[], int count,
unsigned opG = SkColorGetG(fOpColor) >> (8 - SK_G16_BITS);
unsigned opB = SkColorGetB(fOpColor) >> (8 - SK_R16_BITS);
uint32_t mul = fDistMul;
- uint32_t sub = (fDistMul - (1 << 14)) << 8;
+ uint32_t sub = (fDistMul - (1 << 14)) << SK_R16_BITS;
int MAX, mask;
@@ -193,7 +193,6 @@ void SkAvoidXfermode::xfer16(uint16_t dst[], const SkPMColor src[], int count,
SkASSERT((unsigned)d <= 31);
// convert from 0..31 to 0..32
d += d >> 4;
-
d = scale_dist_14(d, mul, sub);
SkASSERT(d <= 32);
@@ -216,7 +215,7 @@ void SkAvoidXfermode::xfer4444(uint16_t dst[], const SkPMColor src[], int count,
unsigned opG = SkColorGetG(fOpColor) >> 4;
unsigned opB = SkColorGetB(fOpColor) >> 4;
uint32_t mul = fDistMul;
- uint32_t sub = (fDistMul - (1 << 14)) << 8;
+ uint32_t sub = (fDistMul - (1 << 14)) << 4;
int MAX, mask;
@@ -233,8 +232,8 @@ void SkAvoidXfermode::xfer4444(uint16_t dst[], const SkPMColor src[], int count,
// now reverse d if we need to
d = MAX + (d ^ mask) - mask;
SkASSERT((unsigned)d <= 15);
- d = SkAlpha255To256(d);
-
+ // convert from 0..15 to 0..16
+ d += d >> 3;
d = scale_dist_14(d, mul, sub);
SkASSERT(d <= 16);