diff options
author | 2017-07-12 22:10:29 -0400 | |
---|---|---|
committer | 2017-07-13 10:44:42 +0000 | |
commit | 580501382fb1418fff7acc63680f3a9a6bf3938c (patch) | |
tree | 16a93a72852e282b1f520dcc947985e2190a45bf /src/core/SkLinearBitmapPipeline.cpp | |
parent | 4d41b8f2fdae21a6ed16fca6242d53e7c08349d0 (diff) |
Guard to remove kIndex_8_SkColorType
Bug: skia:6828
Change-Id: Ia942a36abb18213184f8d436555a658270d97d47
Reviewed-on: https://skia-review.googlesource.com/22721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkLinearBitmapPipeline.cpp')
-rw-r--r-- | src/core/SkLinearBitmapPipeline.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/SkLinearBitmapPipeline.cpp b/src/core/SkLinearBitmapPipeline.cpp index cf2dfdc09f..8c4d06281a 100644 --- a/src/core/SkLinearBitmapPipeline.cpp +++ b/src/core/SkLinearBitmapPipeline.cpp @@ -372,9 +372,11 @@ SkLinearBitmapPipeline::SkLinearBitmapPipeline( // If it is an index 8 color type, the sampler converts to unpremul for better fidelity. SkAlphaType alphaType = srcImageInfo.alphaType(); +#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE if (srcPixmap.colorType() == kIndex_8_SkColorType) { alphaType = kUnpremul_SkAlphaType; } +#endif float postAlpha = SkColorGetA(paintColor) * (1.0f / 255.0f); // As the stages are built, the chooser function may skip a stage. For example, with the @@ -596,8 +598,10 @@ SkLinearBitmapPipeline::PixelAccessorInterface* SkLinearBitmapPipeline::choosePi return this->chooseSpecificAccessor<kRGBA_8888_SkColorType>(srcPixmap, allocator); case kBGRA_8888_SkColorType: return this->chooseSpecificAccessor<kBGRA_8888_SkColorType>(srcPixmap, allocator); +#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE case kIndex_8_SkColorType: return this->chooseSpecificAccessor<kIndex_8_SkColorType>(srcPixmap, allocator); +#endif case kGray_8_SkColorType: return this->chooseSpecificAccessor<kGray_8_SkColorType>(srcPixmap, allocator); case kRGBA_F16_SkColorType: { @@ -632,12 +636,14 @@ SkLinearBitmapPipeline::SampleProcessorInterface* SkLinearBitmapPipeline::choose PixelAccessor<kN32_SkColorType, kSRGB_SkGammaType>, Blender>; return allocator->make<Sampler>(next, srcPixmap); } +#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE case kIndex_8_SkColorType: { using Sampler = NearestNeighborSampler< PixelAccessor<kIndex_8_SkColorType, kSRGB_SkGammaType>, Blender>; return allocator->make<Sampler>(next, srcPixmap); } +#endif default: break; } @@ -649,12 +655,14 @@ SkLinearBitmapPipeline::SampleProcessorInterface* SkLinearBitmapPipeline::choose PixelAccessor<kN32_SkColorType, kSRGB_SkGammaType>, Blender>; return allocator->make<Sampler>(next, dimensions, xTile, yTile, srcPixmap); } +#ifdef SK_SUPPORT_LEGACY_INDEX_8_COLORTYPE case kIndex_8_SkColorType: { using Sampler = BilerpSampler< PixelAccessor<kIndex_8_SkColorType, kSRGB_SkGammaType>, Blender>; return allocator->make<Sampler>(next, dimensions, xTile, yTile, srcPixmap); } +#endif default: break; } |