diff options
author | 2013-10-10 20:13:51 +0000 | |
---|---|---|
committer | 2013-10-10 20:13:51 +0000 | |
commit | d494b09f554d470fc6411d0924879bbfb0cb0e95 (patch) | |
tree | 94265bef62c686309148e8cf10eaab31fa4a0faa /gm/lumafilter.cpp | |
parent | a7538baeae619a513437f89b60cf738ee2de463d (diff) |
Align SkLumaColorFilter with the spec.
The spec requires the resulting RGB channels for LuminanceToAlpha to be
0 (and not just scaled by the luminance value</facepalm>):
| R' | | 0 0 0 0 0 | | R |
| G' | | 0 0 0 0 0 | | G |
| B' | = | 0 0 0 0 0 | * | B |
| A' | | 0.2125 0.7154 0.0721 0 0 | | A |
| 1 | | 0 0 0 0 1 | | 1 |
(http://www.w3.org/TR/2011/REC-SVG11-20110816/filters.html#feColorMatrixElement)
This doesn't affect luminance masking (which depends only on the
resulting alpha channel), but other color filter users may care
about all color components.
R=bsalomon@google.com, reed@google.com, robertphillips@google.com
Author: fmalita@chromium.org
Review URL: https://codereview.chromium.org/26467003
git-svn-id: http://skia.googlecode.com/svn/trunk@11713 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/lumafilter.cpp')
-rw-r--r-- | gm/lumafilter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp index 69a4f073f0..c12bae0ba5 100644 --- a/gm/lumafilter.cpp +++ b/gm/lumafilter.cpp @@ -34,6 +34,7 @@ static void draw_scene(SkCanvas* canvas, SkColorFilter* filter, c = bounds; c.fRight = bounds.centerX(); + paint.setARGB(0x20, 0, 0, 0xff); canvas->drawRect(bounds, paint); canvas->saveLayer(&bounds, NULL); |