diff options
author | Mike Klein <mtklein@chromium.org> | 2017-12-19 14:48:04 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-21 21:28:25 +0000 |
commit | d63b6e4c1ebf574336cea2e4517876ba3dc67002 (patch) | |
tree | 63558466eca20ae1845146337361908be6806c14 /src | |
parent | 4e9a3504aaf84961c53849b4a2c7bc9746f88ab5 (diff) |
Reland "remove bicubic clamp in SkImageShader"
This is a reland of bc9f3499c345ce59f8cd3889c580fa75db54034b
Original change's description:
> remove bicubic clamp in SkImageShader
>
> We ought to be able to handle out-of-gamut colors now, whatever
> their provenance. Should be we can just not clamp here.
>
> Bug: skia:5733
>
> Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f
> Reviewed-on: https://skia-review.googlesource.com/87000
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:5733
Change-Id: I66dafdb12abdb02e8677a6f6b18602a2fa3f5f8b
Reviewed-on: https://skia-review.googlesource.com/88760
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPixmap.cpp | 4 | ||||
-rw-r--r-- | src/shaders/SkImageShader.cpp | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/core/SkPixmap.cpp b/src/core/SkPixmap.cpp index 5648405445..7873a9b8ce 100644 --- a/src/core/SkPixmap.cpp +++ b/src/core/SkPixmap.cpp @@ -251,10 +251,6 @@ bool SkPixmap::scalePixels(const SkPixmap& dst, SkFilterQuality quality) const { // Trick: if src and dst are both unpremul, we can give the correct result if we change both // to premul (or opaque), since the draw will not try to blend or otherwise interpret // the pixels' alpha. - // - // Today this works except in kHigh_SkFilterQuality, where we incorrectly clamp assuming the - // colors are premul. TODO: fix the HQ mode. - // if (srcPtr->alphaType() == kUnpremul_SkAlphaType && dstPtr->alphaType() == kUnpremul_SkAlphaType) { diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp index ef13498ece..331dfb59ca 100644 --- a/src/shaders/SkImageShader.cpp +++ b/src/shaders/SkImageShader.cpp @@ -407,11 +407,13 @@ bool SkImageShader::onAppendStages(const StageRec& rec) const { if (info.colorType() == kAlpha_8_SkColorType || info.alphaType() == kUnpremul_SkAlphaType) { p->append(SkRasterPipeline::premul); } +#if defined(SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP) 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); } +#endif append_gamut_transform(p, alloc, info.colorSpace(), rec.fDstCS, kPremul_SkAlphaType); return true; } |