diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-12 21:37:42 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-12 21:37:42 +0000 |
commit | 2ca677e75d7180db0b468b917f7c625f4e7a1351 (patch) | |
tree | 5d839939b8e32c38d0f535676f9cf099c1923efc /src | |
parent | 641e33b3f6014b193856ba5789b1a0278a92e083 (diff) |
Fix GPU colormatrix color filter with saturated alpha.
Clamp RGBA values before unpremultiplying, to match the raster path. This causes a problem when the resulting
alpha is >1.0, resulting in overly saturated RGB.
Covered by the setYUV2RGB() test case in the colormatrix GM.
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/196133006
git-svn-id: http://skia.googlecode.com/svn/trunk@13778 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkColorMatrixFilter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp index bb85485050..23be874b97 100644 --- a/src/effects/SkColorMatrixFilter.cpp +++ b/src/effects/SkColorMatrixFilter.cpp @@ -424,6 +424,7 @@ public: builder->getUniformCStr(fMatrixHandle), inputColor, builder->getUniformCStr(fVectorHandle)); + builder->fsCodeAppendf("\t%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor); builder->fsCodeAppendf("\t%s.rgb *= %s.a;\n", outputColor, outputColor); } |