Bug 230139 - Work around bug 225873 (canvas color space rendering problems) or disable the feature on older OSes
Summary: Work around bug 225873 (canvas color space rendering problems) or disable the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 229021
  Show dependency treegraph
 
Reported: 2021-09-09 17:28 PDT by Cameron McCormack (:heycam)
Modified: 2021-09-16 01:57 PDT (History)
15 users (show)

See Also:


Attachments
Patch (19.19 KB, patch)
2021-09-09 18:24 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (19.43 KB, patch)
2021-09-09 23:53 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch that works around the bug on older OSes (19.96 KB, patch)
2021-09-10 16:03 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Timing test (1.74 KB, text/html)
2021-09-10 18:26 PDT, Cameron McCormack (:heycam)
no flags Details
Patch for EWS that disables the feature on unsupported platforms (47.79 KB, patch)
2021-09-11 16:44 PDT, Cameron McCormack (:heycam)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for EWS that disables the feature on supported platforms (47.51 KB, patch)
2021-09-11 20:54 PDT, Cameron McCormack (:heycam)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch that disables the feature on unsupported platforms (48.03 KB, patch)
2021-09-12 00:14 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (48.26 KB, patch)
2021-09-15 22:49 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-09-09 17:28:11 PDT
We should be able to work around the framework bug on Apple platforms that caused the canvas rendering problems with different color spaces, identified in bug 225873.  The workaround is needed on Big Sur and earlier.
Comment 1 Radar WebKit Bug Importer 2021-09-09 17:34:18 PDT
<rdar://problem/82951700>
Comment 2 Cameron McCormack (:heycam) 2021-09-09 17:34:59 PDT
I ran Motionmark locally with the workaround in place, and didn't get notably different results.
Comment 3 Cameron McCormack (:heycam) 2021-09-09 17:46:55 PDT
<rdar://81828819>
Comment 4 Cameron McCormack (:heycam) 2021-09-09 18:24:54 PDT
Created attachment 437819 [details]
Patch
Comment 5 Cameron McCormack (:heycam) 2021-09-09 23:53:30 PDT
Created attachment 437845 [details]
Patch
Comment 6 Cameron McCormack (:heycam) 2021-09-09 23:54:56 PDT
(In reply to Cameron McCormack (:heycam) from comment #2)
> I ran Motionmark locally with the workaround in place, and didn't get
> notably different results.

That is measuring the overhead of doing the color space check, when we don't need to purge the caches.  I haven't measured how much it can slow things down when repeatedly switching between color spaces.
Comment 7 Cameron McCormack (:heycam) 2021-09-10 16:03:37 PDT
Created attachment 437918 [details]
Patch that works around the bug on older OSes

Mark Windows failure since Display P3 canvas is not available there.
Comment 8 Cameron McCormack (:heycam) 2021-09-10 18:25:25 PDT
(In reply to Cameron McCormack (:heycam) from comment #6)
> I haven't measured how much it can slow things
> down when repeatedly switching between color spaces.

I just tested this.  The overhead of the context flush and cache purge, when it's needed is about 2 ms on my machine.  If drawing operations are done on canvases of alternating color spaces, then this is substantial.  So now I am not sure that we want to do this.
Comment 9 Cameron McCormack (:heycam) 2021-09-10 18:26:56 PDT
Created attachment 437934 [details]
Timing test

This is what I tested with.  Got these results:

(A and B are srgb canvases, C and D are display-p3 canvases)
AAAA: 9 ms
CCCC: 23 ms
ABAB: 20 ms
CDCD: 12 ms
ACAC: 42739 ms
Comment 10 Cameron McCormack (:heycam) 2021-09-11 16:44:05 PDT
Created attachment 437970 [details]
Patch for EWS that disables the feature on unsupported platforms
Comment 11 Cameron McCormack (:heycam) 2021-09-11 20:54:24 PDT
Created attachment 437978 [details]
Patch for EWS that disables the feature on supported platforms
Comment 12 Cameron McCormack (:heycam) 2021-09-12 00:14:02 PDT
Created attachment 437981 [details]
Patch that disables the feature on unsupported platforms
Comment 13 EWS 2021-09-15 21:34:00 PDT
Tools/Scripts/svn-apply failed to apply attachment 437981 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 14 Cameron McCormack (:heycam) 2021-09-15 22:49:48 PDT
Created attachment 438318 [details]
Patch
Comment 15 EWS 2021-09-16 01:57:04 PDT
Committed r282513 (241738@main): <https://commits.webkit.org/241738@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438318 [details].