Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: e0a42565e3a2879ec1e7c1bc87937dc2d8b779eb https://github.com/WebKit/WebKit/commit/e0a42565e3a2879ec1e7c1bc87937dc2d8b779eb Author: Matt Woodrow <mattwood...@apple.com> Date: 2024-01-22 (Mon, 22 Jan 2024)
Changed paths: M LayoutTests/compositing/repaint/copy-forward-dirty-region-purged-backbuffer.html M Source/WebKit/CMakeLists.txt M Source/WebKit/DerivedSources-input.xcfilelist M Source/WebKit/DerivedSources-output.xcfilelist M Source/WebKit/DerivedSources.make M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in M Source/WebKit/Scripts/webkit/messages.py M Source/WebKit/Shared/RemoteLayerTree/BufferAndBackendInfo.h M Source/WebKit/Shared/RemoteLayerTree/BufferAndBackendInfo.serialization.in M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.h M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.h M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm M Source/WebKit/SourcesCocoa.txt M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm M Source/WebKit/WebKit.xcodeproj/project.pbxproj M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h A Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.messages.in M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm Log Message: ----------- Speedometer 3: WebContent spends a lot of time in RemoteImageBufferProxy::ensureBackendCreated. https://bugs.webkit.org/show_bug.cgi?id=266728 <rdar://117823468> Reviewed by Kimmo Kinnunen. Synchronously waiting on the ImageBufferBackendHandle for an ImageBufferSet can block the main thread while trying to serialize a transaction. This splits the response to prepareImageBufferSetsForDisplay into two parts, one that is only present when needed as a sync reponse, and another as a separate message returned asynchronously. The new response message 'DidPrepareForDisplay' stores the resulting buffer backend handles on the RemoteImageBufferSetProxy and notifies a Condition, so that they can be waited on from a different thread. RemoteLayerTree transaction serialization on the main thread now just serializes an identifier for the image buffer set and doesn't block. The transaction flusher thread waits for any incoming backend handles (as well as the existing wait on drawing flushing), and builds a hashamp of image buffer set identifier to response data and appends this on to the remote layer tree transaction. RemoteLayerTreeDrawingAreaProxy uses the trailing hashmap to copy across any needed backend handles from the response hashmap into the appropriate RemoteLayerBackingStoreProperties. * Source/WebKit/CMakeLists.txt: * Source/WebKit/DerivedSources-input.xcfilelist: * Source/WebKit/DerivedSources-output.xcfilelist: * Source/WebKit/DerivedSources.make: * Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp: (WebKit::RemoteImageBufferSet::ensureBufferForDisplay): * Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h: * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplay): (WebKit::RemoteRenderingBackend::prepareImageBufferSetsForDisplaySync): * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h: (WebKit::RemoteRenderingBackend::identifier): * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in: * Source/WebKit/Scripts/webkit/messages.py: (types_that_must_be_moved): (class_template_headers): (headers_for_type): * Source/WebKit/Shared/RemoteLayerTree/BufferAndBackendInfo.h: * Source/WebKit/Shared/RemoteLayerTree/BufferAndBackendInfo.serialization.in: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::bufferSetIdentifier const): (WebKit::RemoteLayerBackingStoreProperties::bufferSetIdentifier): * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode const): (WebKit::RemoteLayerBackingStore::drawInContext): (WebKit::RemoteLayerBackingStoreProperties::setBackendHandle): (WebKit::RemoteLayerBackingStore::takePendingFlushers): * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::prepareBackingStoresForDisplay): (WebKit::RemoteLayerBackingStoreCollection::didFlushLayers): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeEncoded): Deleted. * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.h: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm: (WebKit::RemoteLayerWithInProcessRenderingBackingStore::createFlusher): (WebKit::RemoteLayerWithInProcessRenderingBackingStore::createFlushers): Deleted. * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.h: * Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm: (WebKit::RemoteLayerWithRemoteRenderingBackingStore::createFlusher): (WebKit::RemoteLayerWithRemoteRenderingBackingStore::bufferSetIdentifier const): (WebKit::RemoteLayerWithRemoteRenderingBackingStore::createFlushers): Deleted. * Source/WebKit/SourcesCocoa.txt: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: * Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp: (WebKit::RemoteImageBufferSetProxyFlushFence::waitFor): (WebKit::RemoteImageBufferSetProxyFlushFence::setHandles): (WebKit::RemoteImageBufferSetProxyFlushFence::takeHandles): (WebKit::RemoteImageBufferSetProxy::didPrepareForDisplay): (WebKit::RemoteImageBufferSetProxy::flushFrontBufferAsync): (WebKit::RemoteImageBufferSetProxy::remoteBufferSetWasDestroyed): * Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.messages.in: Copied from Source/WebKit/Shared/RemoteLayerTree/BufferAndBackendInfo.serialization.in. * Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::didClose): (WebKit::RemoteRenderingBackendProxy::prepareImageBufferSetsForDisplay): (WebKit::RemoteRenderingBackendProxy::didPrepareForDisplay): (WebKit::RemoteRenderingBackendProxy::dispatchMessage): (WebKit::RemoteRenderingBackendProxy::ensurePrepareCompleted): Deleted. * Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updateRendering): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): Canonical link: https://commits.webkit.org/273323@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes