aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-12-01 17:04:43 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-02 14:14:42 +0000
commit0164896de54748ccbfb7d0181ddc65d00e6f5273 (patch)
tree500901283e937c40a21e6ec26fbaac94df7afa55
parent78b35230aaa2620f826266e3f2385bf06eb881ed (diff)
Clamp colors after gamut xform in Ganesh
Fixes many blatant errors with glnarrow config BUG=skia: Change-Id: I729cda350ebce126bdac4eb41c91f30294e1c61e Reviewed-on: https://skia-review.googlesource.com/5469 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
-rw-r--r--src/gpu/GrColorSpaceXform.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrColorSpaceXform.cpp b/src/gpu/GrColorSpaceXform.cpp
index 525bff9947..cd8dc3340e 100644
--- a/src/gpu/GrColorSpaceXform.cpp
+++ b/src/gpu/GrColorSpaceXform.cpp
@@ -121,5 +121,8 @@ bool GrColorSpaceXform::Equals(const GrColorSpaceXform* a, const GrColorSpaceXfo
GrColor4f GrColorSpaceXform::apply(const GrColor4f& srcColor) {
GrColor4f result;
fSrcToDst.mapScalars(srcColor.fRGBA, result.fRGBA);
+ for (int i = 0; i < 4; ++i) {
+ result.fRGBA[i] = SkTPin(result.fRGBA[i], 0.0f, 1.0f);
+ }
return result;
}