aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-01-25 09:09:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 22:02:20 +0000
commitac568a934f8f82bf3a359b757d67eb3a797d3593 (patch)
tree08b667b597933b0e2baf0af8c5ddac7ec8e63cef /src/shaders
parent1c5906f5623cc6b019281b35ba387f620f13f969 (diff)
1010102, 101010x, 888x in sw
Same sort of deal as before, now with all three new formats. While I was at it, I made sure RGBA 8888 and BGRA 8888 both work too. We don't want the 101010's in lowp, but 888x should be fine. After looking at the DM images on monitors at work, I decided to re-enable dither even on 10-bit images. Looking at the GMs in 888x or 101010x is interesting... I think we must not be clearing the memory allocated for layers? Seems like we want to allocate layers as 8888? Change-Id: I3a85b4f00877792a6425a7e7eb31eacb04ae9218 Reviewed-on: https://skia-review.googlesource.com/101640 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/SkImageShader.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index af3dab92a0..4ca6cd9d8f 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -338,14 +338,22 @@ bool SkImageShader::onAppendStages(const StageRec& rec) const {
case kMirror_TileMode: p->append(SkRasterPipeline::mirror_y, limit_y); break;
case kRepeat_TileMode: p->append(SkRasterPipeline::repeat_y, limit_y); break;
}
+ void* ctx = gather;
switch (info.colorType()) {
- case kAlpha_8_SkColorType: p->append(SkRasterPipeline::gather_a8, gather); break;
- 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 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;
+ case kAlpha_8_SkColorType: p->append(SkRasterPipeline::gather_a8, ctx); break;
+ case kGray_8_SkColorType: p->append(SkRasterPipeline::gather_g8, ctx); break;
+ case kRGB_565_SkColorType: p->append(SkRasterPipeline::gather_565, ctx); break;
+ case kARGB_4444_SkColorType: p->append(SkRasterPipeline::gather_4444, ctx); break;
+ case kBGRA_8888_SkColorType: p->append(SkRasterPipeline::gather_bgra, ctx); break;
+ case kRGBA_8888_SkColorType: p->append(SkRasterPipeline::gather_8888, ctx); break;
+ case kRGBA_1010102_SkColorType: p->append(SkRasterPipeline::gather_1010102, ctx); break;
+ case kRGBA_F16_SkColorType: p->append(SkRasterPipeline::gather_f16, ctx); break;
+
+ case kRGB_888x_SkColorType: p->append(SkRasterPipeline::gather_8888, ctx);
+ p->append(SkRasterPipeline::force_opaque ); break;
+ case kRGB_101010x_SkColorType: p->append(SkRasterPipeline::gather_1010102, ctx);
+ p->append(SkRasterPipeline::force_opaque ); break;
+
default: SkASSERT(false);
}
if (is_srgb) {