Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1d5da19bdbd9eebb6be7e160959c283fcd39a8fc
      
https://github.com/WebKit/WebKit/commit/1d5da19bdbd9eebb6be7e160959c283fcd39a8fc
  Author: Fujii Hironori <[email protected]>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp
    M 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedSceneState.cpp
    M 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedSceneState.h
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
    M 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostPlayStation.cpp

  Log Message:
  -----------
  CoordinatedPlatformLayer::invalidateTarget should be called before destroyed
https://bugs.webkit.org/show_bug.cgi?id=312775

Reviewed by Carlos Garcia Campos.

If UseSkiaForComposition was enabled and assertions were enabled,
some layout tests were crashing because SkiaCompositingLayer was created in the
compositor thread, but destroyed in the main thread.

If ensureTarget() or ensureSkiaTarget() are called, invalidateTarget() should
be called in the compositor thread before the CoordinatedPlatformLayer is
destroyed.

The main thread adds a new layer while the compositor thread is committing. It
can create a target layer for an uncommitted layer. And, the layer can be
removed before committed. Then, invalidateTarget() wasn't called for it.

Added m_layersToRemove and m_pendingLayersToRemove to CoordinatedSceneState
class to ensure to call invalidateTarget() in the compositor thread.

CoordinatedSceneState::invalidateCommittedLayers() should call
committedLayers() to invalid pending layers.

~LayerTreeHost() should to call ThreadedCompositor::invalidate() before calling
CoordinatedSceneState::invalidate(). ThreadedCompositor::invalidate() calls
CoordinatedSceneState::invalidateCommittedLayers.
CoordinatedSceneState::invalidate() clears m_pendingLayers.

* 
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedPlatformLayer.cpp:
(WebCore::CoordinatedPlatformLayer::~CoordinatedPlatformLayer):
* 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedSceneState.cpp:
(WebKit::CoordinatedSceneState::~CoordinatedSceneState):
(WebKit::CoordinatedSceneState::removeLayer):
(WebKit::CoordinatedSceneState::flush):
(WebKit::CoordinatedSceneState::commitPendingLayers):
(WebKit::CoordinatedSceneState::committedLayers):
(WebKit::CoordinatedSceneState::invalidateCommittedLayers):
(WebKit::CoordinatedSceneState::invalidate):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedSceneState.h:
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::~LayerTreeHost):
* 
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostPlayStation.cpp:
(WebKit::LayerTreeHost::~LayerTreeHost):

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



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

Reply via email to