Bug 225873

Summary: Drawing an sRGB image into a DisplayP3 canvas and then into sRGB canvas yields different results than if you only draw it into the sRGB canvas
Product: WebKit Reporter: Sam Weinig <sam>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED MOVED    
Severity: Normal CC: dino, heycam, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case where both are drawn and tested
none
Test case where only the sRGB canvas is drawn into
none
Visual Test (all three squares should be the same color)
none
Visual Test (all three squares should be the same color)
none
Visual Test (only the sRGB ones) none

Description Sam Weinig 2021-05-17 08:47:29 PDT
Drawing an sRGB image into a DisplayP3 canvas and then into sRGB canvas yields different results than if you only draw it into the sRGB canvas.
Comment 1 Sam Weinig 2021-05-17 08:48:59 PDT
Created attachment 428832 [details]
Test case where both are drawn and tested
Comment 2 Sam Weinig 2021-05-17 08:49:27 PDT
Created attachment 428833 [details]
Test case where only the sRGB canvas is drawn into
Comment 3 Sam Weinig 2021-05-17 08:50:31 PDT
NOTE: This requires ToT WebKit with the CanvasColorSpacesEnabled feature enabled.
Comment 4 Sam Weinig 2021-05-17 08:52:29 PDT
This seems to be related to some cache, as to see the results, you must open a new window for each test case, otherwise, the tests will taint each other.
Comment 5 Sam Weinig 2021-05-17 08:55:14 PDT
It also seems to have to do with canvas accelerated graphics as disabling that (via the Debug -> Drawing and Compositing Flags, etc.) causes the issue to go away.
Comment 6 Sam Weinig 2021-05-17 09:06:26 PDT Comment hidden (obsolete)
Comment 7 Sam Weinig 2021-05-17 14:02:08 PDT
Created attachment 428866 [details]
Visual Test (all three squares should be the same color)
Comment 8 Sam Weinig 2021-05-17 14:03:01 PDT
Updated the visual test case, the getImageData() was not necessary. 

Now to uncover all the different image caches in WebKit to see which one is acting up.
Comment 9 Radar WebKit Bug Importer 2021-05-24 08:48:16 PDT
<rdar://problem/78402035>
Comment 10 Sam Weinig 2021-07-13 09:42:06 PDT
Created attachment 433411 [details]
Visual Test (only the sRGB ones)
Comment 11 Cameron McCormack (:heycam) 2021-08-10 22:20:16 PDT
This is being tracked internally.
Comment 12 Sam Weinig 2021-08-11 10:11:50 PDT
👍