Skip to content
Permalink
Browse files
Move DisplayListFlushIdentifier into WebCore as DisplayList::FlushIde…
…ntifier

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

Reviewed by Simon Fraser.

Source/WebCore:

Add DisplayList::FlushIdentifier. See WebKit for more ChangeLogs.

* platform/graphics/displaylists/DisplayList.h:

Source/WebKit:

In preparation for adding a display list item to represent flushing the graphics context, move WebKit's
`DisplayListFlushIdentifier` to the `DisplayList` namespace in WebCore, and rename it to
`DisplayList::FlushIdentifier`.

No change in behavior.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::flushDisplayListWasCommitted):
(WebKit::RemoteRenderingBackend::flushDisplayListAndCommit):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/DisplayListFlushIdentifier.h: Removed.
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::commitFlushDisplayList):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::flushDisplayListAndCommit):
(WebKit::RemoteRenderingBackendProxy::flushDisplayListWasCommitted):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in:


Canonical link: https://commits.webkit.org/231328@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
whsieh committed Nov 6, 2020
1 parent 6ac4c52 commit c1ee082df1f53581f5dc087dad78787c805ada6d
Showing 13 changed files with 59 additions and 58 deletions.
@@ -1,3 +1,14 @@
2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com>

Move DisplayListFlushIdentifier into WebCore as DisplayList::FlushIdentifier
https://bugs.webkit.org/show_bug.cgi?id=218586

Reviewed by Simon Fraser.

Add DisplayList::FlushIdentifier. See WebKit for more ChangeLogs.

* platform/graphics/displaylists/DisplayList.h:

2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com>

Unreviewed, fix the Windows 10 debug build after r269525
@@ -45,6 +45,9 @@ namespace WebCore {

namespace DisplayList {

enum FlushIdentifierType { };
using FlushIdentifier = ObjectIdentifier<FlushIdentifierType>;

enum AsTextFlag {
None = 0,
IncludesPlatformOperations = 1 << 0,
@@ -1,3 +1,32 @@
2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com>

Move DisplayListFlushIdentifier into WebCore as DisplayList::FlushIdentifier
https://bugs.webkit.org/show_bug.cgi?id=218586

Reviewed by Simon Fraser.

In preparation for adding a display list item to represent flushing the graphics context, move WebKit's
`DisplayListFlushIdentifier` to the `DisplayList` namespace in WebCore, and rename it to
`DisplayList::FlushIdentifier`.

No change in behavior.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::flushDisplayListWasCommitted):
(WebKit::RemoteRenderingBackend::flushDisplayListAndCommit):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/graphics/RemoteRenderingBackend.messages.in:
* Scripts/webkit/messages.py:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/DisplayListFlushIdentifier.h: Removed.
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::commitFlushDisplayList):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::flushDisplayListAndCommit):
(WebKit::RemoteRenderingBackendProxy::flushDisplayListWasCommitted):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in:

2020-11-06 Alex Christensen <achristensen@webkit.org>

Fix build after adding files to UIProcess/API/Cocoa
@@ -99,7 +99,7 @@ void RemoteRenderingBackend::imageBufferBackendWasCreated(const FloatSize& logic
send(Messages::RemoteRenderingBackendProxy::ImageBufferBackendWasCreated(logicalSize, backendSize, resolutionScale, colorSpace, WTFMove(handle), renderingResourceIdentifier), m_renderingBackendIdentifier);
}

void RemoteRenderingBackend::flushDisplayListWasCommitted(DisplayListFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
void RemoteRenderingBackend::flushDisplayListWasCommitted(DisplayList::FlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
{
send(Messages::RemoteRenderingBackendProxy::FlushDisplayListWasCommitted(flushIdentifier, renderingResourceIdentifier), m_renderingBackendIdentifier);
}
@@ -159,7 +159,7 @@ void RemoteRenderingBackend::flushDisplayList(const SharedDisplayListHandle& han
applyDisplayList(handle, renderingResourceIdentifier, ShouldFlushContext::No);
}

void RemoteRenderingBackend::flushDisplayListAndCommit(const SharedDisplayListHandle& handle, DisplayListFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
void RemoteRenderingBackend::flushDisplayListAndCommit(const SharedDisplayListHandle& handle, DisplayList::FlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
{
applyDisplayList(handle, renderingResourceIdentifier, ShouldFlushContext::Yes);
flushDisplayListWasCommitted(flushIdentifier, renderingResourceIdentifier);
@@ -28,7 +28,6 @@
#if ENABLE(GPU_PROCESS)

#include "Connection.h"
#include "DisplayListFlushIdentifier.h"
#include "ImageBufferBackendHandle.h"
#include "ImageDataReference.h"
#include "MessageReceiver.h"
@@ -70,7 +69,7 @@ class RemoteRenderingBackend

// Messages to be sent.
void imageBufferBackendWasCreated(const WebCore::FloatSize& logicalSize, const WebCore::IntSize& backendSize, float resolutionScale, WebCore::ColorSpace, ImageBufferBackendHandle, WebCore::RenderingResourceIdentifier);
void flushDisplayListWasCommitted(DisplayListFlushIdentifier, WebCore::RenderingResourceIdentifier);
void flushDisplayListWasCommitted(WebCore::DisplayList::FlushIdentifier, WebCore::RenderingResourceIdentifier);

private:
RemoteRenderingBackend(GPUConnectionToWebProcess&, RenderingBackendIdentifier);
@@ -89,7 +88,7 @@ class RemoteRenderingBackend
// Messages to be received.
void createImageBuffer(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, float resolutionScale, WebCore::ColorSpace, WebCore::RenderingResourceIdentifier);
void flushDisplayList(const SharedDisplayListHandle&, WebCore::RenderingResourceIdentifier);
void flushDisplayListAndCommit(const SharedDisplayListHandle&, DisplayListFlushIdentifier, WebCore::RenderingResourceIdentifier);
void flushDisplayListAndCommit(const SharedDisplayListHandle&, WebCore::DisplayList::FlushIdentifier, WebCore::RenderingResourceIdentifier);
void getImageData(WebCore::AlphaPremultiplication outputFormat, WebCore::IntRect srcRect, WebCore::RenderingResourceIdentifier, CompletionHandler<void(IPC::ImageDataReference&&)>&&);
void releaseRemoteResource(WebCore::RenderingResourceIdentifier);
void didCreateSharedItemData(WebCore::DisplayList::ItemBufferIdentifier, const SharedMemory::IPCHandle&);
@@ -25,7 +25,7 @@
messages -> RemoteRenderingBackend NotRefCounted {
CreateImageBuffer(WebCore::FloatSize logicalSize, WebCore::RenderingMode renderingMode, float resolutionScale, WebCore::ColorSpace colorSpace, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
FlushDisplayList(WebKit::SharedDisplayListHandle displayList, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
FlushDisplayListAndCommit(WebKit::SharedDisplayListHandle displayList, WebKit::DisplayListFlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
FlushDisplayListAndCommit(WebKit::SharedDisplayListHandle displayList, WebCore::DisplayList::FlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
GetImageData(enum:uint8_t WebCore::AlphaPremultiplication outputFormat, WebCore::IntRect srcRect, WebCore::RenderingResourceIdentifier renderingResourceIdentifier) -> (IPC::ImageDataReference imageData) Synchronous
DidCreateSharedItemData(WebCore::DisplayList::ItemBufferIdentifier identifier, WebKit::SharedMemory::IPCHandle handle)
ReleaseRemoteResource(WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
@@ -241,7 +241,7 @@ def types_that_cannot_be_forward_declared():
'WebKit::AudioMediaStreamTrackRendererIdentifier',
'WebKit::ContentWorldIdentifier',
'WebKit::DisplayLinkObserverID',
'WebKit::DisplayListFlushIdentifier',
'WebCore::DisplayList::FlushIdentifier',
'WebKit::DownloadID',
'WebKit::GeolocationIdentifier',
'WebKit::ImageBufferBackendHandle',
@@ -588,6 +588,7 @@ def headers_for_type(type):
'JSC::MessageSource': ['<JavaScriptCore/ConsoleTypes.h>'],
'Inspector::InspectorTargetType': ['<JavaScriptCore/InspectorTarget.h>'],
'Inspector::FrontendChannel::ConnectionType': ['<JavaScriptCore/InspectorFrontendChannel.h>'],
'WebCore::DisplayList::FlushIdentifier': ['<WebCore/DisplayList.h>'],
'WebCore::DisplayList::ItemBufferIdentifier': ['<WebCore/DisplayList.h>'],
'MediaTime': ['<wtf/MediaTime.h>'],
'MonotonicTime': ['<wtf/MonotonicTime.h>'],
@@ -3925,7 +3925,6 @@
550640A424071C2100AAE045 /* RemoteRenderingBackend.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RemoteRenderingBackend.messages.in; sourceTree = "<group>"; };
55AD09422408A02E00DE4D2F /* RemoteImageBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteImageBuffer.h; sourceTree = "<group>"; };
55AD09432408A0E600DE4D2F /* PlatformRemoteImageBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteImageBuffer.h; sourceTree = "<group>"; };
55AD09442408ABB300DE4D2F /* DisplayListFlushIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayListFlushIdentifier.h; sourceTree = "<group>"; };
570AB8F220AE3BD700B8BE87 /* SecKeyProxyStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecKeyProxyStore.h; sourceTree = "<group>"; };
570AB90020B2517400B8BE87 /* AuthenticationChallengeProxyCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AuthenticationChallengeProxyCocoa.mm; sourceTree = "<group>"; };
570AB90320B2541C00B8BE87 /* SecKeyProxyStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SecKeyProxyStore.mm; sourceTree = "<group>"; };
@@ -8171,7 +8170,6 @@
isa = PBXGroup;
children = (
727A7F3324078527004D2931 /* cocoa */,
55AD09442408ABB300DE4D2F /* DisplayListFlushIdentifier.h */,
727A7F39240788F1004D2931 /* ImageBufferBackendHandle.h */,
727A7F37240788F0004D2931 /* ImageBufferShareableBitmapBackend.cpp */,
727A7F36240788F0004D2931 /* ImageBufferShareableBitmapBackend.h */,

This file was deleted.

@@ -69,7 +69,7 @@ class RemoteImageBufferProxy : public WebCore::DisplayList::ImageBuffer<BackendT
m_backend = BackendType::create(logicalSize, backendSize, resolutionScale, colorSpace, WTFMove(handle));
}

void commitFlushDisplayList(DisplayListFlushIdentifier flushIdentifier)
void commitFlushDisplayList(WebCore::DisplayList::FlushIdentifier flushIdentifier)
{
m_receivedFlushIdentifier = flushIdentifier;
}
@@ -288,8 +288,8 @@ class RemoteImageBufferProxy : public WebCore::DisplayList::ImageBuffer<BackendT
flushDrawingContext();
}

DisplayListFlushIdentifier m_sentFlushIdentifier;
DisplayListFlushIdentifier m_receivedFlushIdentifier;
WebCore::DisplayList::FlushIdentifier m_sentFlushIdentifier;
WebCore::DisplayList::FlushIdentifier m_receivedFlushIdentifier;
WeakPtr<RemoteRenderingBackendProxy> m_remoteRenderingBackendProxy;
size_t m_itemCountInCurrentDisplayList { 0 };
};
@@ -121,9 +121,9 @@ void RemoteRenderingBackendProxy::flushDisplayList(const DisplayList::DisplayLis
m_sharedItemBuffers.clear();
}

DisplayListFlushIdentifier RemoteRenderingBackendProxy::flushDisplayListAndCommit(const DisplayList::DisplayList& displayList, RenderingResourceIdentifier renderingResourceIdentifier)
DisplayList::FlushIdentifier RemoteRenderingBackendProxy::flushDisplayListAndCommit(const DisplayList::DisplayList& displayList, RenderingResourceIdentifier renderingResourceIdentifier)
{
DisplayListFlushIdentifier sentFlushIdentifier = DisplayListFlushIdentifier::generate();
auto sentFlushIdentifier = DisplayList::FlushIdentifier::generate();
send(Messages::RemoteRenderingBackend::FlushDisplayListAndCommit({ displayList }, sentFlushIdentifier, renderingResourceIdentifier), m_renderingBackendIdentifier);
m_sharedItemBuffers.clear();
return sentFlushIdentifier;
@@ -147,7 +147,7 @@ void RemoteRenderingBackendProxy::imageBufferBackendWasCreated(const FloatSize&
downcast<UnacceleratedRemoteImageBufferProxy>(*imageBuffer).createBackend(logicalSize, backendSize, resolutionScale, colorSpace, WTFMove(handle));
}

void RemoteRenderingBackendProxy::flushDisplayListWasCommitted(DisplayListFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
void RemoteRenderingBackendProxy::flushDisplayListWasCommitted(DisplayList::FlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
{
auto imageBuffer = m_remoteResourceCacheProxy.cachedImageBuffer(renderingResourceIdentifier);
if (!imageBuffer)
@@ -27,7 +27,6 @@

#if ENABLE(GPU_PROCESS)

#include "DisplayListFlushIdentifier.h"
#include "ImageBufferBackendHandle.h"
#include "MessageReceiver.h"
#include "MessageSender.h"
@@ -74,7 +73,7 @@ class RemoteRenderingBackendProxy
RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, float resolutionScale, WebCore::ColorSpace);
RefPtr<WebCore::ImageData> getImageData(WebCore::AlphaPremultiplication outputFormat, const WebCore::IntRect& srcRect, WebCore::RenderingResourceIdentifier);
void flushDisplayList(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
DisplayListFlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
WebCore::DisplayList::FlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
void releaseRemoteResource(WebCore::RenderingResourceIdentifier);

bool waitForImageBufferBackendWasCreated();
@@ -85,7 +84,7 @@ class RemoteRenderingBackendProxy

// Messages to be received.
void imageBufferBackendWasCreated(const WebCore::FloatSize& logicalSize, const WebCore::IntSize& backendSize, float resolutionScale, WebCore::ColorSpace, ImageBufferBackendHandle, WebCore::RenderingResourceIdentifier);
void flushDisplayListWasCommitted(DisplayListFlushIdentifier, WebCore::RenderingResourceIdentifier);
void flushDisplayListWasCommitted(WebCore::DisplayList::FlushIdentifier, WebCore::RenderingResourceIdentifier);

RemoteResourceCacheProxy m_remoteResourceCacheProxy;
HashMap<WebCore::DisplayList::ItemBufferIdentifier, RefPtr<SharedMemory>> m_sharedItemBuffers;
@@ -24,7 +24,7 @@

messages -> RemoteRenderingBackendProxy NotRefCounted {
ImageBufferBackendWasCreated(WebCore::FloatSize logicalSize, WebCore::IntSize backendSize, float resolutionScale, WebCore::ColorSpace colorSpace, WebKit::ImageBufferBackendHandle handle, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
FlushDisplayListWasCommitted(WebKit::DisplayListFlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
FlushDisplayListWasCommitted(WebCore::DisplayList::FlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
}

#endif // ENABLE(GPU_PROCESS)

0 comments on commit c1ee082

Please sign in to comment.