RESOLVED FIXED 75129
CIFilter version of Sepia Tone filter doesn't match software
https://bugs.webkit.org/show_bug.cgi?id=75129
Summary CIFilter version of Sepia Tone filter doesn't match software
Chris Marrin
Reported 2011-12-22 14:46:04 PST
The formula used to compute sepia in the CIFilter is very different from that in the CSS filters spec, so it needs to change to use a Color Matrix filter to get the formula right.
Attachments
Patch (37.96 KB, patch)
2012-01-10 16:06 PST, Chris Marrin
simon.fraser: review+
simon.fraser: commit-queue-
Radar WebKit Bug Importer
Comment 1 2011-12-22 14:47:09 PST
Chris Marrin
Comment 2 2012-01-10 16:06:47 PST
Simon Fraser (smfr)
Comment 3 2012-01-10 16:10:00 PST
Comment on attachment 121930 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=121930&action=review > Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm:706 > +static double interp(double from, double to, double t) > +{ > + return from * (1 - t) + to * t; > +} This is what WebCore::blend() is for. > Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm:761 > + if (t < 0) > + t = 0; > + else if (t > 1) > + t = 1; Use std::min/max? > Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm:765 > + [caFilter setValue:[CIVector vectorWithX:interp(1, 0.393, t) Y:interp(0, 0.769, t) Z:interp(0, 0.189, t) W:0] forKey:@"inputRVector"]; > + [caFilter setValue:[CIVector vectorWithX:interp(0, 0.349, t) Y:interp(1, 0.686, t) Z:interp(0, 0.168, t) W:0] forKey:@"inputGVector"]; > + [caFilter setValue:[CIVector vectorWithX:interp(0, 0.272, t) Y:interp(0, 0.534, t) Z:interp(1, 0.131, t) W:0] forKey:@"inputBVector"]; Is there a canonical reference for those numeric values? > LayoutTests/ChangeLog:8 > + Updated hw sepia tone results to match changes. Updated sw results because hw -> hardware, or more specifically "Core Image filter on Core Animation layer"
Chris Marrin
Comment 4 2012-01-10 17:07:28 PST
Note You need to log in before you can comment on or make changes to this bug.