Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbd73ab873ddc90f1857c70d2214dedd586ae661
      
https://github.com/WebKit/WebKit/commit/cbd73ab873ddc90f1857c70d2214dedd586ae661
  Author: Matt Woodrow <mattwood...@apple.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    A LayoutTests/fast/canvas/offscreen-toggle-display-expected.html
    A LayoutTests/fast/canvas/offscreen-toggle-display.html
    M Source/WebCore/platform/graphics/GraphicsLayer.cpp
    M Source/WebCore/platform/graphics/GraphicsLayer.h
    M Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h
    M Source/WebCore/platform/graphics/ImageBufferPipe.cpp
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
    M 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.h
    M 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.mm
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm

  Log Message:
  -----------
  Google Photos will not allow preview of editing in Safari.
https://bugs.webkit.org/show_bug.cgi?id=259263
<rdar://107687640>

Reviewed by Dean Jackson.

OffscreenCanvas can asynchronously push frames to the layer associated with the 
HTMLCanvasElement that is being controlled.
This happens using a GraphicsLayerAsyncContentsDisplayDelegate, created by the 
GraphicsLayer for the HTMLCanvasElement.

If style changes that result in the recreation of the GraphicsLayer, the 
OffscreenCanvas continues to push frames to the original
delegate, and they get dropped.

This makes ImageBufferPipe always ask the current GraphicsLayer to make sure we 
have a valid delegate, providing the delegate
that was used last time. If the GraphicsLayer has changed, it can reconfigure 
the delegate to make sure it's targetting the right layer.

We need to reconfigure the delegate, rather than recreating one, since the 
delegate owns the 'current' frame and we need to ensure this
is retained. Otherwise compositing wouldn't have a frame until the next time 
the OffscreenCanvas draws (which could be never).

* LayoutTests/fast/canvas/offscreen-toggle-display-expected.html: Added.
* LayoutTests/fast/canvas/offscreen-toggle-display.html: Added.
* Source/WebCore/platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::createAsyncContentsDisplayDelegate):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
* Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h:
* Source/WebCore/platform/graphics/ImageBufferPipe.cpp:
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::contentsLayerIDForModel const):
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.h:
* 
Source/WebCore/platform/graphics/ca/cocoa/GraphicsLayerAsyncContentsDisplayDelegateCocoa.mm:
(WebCore::GraphicsLayerAsyncContentsDisplayDelegateCocoa::updateGraphicsLayerCA):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.mm:
(WebKit::GraphicsLayerCARemote::createAsyncContentsDisplayDelegate):

Canonical link: https://commits.webkit.org/266120@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to