Bug 225873 - 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
Summary: Drawing an sRGB image into a DisplayP3 canvas and then into sRGB canvas yield...
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-17 08:47 PDT by Sam Weinig
Modified: 2021-08-11 10:11 PDT (History)
4 users (show)

See Also:


Attachments
Test case where both are drawn and tested (2.44 KB, text/html)
2021-05-17 08:48 PDT, Sam Weinig
no flags Details
Test case where only the sRGB canvas is drawn into (2.45 KB, text/html)
2021-05-17 08:49 PDT, Sam Weinig
no flags Details
Visual Test (all three squares should be the same color) (2.23 KB, text/html)
2021-05-17 09:06 PDT, Sam Weinig
no flags Details
Visual Test (all three squares should be the same color) (2.16 KB, text/html)
2021-05-17 14:02 PDT, Sam Weinig
no flags Details
Visual Test (only the sRGB ones) (2.16 KB, text/html)
2021-07-13 09:42 PDT, Sam Weinig
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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
👍