Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: src/codec/SkMaskSwizzler.cpp

Issue 1055743003: Swizzler changes Index8 and 565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkMaskSwizzler.cpp
diff --git a/src/codec/SkMaskSwizzler.cpp b/src/codec/SkMaskSwizzler.cpp
index 944042d1abd1e084c8c0049e3c0060700abed843..58ae11d852d083e7a39f0d8c2be85e9b713fef1b 100644
--- a/src/codec/SkMaskSwizzler.cpp
+++ b/src/codec/SkMaskSwizzler.cpp
@@ -63,22 +63,6 @@ static SkSwizzler::ResultAlpha swizzle_mask16_to_n32_premul(
return COMPUTE_RESULT_ALPHA;
}
-static SkSwizzler::ResultAlpha swizzle_mask16_to_565(
- void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks) {
-
- // Use the masks to decode to the destination
- uint16_t* srcPtr = (uint16_t*) srcRow;
- uint16_t* dstPtr = (uint16_t*) dstRow;
- for (int i = 0; i < width; i++) {
- uint16_t p = srcPtr[i];
- uint8_t red = masks->getRed(p);
- uint8_t green = masks->getGreen(p);
- uint8_t blue = masks->getBlue(p);
- dstPtr[i] = SkPack888ToRGB16(red, green, blue);
- }
- return SkSwizzler::kOpaque_ResultAlpha;
-}
-
static SkSwizzler::ResultAlpha swizzle_mask24_to_n32_opaque(
void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks) {
@@ -130,21 +114,6 @@ static SkSwizzler::ResultAlpha swizzle_mask24_to_n32_premul(
return COMPUTE_RESULT_ALPHA;
}
-static SkSwizzler::ResultAlpha swizzle_mask24_to_565(
- void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks) {
-
- // Use the masks to decode to the destination
- uint16_t* dstPtr = (uint16_t*) dstRow;
- for (int i = 0; i < 3*width; i += 3) {
- uint32_t p = srcRow[i] | (srcRow[i + 1] << 8) | srcRow[i + 2] << 16;
- uint8_t red = masks->getRed(p);
- uint8_t green = masks->getGreen(p);
- uint8_t blue = masks->getBlue(p);
- dstPtr[i/3] = SkPack888ToRGB16(red, green, blue);
- }
- return SkSwizzler::kOpaque_ResultAlpha;
-}
-
static SkSwizzler::ResultAlpha swizzle_mask32_to_n32_opaque(
void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks) {
@@ -199,22 +168,6 @@ static SkSwizzler::ResultAlpha swizzle_mask32_to_n32_premul(
return COMPUTE_RESULT_ALPHA;
}
-static SkSwizzler::ResultAlpha swizzle_mask32_to_565(
- void* dstRow, const uint8_t* srcRow, int width, SkMasks* masks) {
-
- // Use the masks to decode to the destination
- uint32_t* srcPtr = (uint32_t*) srcRow;
- uint16_t* dstPtr = (uint16_t*) dstRow;
- for (int i = 0; i < width; i++) {
- uint32_t p = srcPtr[i];
- uint8_t red = masks->getRed(p);
- uint8_t green = masks->getGreen(p);
- uint8_t blue = masks->getBlue(p);
- dstPtr[i] = SkPack888ToRGB16(red, green, blue);
- }
- return SkSwizzler::kOpaque_ResultAlpha;
-}
-
/*
*
* Create a new mask swizzler
@@ -244,15 +197,6 @@ SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(
break;
}
break;
- case kRGB_565_SkColorType:
- switch (info.alphaType()) {
- case kOpaque_SkAlphaType:
- proc = &swizzle_mask16_to_565;
- break;
- default:
- break;
- }
- break;
default:
break;
}
@@ -274,15 +218,6 @@ SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(
break;
}
break;
- case kRGB_565_SkColorType:
- switch (info.alphaType()) {
- case kOpaque_SkAlphaType:
- proc = &swizzle_mask24_to_565;
- break;
- default:
- break;
- }
- break;
default:
break;
}
@@ -304,15 +239,6 @@ SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(
break;
}
break;
- case kRGB_565_SkColorType:
- switch (info.alphaType()) {
- case kOpaque_SkAlphaType:
- proc = &swizzle_mask32_to_565;
- break;
- default:
- break;
- }
- break;
default:
break;
}
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698