Revert "add experimental bilerp_clamp_8888 stage"
This reverts commit a7fa3377d24643d86117159f8a58d2ee66880a4d.
Reason for revert: lots of crashing GPU bots.
Original change's description:
> add experimental bilerp_clamp_8888 stage
>
> It looks like we can specialize hot image shaders into their
> own single stages for a good speedup on both x86 and ARM.
>
> I've started here with bilerp_clamp_8888, and will
> follow up with bgra and 565, and lowp versions of those,
> and probably also the same for nearest neighbors.
>
> All pixels are identical in GMs.
>
> Change-Id: I2f6995767cd38053d670b8d0bfdb71b687803d70
> Reviewed-on: https://skia-review.googlesource.com/82100
> Reviewed-by: Yuqian Li <liyuqian@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,mtklein@google.com,liyuqian@google.com
Change-Id: If70abb91b69bcd781e395dd3ac05ff1eebb1169f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/83340
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index 5c97f1c..fff59c7 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -313,7 +313,7 @@
p->append_matrix(alloc, matrix);
auto gather = alloc->make<SkJumper_GatherCtx>();
- gather->pixels = pm.addr();
+ gather->pixels = pm.writable_addr(); // Don't worry, we won't write to it.
gather->stride = pm.rowBytesAsPixels();
gather->width = pm.width();
gather->height = pm.height();
@@ -325,8 +325,6 @@
limit_y->scale = pm.height();
limit_y->invScale = 1.0f / pm.height();
- bool is_srgb = rec.fDstCS && (!info.colorSpace() || info.gammaCloseToSRGB());
-
auto append_tiling_and_gather = [&] {
switch (fTileModeX) {
case kClamp_TileMode: /* The gather_xxx stage will clamp for us. */ break;
@@ -348,38 +346,11 @@
case kRGBA_F16_SkColorType: p->append(SkRasterPipeline::gather_f16, gather); break;
default: SkASSERT(false);
}
- if (is_srgb) {
+ if (rec.fDstCS && (!info.colorSpace() || info.gammaCloseToSRGB())) {
p->append_from_srgb(info.alphaType());
}
};
- auto append_misc = [&] {
- if (info.colorType() == kAlpha_8_SkColorType) {
- p->append(SkRasterPipeline::set_rgb, &misc->paint_color);
- }
- if (info.colorType() == kAlpha_8_SkColorType ||
- info.alphaType() == kUnpremul_SkAlphaType) {
- p->append(SkRasterPipeline::premul);
- }
- if (quality > kLow_SkFilterQuality) {
- // Bicubic filtering naturally produces out of range values on both sides.
- p->append(SkRasterPipeline::clamp_0);
- p->append(SkRasterPipeline::clamp_a);
- }
- append_gamut_transform(p, alloc, info.colorSpace(), rec.fDstCS, kPremul_SkAlphaType);
- return true;
- };
-
- if (quality == kLow_SkFilterQuality &&
- info.colorType() == kRGBA_8888_SkColorType &&
- fTileModeX == SkShader::kClamp_TileMode &&
- fTileModeY == SkShader::kClamp_TileMode &&
- !is_srgb) {
-
- p->append(SkRasterPipeline::bilerp_clamp_8888, gather);
- return append_misc();
- }
-
SkJumper_SamplerCtx* sampler = nullptr;
if (quality != kNone_SkFilterQuality) {
sampler = alloc->make<SkJumper_SamplerCtx>();
@@ -395,7 +366,6 @@
if (quality == kNone_SkFilterQuality) {
append_tiling_and_gather();
-
} else if (quality == kLow_SkFilterQuality) {
p->append(SkRasterPipeline::save_xy, sampler);
@@ -405,7 +375,6 @@
sample(SkRasterPipeline::bilinear_px, SkRasterPipeline::bilinear_py);
p->append(SkRasterPipeline::move_dst_src);
-
} else {
p->append(SkRasterPipeline::save_xy, sampler);
@@ -432,5 +401,17 @@
p->append(SkRasterPipeline::move_dst_src);
}
- return append_misc();
+ if (info.colorType() == kAlpha_8_SkColorType) {
+ p->append(SkRasterPipeline::set_rgb, &misc->paint_color);
+ }
+ if (info.colorType() == kAlpha_8_SkColorType || info.alphaType() == kUnpremul_SkAlphaType) {
+ p->append(SkRasterPipeline::premul);
+ }
+ if (quality > kLow_SkFilterQuality) {
+ // Bicubic filtering naturally produces out of range values on both sides.
+ p->append(SkRasterPipeline::clamp_0);
+ p->append(SkRasterPipeline::clamp_a);
+ }
+ append_gamut_transform(p, alloc, info.colorSpace(), rec.fDstCS, kPremul_SkAlphaType);
+ return true;
}