diff options
author | Mike Klein <mtklein@chromium.org> | 2017-07-25 12:02:13 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-25 17:42:58 +0000 |
commit | 159db0a6a1001b220b42fcae46ed324e0986b14a (patch) | |
tree | 6888754e4fff820b4b054552e40de3db01e60c2d /src/core/SkRasterPipeline.h | |
parent | 066f020bb6cb9dbb12b977fcddd93982201777fe (diff) |
rough clamped tracking in SkRasterPipeline
This should make srgb_color_filter draw correctly in software.
Previously the Rec2020 block would overflow.
Change-Id: Ied4516728039e54214886d55bba92662beee9a26
Reviewed-on: https://skia-review.googlesource.com/26562
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r-- | src/core/SkRasterPipeline.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index 4e2feb3066..e9cb886e6f 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -138,6 +138,11 @@ public: bool empty() const { return fStages == nullptr; } + // Used to track if we're handling values outside [0.0f, 1.0f], + // and to clamp back to [0.0f, 1.0f] if so. + void set_clamped(bool clamped) { fClamped = clamped; } + void clamp_if_unclamped(SkAlphaType); + private: struct StageList { StageList* prev; @@ -152,6 +157,7 @@ private: StageList* fStages; int fNumStages; int fSlotsNeeded; + bool fClamped; }; template <size_t bytes> |