aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkConvertPixels.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-01 10:33:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-01 17:12:58 +0000
commite779ab17b6939e8fc709332399234fc25f1aa788 (patch)
tree7de4b241e3a11fb4fce3b1bf950f368d3fde7854 /src/core/SkConvertPixels.cpp
parenteaa90b2a1acce598627250bc68ebc216d2b17e7c (diff)
Remove unused code for index 8
Bug: skia: Change-Id: I0d421874e7ab71a39e2708575314f5b3615882e4 Reviewed-on: https://skia-review.googlesource.com/29221 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core/SkConvertPixels.cpp')
-rw-r--r--src/core/SkConvertPixels.cpp53
1 files changed, 2 insertions, 51 deletions
diff --git a/src/core/SkConvertPixels.cpp b/src/core/SkConvertPixels.cpp
index 3bfa6893c4..b447edaa02 100644
--- a/src/core/SkConvertPixels.cpp
+++ b/src/core/SkConvertPixels.cpp
@@ -159,56 +159,7 @@ static inline void apply_color_xform(const SkImageInfo& dstInfo, void* dstPixels
}
}
-// Fast Path 4: Index 8 sources.
-template <typename T>
-void do_index8(const SkImageInfo& dstInfo, T* dstPixels, size_t dstRB,
- const SkImageInfo& srcInfo, const uint8_t* srcPixels, size_t srcRB,
- SkColorTable* ctable, SkTransferFunctionBehavior behavior) {
- T dstCTable[256];
- int count = ctable->count();
- SkImageInfo srcInfo8888 = srcInfo.makeColorType(kN32_SkColorType).makeWH(count, 1);
- SkImageInfo dstInfoCT = dstInfo.makeWH(count, 1);
- size_t rowBytes = count * sizeof(T);
- SkConvertPixels(dstInfoCT, dstCTable, rowBytes, srcInfo8888, ctable->readColors(), rowBytes,
- nullptr, behavior);
-
- for (int y = 0; y < dstInfo.height(); y++) {
- for (int x = 0; x < dstInfo.width(); x++) {
- dstPixels[x] = dstCTable[srcPixels[x]];
- }
- dstPixels = SkTAddOffset<T>(dstPixels, dstRB);
- srcPixels = SkTAddOffset<const uint8_t>(srcPixels, srcRB);
- }
-}
-
-void convert_from_index8(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
- const SkImageInfo& srcInfo, const uint8_t* srcPixels, size_t srcRB,
- SkColorTable* ctable, SkTransferFunctionBehavior behavior) {
- switch (dstInfo.colorType()) {
- case kAlpha_8_SkColorType:
- do_index8(dstInfo, (uint8_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable,
- behavior);
- break;
- case kRGB_565_SkColorType:
- case kARGB_4444_SkColorType:
- do_index8(dstInfo, (uint16_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable,
- behavior);
- break;
- case kRGBA_8888_SkColorType:
- case kBGRA_8888_SkColorType:
- do_index8(dstInfo, (uint32_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable,
- behavior);
- break;
- case kRGBA_F16_SkColorType:
- do_index8(dstInfo, (uint64_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable,
- behavior);
- break;
- default:
- SkASSERT(false);
- }
-}
-
-// Fast Path 5: Alpha 8 dsts.
+// Fast Path 4: Alpha 8 dsts.
static void convert_to_alpha8(uint8_t* dst, size_t dstRB, const SkImageInfo& srcInfo,
const void* src, size_t srcRB, SkColorTable* ctable) {
if (srcInfo.isOpaque()) {
@@ -412,7 +363,7 @@ void SkConvertPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
return;
}
- // Fast Path 5: Alpha 8 dsts.
+ // Fast Path 4: Alpha 8 dsts.
if (kAlpha_8_SkColorType == dstInfo.colorType()) {
convert_to_alpha8((uint8_t*) dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable);
return;