[Webkit-unassigned] [Bug 231163] REGRESSION (iOS 15): Canvas Rendering feature leads to strange resize behaviour

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 15:05:19 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=231163

--- Comment #9 from Cameron McCormack (:heycam) <heycam at apple.com> ---
After adding a bunch of logging, I think the issue is the following.

After the requestAnimationFrame callback is invoked, under RemoteLayerTreeDrawingArea::updateRendering, we draw the canvas ImageBuffer into its layer's ImageBuffer, and then asynchronously schedule a task to flush the layer's ImageBuffer and send the layer transaction to the UI process.  Between the end of updateRendering and this asynchronous task running, the setInterval callback can be invoked, which does some further drawing on the canvas ImageBuffer, and that further drawing then gets captured as part of the layer transaction.

Crucially, even though the drawing of the canvas ImageBuffer on to the layer ImageBuffer is done by creating a CGImage from the canvas ImageBuffer's IOSurface, and such an operation does capture the current state of the pixels in the IOSurface, the actual drawing of the canvas onto the layer is done later (because accelerated drawing is done off a queue that needs to be flushed) and CoreAnimation will actually use the IOSurface that the CGImage was originally created from, and not the captured pixels.

Because the scheduling of the layer transaction flushing / sending is not deterministic, the final IOSurface contents that are drawn may or may not capture the drawing that happens after the requestAnimationFrame (in the tests I've attached, that's the red rect; in the URL in comment 0, that's the canvas clearing operation that happens when the canvas size is assigned to but has the same value.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220105/9a8e291f/attachment.htm>


More information about the webkit-unassigned mailing list