diff options
author | Mike Klein <mtklein@chromium.org> | 2016-12-14 03:35:13 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-14 04:24:08 +0000 |
commit | 2e018f548d76b0688f9873c683cffc681fec40ec (patch) | |
tree | 9e98ad62d7e5f334d3a310a7344d452fdaa40485 /src/core/SkRasterPipeline.cpp | |
parent | 8ba64d1996ba6c9ecfb12132cdab7d5d99af7456 (diff) |
Revert "clamp to premul when reading premul sRGB"
This reverts commit 04e10da8362a0dcabd795a4ad53f617719ca0d20.
Reason for revert: roll?
Change-Id: Id0a8dcd62763bd6eddde120c513ca97e098a4268
Reviewed-on: https://skia-review.googlesource.com/6022
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.cpp')
-rw-r--r-- | src/core/SkRasterPipeline.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp index 00ba81e6f3..4c1dbc762e 100644 --- a/src/core/SkRasterPipeline.cpp +++ b/src/core/SkRasterPipeline.cpp @@ -11,14 +11,6 @@ SkRasterPipeline::SkRasterPipeline() {} void SkRasterPipeline::append(StockStage stage, void* ctx) { -#ifdef SK_DEBUG - switch (stage) { - case from_srgb: - case from_srgb_d: - SkDEBUGFAIL("Please use append_srgb[_d]() instead."); - default: break; - } -#endif fStages.push_back({stage, ctx}); } @@ -50,29 +42,3 @@ void SkRasterPipeline::dump() const { } SkDebugf("\n"); } - -// It's pretty easy to start with sound premultiplied linear floats, pack those -// to sRGB encoded bytes, then read them back to linear floats and find them not -// quite premultiplied, with a color channel just a smidge greater than the alpha -// channel. This can happen basically any time we have different transfer -// functions for alpha and colors... sRGB being the only one we draw into. - -// This is an annoying problem with no known good solution. So apply the clamp hammer. - -void SkRasterPipeline::append_from_srgb(SkAlphaType at) { - //this->append(from_srgb); - fStages.push_back({from_srgb, nullptr}); - - if (at == kPremul_SkAlphaType) { - this->append(SkRasterPipeline::clamp_a); - } -} - -void SkRasterPipeline::append_from_srgb_d(SkAlphaType at) { - //this->append(from_srgb_d); - fStages.push_back({from_srgb_d, nullptr}); - - if (at == kPremul_SkAlphaType) { - this->append(SkRasterPipeline::clamp_a_d); - } -} |