diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-21 18:30:53 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-21 18:30:53 +0000 |
commit | 6ba4572eed5a4ecfdd22d118fa55b5c06902b574 (patch) | |
tree | ccb8c5501a48f4687d7dbece92805771a01fa121 /src/effects | |
parent | 5f99545de67ee729b4b17f1aae56f8c9dcf460f9 (diff) |
remove dst/rendertarget support for kARGB_4444_Config
BUG=
Review URL: https://codereview.chromium.org/17335008
git-svn-id: http://skia.googlecode.com/svn/trunk@9727 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkAvoidXfermode.cpp | 53 | ||||
-rw-r--r-- | src/effects/SkTransparentShader.cpp | 16 |
2 files changed, 0 insertions, 69 deletions
diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp index 206f7e9870..d76efb839e 100644 --- a/src/effects/SkAvoidXfermode.cpp +++ b/src/effects/SkAvoidXfermode.cpp @@ -48,19 +48,6 @@ static unsigned color_dist16(uint16_t c, unsigned r, unsigned g, unsigned b) { return SkMax32(dr, SkMax32(dg, db)); } -// returns 0..15 -static unsigned color_dist4444(uint16_t c, unsigned r, unsigned g, unsigned b) { - SkASSERT(r <= 0xF); - SkASSERT(g <= 0xF); - SkASSERT(b <= 0xF); - - unsigned dr = SkAbs32(SkGetPackedR4444(c) - r); - unsigned dg = SkAbs32(SkGetPackedG4444(c) - g); - unsigned db = SkAbs32(SkGetPackedB4444(c) - b); - - return SkMax32(dr, SkMax32(dg, db)); -} - // returns 0..255 static unsigned color_dist32(SkPMColor c, U8CPU r, U8CPU g, U8CPU b) { SkASSERT(r <= 0xFF); @@ -174,46 +161,6 @@ void SkAvoidXfermode::xfer16(uint16_t dst[], const SkPMColor src[], int count, } } -void SkAvoidXfermode::xfer4444(uint16_t dst[], const SkPMColor src[], int count, - const SkAlpha aa[]) const { - unsigned opR = SkColorGetR(fOpColor) >> 4; - unsigned opG = SkColorGetG(fOpColor) >> 4; - unsigned opB = SkColorGetB(fOpColor) >> 4; - uint32_t mul = fDistMul; - uint32_t sub = (fDistMul - (1 << 14)) << 4; - - int MAX, mask; - - if (kTargetColor_Mode == fMode) { - mask = -1; - MAX = 15; - } else { - mask = 0; - MAX = 0; - } - - for (int i = 0; i < count; i++) { - int d = color_dist4444(dst[i], opR, opG, opB); - // now reverse d if we need to - d = MAX + (d ^ mask) - mask; - SkASSERT((unsigned)d <= 15); - // convert from 0..15 to 0..16 - d += d >> 3; - d = scale_dist_14(d, mul, sub); - SkASSERT(d <= 16); - - if (d > 0) { - if (NULL != aa) { - d = SkAlphaMul(d, Accurate255To256(*aa++)); - if (0 == d) { - continue; - } - } - dst[i] = SkBlend4444(SkPixel32ToPixel4444(src[i]), dst[i], d); - } - } -} - void SkAvoidXfermode::xferA8(SkAlpha dst[], const SkPMColor src[], int count, const SkAlpha aa[]) const { // override in subclass diff --git a/src/effects/SkTransparentShader.cpp b/src/effects/SkTransparentShader.cpp index 7b92fde6db..0274481623 100644 --- a/src/effects/SkTransparentShader.cpp +++ b/src/effects/SkTransparentShader.cpp @@ -30,7 +30,6 @@ uint32_t SkTransparentShader::getFlags() { flags |= kOpaqueAlpha_Flag; break; case SkBitmap::kARGB_8888_Config: - case SkBitmap::kARGB_4444_Config: if (fAlpha == 255 && fDevice->isOpaque()) flags |= kOpaqueAlpha_Flag; break; @@ -79,21 +78,6 @@ void SkTransparentShader::shadeSpan(int x, int y, SkPMColor span[], int count) { } break; } - case SkBitmap::kARGB_4444_Config: { - const uint16_t* src = fDevice->getAddr16(x, y); - if (scale == 256) { - for (int i = count - 1; i >= 0; --i) { - span[i] = SkPixel4444ToPixel32(src[i]); - } - } else { - unsigned scale16 = scale >> 4; - for (int i = count - 1; i >= 0; --i) { - uint32_t c = SkExpand_4444(src[i]) * scale16; - span[i] = SkCompact_8888(c); - } - } - break; - } case SkBitmap::kIndex8_Config: SkDEBUGFAIL("index8 not supported as a destination device"); break; |