Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e1e984506198419c3141b726ab5b9338103e270e
      
https://github.com/WebKit/WebKit/commit/e1e984506198419c3141b726ab5b9338103e270e
  Author: Carlos Garcia Campos <[email protected]>
  Date:   2026-08-24 (Mon, 24 Aug 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/GraphicsLayer.cpp
    M Source/WebCore/platform/graphics/GraphicsLayer.h
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.cpp
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
    M Source/WebCore/platform/graphics/PlatformLayer.h
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
    M Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp
    M Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h
    M 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferProxy.cpp
    M 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferProxy.h
    M 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp
    M 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebKit/WebProcess/GPU/media/gstreamer/VideoLayerRemoteGStreamer.cpp

  Log Message:
  -----------
  [CoordinatedGraphics] Move ownership of CoordinatedPlatformLayerBufferProxy 
from media player to graphics layer
https://bugs.webkit.org/show_bug.cgi?id=322182

Reviewed by Nikolas Zimmermann.

CoordinatedPlatformLayerBufferProxy is currently defined as the
PlatformLayer for coordinated graphics. That works only because we only
support media platform buffers in GraphicsLayer::setContentsToPlatformLayer().
But CoordinatedPlatformLayerBufferProxy is not really a platform layer,
it's helper class created by the media player and shared with the
GraphicsLayer to be able to send video frames to the compositor. This
patch moves the ownership from the media player to the graphics layer.
For that GraphicsLayer::setContentsToMediaPlayer() has been added, with
a default implementation that just calls setContentsToPlatformLayer(),
but overriden by GraphicsLayerCoordinated to create a new
CoordinatedPlatformLayerBufferProxy if needed and set it to the given
media player. This allows to create the CoordinatedPlatformLayerBufferProxy
with a CoordinatedPlatformLayer. When the newly created proxy is set on
the media player, if there's already a video frame available, it's set
in the proxy as initial buffer that is handled from the main thread
during layer flush. Creating the proxy from GraphicsLayerCoordinated
will also allow us to pass the thread safe gr context to the proxy to
create video buffers using skia promised images too.

* Source/WebCore/platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setContentsToMediaPlayer):
* Source/WebCore/platform/graphics/GraphicsLayer.h:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setPlatformLayerBufferProxy):
(WebCore::MediaPlayer::platformLayerBufferProxy const):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setPlatformLayerBufferProxy):
(WebCore::MediaPlayerPrivateInterface::platformLayerBufferProxy const):
* Source/WebCore/platform/graphics/PlatformLayer.h:
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::setPlatformLayerBufferProxy):
(WebCore::MediaPlayerPrivateGStreamer::platformLayerBufferProxy const):
(WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamer::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamer::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateGStreamer::platformLayer const): Deleted.
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
(WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
(WebCore::MediaPlayerPrivateHolePunch::setPlatformLayerBufferProxy):
(WebCore::MediaPlayerPrivateHolePunch::platformLayerBufferProxy const):
(WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateHolePunch::platformLayer const): Deleted.
* 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferProxy.cpp:
(WebCore::CoordinatedPlatformLayerBufferProxy::create):
(WebCore::CoordinatedPlatformLayerBufferProxy::CoordinatedPlatformLayerBufferProxy):
(WebCore::CoordinatedPlatformLayerBufferProxy::invalidate):
(WebCore::CoordinatedPlatformLayerBufferProxy::setInitialDisplayBuffer):
(WebCore::CoordinatedPlatformLayerBufferProxy::consumePendingBufferIfNeeded):
(WebCore::CoordinatedPlatformLayerBufferProxy::setDisplayBuffer):
(WebCore::CoordinatedPlatformLayerBufferProxy::dropCurrentBufferWhilePreservingTexture):
(WebCore::CoordinatedPlatformLayerBufferProxy::setTargetLayer): Deleted.
* 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayerBufferProxy.h:
* 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.cpp:
(WebCore::GraphicsLayerCoordinated::~GraphicsLayerCoordinated):
(WebCore::GraphicsLayerCoordinated::setContentsToMediaPlayer):
(WebCore::GraphicsLayerCoordinated::setContentsDisplayDelegate):
(WebCore::GraphicsLayerCoordinated::setContentsToPlatformLayer): Deleted.
* 
Source/WebCore/platform/graphics/texmap/coordinated/GraphicsLayerCoordinated.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
* Source/WebCore/platform/graphics/MediaPlayerPrivate.cpp:
(WebCore::MediaPlayerPrivateInterface::setPlatformLayerBufferProxy):
(WebCore::MediaPlayerPrivateInterface::platformLayerBufferProxy const):
* Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
* Source/WebKit/WebProcess/GPU/media/gstreamer/VideoLayerRemoteGStreamer.cpp:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to