diff options
author | 2017-06-27 15:56:32 -0400 | |
---|---|---|
committer | 2017-06-27 23:30:23 +0000 | |
commit | 111f8a9eea6980a70a300e3a8bfd758257310fe2 (patch) | |
tree | 36567e9ec09c24762fdc63a45ef10d4ea3828ffa /src/shaders | |
parent | 5ce397205528f82084fc650c2ce27d246c01da33 (diff) |
add bgra as 1st class format
This is a start to eliminating swap_rb as a stage.
I've just hit the main hot spots here. Going to look into
the ~dozen other spots to see how they should work next.
Change-Id: I26fb46a042facf7bd6fff3b47c9fcee86d7142fd
Reviewed-on: https://skia-review.googlesource.com/20982
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/shaders')
-rw-r--r-- | src/shaders/SkImageShader.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp index a19781262c..859bb15250 100644 --- a/src/shaders/SkImageShader.cpp +++ b/src/shaders/SkImageShader.cpp @@ -336,8 +336,8 @@ bool SkImageShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dstCS, SkA case kGray_8_SkColorType: p->append(SkRasterPipeline::gather_g8, gather); break; case kRGB_565_SkColorType: p->append(SkRasterPipeline::gather_565, gather); break; case kARGB_4444_SkColorType: p->append(SkRasterPipeline::gather_4444, gather); break; - case kRGBA_8888_SkColorType: - case kBGRA_8888_SkColorType: p->append(SkRasterPipeline::gather_8888, gather); break; + case kBGRA_8888_SkColorType: p->append(SkRasterPipeline::gather_bgra, gather); break; + case kRGBA_8888_SkColorType: p->append(SkRasterPipeline::gather_8888, gather); break; case kRGBA_F16_SkColorType: p->append(SkRasterPipeline::gather_f16, gather); break; default: SkASSERT(false); } @@ -396,11 +396,7 @@ bool SkImageShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dstCS, SkA p->append(SkRasterPipeline::move_dst_src); } - auto effective_color_type = [](SkColorType ct) { - return ct == kIndex_8_SkColorType ? kN32_SkColorType : ct; - }; - - if (effective_color_type(info.colorType()) == kBGRA_8888_SkColorType) { + if (info.colorType() == kIndex_8_SkColorType && kN32_SkColorType == kBGRA_8888_SkColorType) { p->append(SkRasterPipeline::swap_rb); } if (info.colorType() == kAlpha_8_SkColorType) { |