Bug 162030 - makeRGBAFromNSColor should use CalibratedRGB
Summary: makeRGBAFromNSColor should use CalibratedRGB
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-15 13:00 PDT by Beth Dakin
Modified: 2016-09-15 13:38 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.25 KB, patch)
2016-09-15 13:03 PDT, Beth Dakin
simon.fraser: review-
Details | Formatted Diff | Diff
Patch (1.20 KB, patch)
2016-09-15 13:12 PDT, Beth Dakin
thorton: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2016-09-15 13:00:27 PDT
makeRGBAFromNSColor should use the NSColor's colorSpace instead of hardcoding NSDeviceRGBColorSpace

rdar://problem/28314183
Comment 1 Beth Dakin 2016-09-15 13:03:01 PDT
Created attachment 288986 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-09-15 13:05:58 PDT
Comment on attachment 288986 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288986&action=review

> Source/WebCore/platform/graphics/mac/ColorMac.mm:60
> -    NSColor *rgbColor = [c colorUsingColorSpaceName:NSDeviceRGBColorSpace];
> +    NSColor *rgbColor = [c colorUsingColorSpaceName:c.colorSpaceName];

This is wrong. This call is explicitly trying to convert from an arbitrary colorspace (e.g. CalibratedGray) to RGB. So it should use CalibratedRGB, not DeviceRGB.
Comment 3 Beth Dakin 2016-09-15 13:12:22 PDT
Created attachment 288988 [details]
Patch
Comment 4 Simon Fraser (smfr) 2016-09-15 13:21:04 PDT
Patch looks correct but I'd love to see a test.
Comment 5 Tim Horton 2016-09-15 13:31:03 PDT
(In reply to comment #4)
> Patch looks correct but I'd love to see a test.

I don't think it is. And I don't think it fixes the problem Beth wants to fix, either.
Comment 6 Beth Dakin 2016-09-15 13:38:02 PDT
I'm going to WONTFIX this for now since getting this right is going to be a much bigger effort to actually keep track of colorspaces.