From c2d207603edbbd3809d5144fe4a048a2ad774910 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 27 Jun 2017 19:53:21 -0400 Subject: clean up low-hanging swap_rb There are two remaining swap_rb uses that both look non-trivial to replace: - sampling out of index8 when the color table is bgra - table transforms on bgra inputs in SkColorSpaceXform I don't think it's a big deal to just leave swap_rb around, just a little sad. Change-Id: I3d30200cf867cbf37d6f86572b1574d3e22e3490 Reviewed-on: https://skia-review.googlesource.com/21040 Reviewed-by: Mike Reed Commit-Queue: Mike Klein --- tools/picture_utils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/picture_utils.cpp b/tools/picture_utils.cpp index 183e78ec81..93d598ddbd 100644 --- a/tools/picture_utils.cpp +++ b/tools/picture_utils.cpp @@ -89,17 +89,14 @@ namespace sk_tools { SkRasterPipeline_<256> p; switch (bitmap.colorType()) { case kRGBA_F16_SkColorType: p.append(SkRasterPipeline::load_f16, &src); break; - case kRGBA_8888_SkColorType: - case kBGRA_8888_SkColorType: p.append(SkRasterPipeline::load_8888, &src); break; + case kBGRA_8888_SkColorType: p.append(SkRasterPipeline::load_bgra, &src); break; + case kRGBA_8888_SkColorType: p.append(SkRasterPipeline::load_8888, &src); break; case kRGB_565_SkColorType: p.append(SkRasterPipeline::load_565, &src); break; default: SkASSERT(false); // DM doesn't support any other formats, does it? } if (bitmap.info().gammaCloseToSRGB()) { p.append_from_srgb(kUnpremul_SkAlphaType); } - if (bitmap.colorType() == kBGRA_8888_SkColorType) { - p.append(SkRasterPipeline::swap_rb); - } p.append(SkRasterPipeline::unpremul); p.append(SkRasterPipeline::clamp_0); p.append(SkRasterPipeline::clamp_1); -- cgit v1.2.3