Skip to content

Commit

Permalink
GraphicsContextFlushIdentifier is defined in wrong layer
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247185
rdar://problem/101674440

Reviewed by Wenson Hsieh.

Move ImageBuffer::didFlush(GraphicsContextFlushIdentifier) to
RemoteImageBufferProxy::didFlush(RemoteDisplayListRecorderFlushIdentifier).

The former is not part of WebCore:ImageBuffer, it's an implementation detail of latter,
RemoteImageBufferProxy.

This is part of work reworking how the RemoteImageBuffer identifiers are shared
between WP and GPUP. This work is part of making it possible for Context2D and
WebGL have faster interop.

* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::flushDrawingContextAsync):
(WebCore::ImageBuffer::didFlush): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::flushContext):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::didFlush):
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h:
* Source/WebKit/Scripts/webkit/messages.py:
(serialized_identifiers):
(types_that_cannot_be_forward_declared):
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::serializedIdentifiers):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/GPU/graphics/DisplayListRecorderFlushIdentifier.h: Copied from Source/WebCore/platform/graphics/GraphicsContextFlushIdentifier.h.
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderFlushIdentifier.h: Renamed from Source/WebCore/platform/graphics/GraphicsContextFlushIdentifier.h.
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::flushContext):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp:
(WebKit::RemoteImageBufferProxy::waitForDidFlushOnSecondaryThread):
(WebKit::RemoteImageBufferProxy::didFlush):
(WebKit::RemoteImageBufferProxy::flushDrawingContextAsync):
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::lastSentFlushIdentifier const):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::didFlush):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in:
* Source/WebKit/WebProcess/GPU/graphics/ThreadSafeRemoteImageBufferFlusher.h:

Canonical link: https://commits.webkit.org/256127@main
  • Loading branch information
kkinnunen-apple committed Oct 29, 2022
1 parent 38ce5b8 commit 411c085
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 35 deletions.
1 change: 0 additions & 1 deletion Source/WebCore/Headers.cmake
Expand Up @@ -1601,7 +1601,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
platform/graphics/GradientColorStop.h
platform/graphics/GradientColorStops.h
platform/graphics/GraphicsContext.h
platform/graphics/GraphicsContextFlushIdentifier.h
platform/graphics/GraphicsContextGL.h
platform/graphics/GraphicsContextGLAttributes.h
platform/graphics/GraphicsContextGLState.h
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Expand Up @@ -5699,7 +5699,6 @@
F40DAAEF25D9F3BF0011B4FA /* PagePasteboardContext.h in Headers */ = {isa = PBXBuildFile; fileRef = F40DAAEE25D9F3BF0011B4FA /* PagePasteboardContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
F420F00A25E47791009251EF /* PointerEventTypeNames.h in Headers */ = {isa = PBXBuildFile; fileRef = F420F00825E47791009251EF /* PointerEventTypeNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
F429261825264D4400007898 /* MediaPlayerIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = F429261725264D4400007898 /* MediaPlayerIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
F42994FA270CFE480032298B /* GraphicsContextFlushIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = F42994F9270CFE480032298B /* GraphicsContextFlushIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
F429950F270E75000032298B /* DisplayListRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = F429950D270E75000032298B /* DisplayListRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; };
F433E9031DBBDBA200EF0D14 /* StaticPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; };
F4377D572551C9C60080ABFE /* DisplayListItemType.h in Headers */ = {isa = PBXBuildFile; fileRef = F4377D552551C9C60080ABFE /* DisplayListItemType.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -18407,7 +18406,6 @@
F422B8B5253F7065004E77E8 /* DisplayListItemBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayListItemBuffer.h; sourceTree = "<group>"; };
F422B8B6253F7065004E77E8 /* DisplayListItemBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayListItemBuffer.cpp; sourceTree = "<group>"; };
F429261725264D4400007898 /* MediaPlayerIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaPlayerIdentifier.h; sourceTree = "<group>"; };
F42994F9270CFE480032298B /* GraphicsContextFlushIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsContextFlushIdentifier.h; sourceTree = "<group>"; };
F429950D270E75000032298B /* DisplayListRecorder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayListRecorder.h; sourceTree = "<group>"; };
F429950E270E75000032298B /* DisplayListRecorder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayListRecorder.cpp; sourceTree = "<group>"; };
F42CEB54214031EE002DCA72 /* FontAttributeChangesCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FontAttributeChangesCocoa.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -29907,7 +29905,6 @@
2D2FC0571460CD6F00263633 /* GradientImage.h */,
B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */,
B2A015930AF6CD53006BCE0E /* GraphicsContext.h */,
F42994F9270CFE480032298B /* GraphicsContextFlushIdentifier.h */,
313DE86D23A96966008FC47B /* GraphicsContextGL.cpp */,
313DE86F23A96967008FC47B /* GraphicsContextGL.h */,
7C330A011DF8FAC600D3395C /* GraphicsContextGLAttributes.h */,
Expand Down Expand Up @@ -35934,7 +35931,6 @@
7BB680BA25BA1BE4002B8738 /* GraphicsChecksMac.h in Headers */,
B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */,
934907E4125BBBC8007F23A0 /* GraphicsContextCG.h in Headers */,
F42994FA270CFE480032298B /* GraphicsContextFlushIdentifier.h in Headers */,
313DE87023A96973008FC47B /* GraphicsContextGL.h in Headers */,
7B95CFED2754FF7C000060CE /* GraphicsContextGLANGLE.h in Headers */,
7C330A021DF8FAC600D3395C /* GraphicsContextGLAttributes.h in Headers */,
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/platform/graphics/ImageBuffer.h
Expand Up @@ -27,7 +27,6 @@

#pragma once

#include "GraphicsContextFlushIdentifier.h"
#include "ImageBufferAllocator.h"
#include "ImageBufferBackend.h"
#include "RenderingMode.h"
Expand Down Expand Up @@ -144,7 +143,6 @@ class ImageBuffer : public ThreadSafeRefCounted<ImageBuffer, WTF::DestructionThr
virtual bool prefersPreparationForDisplay() { return false; }
virtual void flushDrawingContext() { }
virtual bool flushDrawingContextAsync() { return false; }
virtual void didFlush(GraphicsContextFlushIdentifier) { }

WEBCORE_EXPORT IntSize backendSize() const;

Expand Down
Expand Up @@ -553,7 +553,7 @@ void RemoteDisplayListRecorder::applyDeviceScaleFactor(float scaleFactor)
handleItem(DisplayList::ApplyDeviceScaleFactor(scaleFactor));
}

void RemoteDisplayListRecorder::flushContext(GraphicsContextFlushIdentifier identifier)
void RemoteDisplayListRecorder::flushContext(DisplayListRecorderFlushIdentifier identifier)
{
m_imageBuffer->flushContext();
m_renderingBackend->didFlush(identifier, m_imageBufferIdentifier);
Expand Down
Expand Up @@ -28,6 +28,7 @@
#if ENABLE(GPU_PROCESS)

#include "Decoder.h"
#include "DisplayListRecorderFlushIdentifier.h"
#include "QualifiedRenderingResourceIdentifier.h"
#include "RemoteRenderingBackend.h"
#include "StreamMessageReceiver.h"
Expand Down Expand Up @@ -129,7 +130,7 @@ class RemoteDisplayListRecorder : public IPC::StreamMessageReceiver, public CanM
void applyFillPattern();
#endif
void applyDeviceScaleFactor(float);
void flushContext(WebCore::GraphicsContextFlushIdentifier);
void flushContext(DisplayListRecorderFlushIdentifier);

private:
RemoteDisplayListRecorder(WebCore::ImageBuffer&, QualifiedRenderingResourceIdentifier, WebCore::ProcessIdentifier webProcessIdentifier, RemoteRenderingBackend&);
Expand Down
Expand Up @@ -94,7 +94,7 @@ messages -> RemoteDisplayListRecorder NotRefCounted Stream {
ApplyFillPattern()
#endif
ApplyDeviceScaleFactor(float scaleFactor)
FlushContext(WebCore::GraphicsContextFlushIdentifier identifier)
FlushContext(WebKit::DisplayListRecorderFlushIdentifier identifier)
}

#endif // ENABLE(GPU_PROCESS)
Expand Up @@ -163,7 +163,7 @@ void RemoteRenderingBackend::didCreateImageBufferBackend(ImageBufferBackendHandl
send(Messages::RemoteRenderingBackendProxy::DidCreateImageBufferBackend(WTFMove(handle), renderingResourceIdentifier.object()), m_renderingBackendIdentifier);
}

void RemoteRenderingBackend::didFlush(GraphicsContextFlushIdentifier flushIdentifier, QualifiedRenderingResourceIdentifier renderingResourceIdentifier)
void RemoteRenderingBackend::didFlush(DisplayListRecorderFlushIdentifier flushIdentifier, QualifiedRenderingResourceIdentifier renderingResourceIdentifier)
{
MESSAGE_CHECK(renderingResourceIdentifier.processIdentifier() == m_gpuConnectionToWebProcess->webProcessIdentifier(), "Sending didFlush() message to the wrong web process.");
send(Messages::RemoteRenderingBackendProxy::DidFlush(flushIdentifier, renderingResourceIdentifier.object()), m_renderingBackendIdentifier);
Expand Down
3 changes: 2 additions & 1 deletion Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h
Expand Up @@ -28,6 +28,7 @@
#if ENABLE(GPU_PROCESS)

#include "Connection.h"
#include "DisplayListRecorderFlushIdentifier.h"
#include "ImageBufferBackendHandle.h"
#include "MarkSurfacesAsVolatileRequestIdentifier.h"
#include "MessageReceiver.h"
Expand Down Expand Up @@ -83,7 +84,7 @@ class RemoteRenderingBackend : private IPC::MessageSender, public IPC::StreamMes

// Messages to be sent.
void didCreateImageBufferBackend(ImageBufferBackendHandle, QualifiedRenderingResourceIdentifier, RemoteDisplayListRecorder&);
void didFlush(WebCore::GraphicsContextFlushIdentifier, QualifiedRenderingResourceIdentifier);
void didFlush(DisplayListRecorderFlushIdentifier, QualifiedRenderingResourceIdentifier);

// Runs Function in RemoteRenderingBackend task queue.
void dispatch(Function<void()>&&);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/Scripts/webkit/messages.py
Expand Up @@ -258,7 +258,6 @@ def serialized_identifiers():
'WebCore::FetchIdentifier',
'WebCore::FileSystemHandleIdentifier',
'WebCore::FileSystemSyncAccessHandleIdentifier',
'WebCore::GraphicsContextFlushIdentifier',
'WebCore::ImageDecoderIdentifier',
'WebCore::LibWebRTCSocketIdentifier',
'WebCore::MediaKeySystemRequestIdentifier',
Expand Down Expand Up @@ -365,6 +364,7 @@ def types_that_cannot_be_forward_declared():
'WebCore::WebLockIdentifier',
'WebKit::ActivityStateChangeID',
'WebKit::DisplayLinkObserverID',
'WebKit::DisplayListRecorderFlushIdentifier',
'WebKit::DownloadID',
'WebKit::FileSystemStorageError',
'WebKit::ImageBufferBackendHandle',
Expand Down
Expand Up @@ -74,7 +74,6 @@
#include <WebCore/FetchIdentifier.h>
#include <WebCore/FileSystemHandleIdentifier.h>
#include <WebCore/FileSystemSyncAccessHandleIdentifier.h>
#include <WebCore/GraphicsContextFlushIdentifier.h>
#include <WebCore/ImageDecoderIdentifier.h>
#include <WebCore/LibWebRTCSocketIdentifier.h>
#include <WebCore/MediaKeySystemRequestIdentifier.h>
Expand Down Expand Up @@ -375,7 +374,6 @@ Vector<ASCIILiteral> serializedIdentifiers()
static_assert(sizeof(uint64_t) == sizeof(WebCore::FetchIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::FileSystemHandleIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::FileSystemSyncAccessHandleIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::GraphicsContextFlushIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::ImageDecoderIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::LibWebRTCSocketIdentifier));
static_assert(sizeof(uint64_t) == sizeof(WebCore::MediaKeySystemRequestIdentifier));
Expand Down Expand Up @@ -447,7 +445,6 @@ Vector<ASCIILiteral> serializedIdentifiers()
"WebCore::FetchIdentifier"_s,
"WebCore::FileSystemHandleIdentifier"_s,
"WebCore::FileSystemSyncAccessHandleIdentifier"_s,
"WebCore::GraphicsContextFlushIdentifier"_s,
"WebCore::ImageDecoderIdentifier"_s,
"WebCore::LibWebRTCSocketIdentifier"_s,
"WebCore::MediaKeySystemRequestIdentifier"_s,
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Expand Up @@ -5811,6 +5811,7 @@
7AFBD36221E50F39005DBACB /* WebResourceLoadStatisticsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceLoadStatisticsStore.h; path = Classifier/WebResourceLoadStatisticsStore.h; sourceTree = "<group>"; };
7AFBD36D21E546E3005DBACB /* PersistencyUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersistencyUtils.h; sourceTree = "<group>"; };
7AFBD36E21E546E3005DBACB /* PersistencyUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PersistencyUtils.cpp; sourceTree = "<group>"; };
7B0DF7DC29090ACA001C2701 /* DisplayListRecorderFlushIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayListRecorderFlushIdentifier.h; sourceTree = "<group>"; };
7B16191227198AA900C40EAC /* RemoteGraphicsContextGLProxyCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteGraphicsContextGLProxyCocoa.mm; sourceTree = "<group>"; };
7B1DB26525668CE0000E26BC /* ArrayReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayReference.h; sourceTree = "<group>"; };
7B2DDD5E27CCD9710060ABAB /* IPCStreamTesterProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPCStreamTesterProxy.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -11091,6 +11092,7 @@
727A7F3324078527004D2931 /* cocoa */,
1CB7461927436DE300F19874 /* WebGPU */,
0F86361B27BDC2B6006E6D52 /* BufferIdentifierSet.h */,
7B0DF7DC29090ACA001C2701 /* DisplayListRecorderFlushIdentifier.h */,
7B64C0B6254C5C250006B4AF /* GraphicsContextGLIdentifier.h */,
727A7F39240788F1004D2931 /* ImageBufferBackendHandle.h */,
0FA7467E27BB611800B5FF5A /* ImageBufferBackendHandleSharing.h */,
Expand Down
Expand Up @@ -27,9 +27,9 @@

#include <wtf/ObjectIdentifier.h>

namespace WebCore {
namespace WebKit {

enum GraphicsContextFlushIdentifierType { };
using GraphicsContextFlushIdentifier = ObjectIdentifier<GraphicsContextFlushIdentifierType>;
enum DisplayListRecorderFlushIdentifierType { };
using DisplayListRecorderFlushIdentifier = ObjectIdentifier<DisplayListRecorderFlushIdentifierType>;

} // namespace WebCore
}
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include <wtf/ObjectIdentifier.h>

namespace WebKit {

enum DisplayListRecorderFlushIdentifierType { };
using DisplayListRecorderFlushIdentifier = ObjectIdentifier<DisplayListRecorderFlushIdentifierType>;

}
Expand Up @@ -467,7 +467,7 @@ bool RemoteDisplayListRecorderProxy::recordResourceUse(DecomposedGlyphs& decompo
return true;
}

void RemoteDisplayListRecorderProxy::flushContext(GraphicsContextFlushIdentifier identifier)
void RemoteDisplayListRecorderProxy::flushContext(DisplayListRecorderFlushIdentifier identifier)
{
send(Messages::RemoteDisplayListRecorder::FlushContext(identifier));
}
Expand Down
Expand Up @@ -27,6 +27,7 @@

#if ENABLE(GPU_PROCESS)

#include "DisplayListRecorderFlushIdentifier.h"
#include <WebCore/DisplayListRecorder.h>
#include <WebCore/DrawGlyphsRecorder.h>
#include <WebCore/GraphicsContext.h>
Expand All @@ -44,7 +45,7 @@ class RemoteDisplayListRecorderProxy : public WebCore::DisplayList::Recorder {

void convertToLuminanceMask() final;
void transformToColorSpace(const WebCore::DestinationColorSpace&) final;
void flushContext(WebCore::GraphicsContextFlushIdentifier);
void flushContext(DisplayListRecorderFlushIdentifier);

private:
template<typename T> void send(T&& message);
Expand Down
Expand Up @@ -57,7 +57,7 @@ RemoteImageBufferProxy::~RemoteImageBufferProxy()
m_remoteRenderingBackendProxy->remoteResourceCacheProxy().releaseImageBuffer(*this);
}

void RemoteImageBufferProxy::waitForDidFlushOnSecondaryThread(GraphicsContextFlushIdentifier targetFlushIdentifier)
void RemoteImageBufferProxy::waitForDidFlushOnSecondaryThread(DisplayListRecorderFlushIdentifier targetFlushIdentifier)
{
ASSERT(!isMainRunLoop());
Locker locker { m_receivedFlushIdentifierLock };
Expand All @@ -79,7 +79,7 @@ bool RemoteImageBufferProxy::hasPendingFlush() const
return m_sentFlushIdentifier != m_receivedFlushIdentifier;
}

void RemoteImageBufferProxy::didFlush(GraphicsContextFlushIdentifier flushIdentifier)
void RemoteImageBufferProxy::didFlush(DisplayListRecorderFlushIdentifier flushIdentifier)
{
ASSERT(isMainRunLoop());
Locker locker { m_receivedFlushIdentifierLock };
Expand Down Expand Up @@ -286,7 +286,7 @@ bool RemoteImageBufferProxy::flushDrawingContextAsync()
if (!m_needsFlush)
return hasPendingFlush();

m_sentFlushIdentifier = GraphicsContextFlushIdentifier::generate();
m_sentFlushIdentifier = DisplayListRecorderFlushIdentifier::generate();
LOG_WITH_STREAM(SharedDisplayLists, stream << "RemoteImageBufferProxy " << m_renderingResourceIdentifier << " flushDrawingContextAsync - flush " << m_sentFlushIdentifier);
m_remoteDisplayList.flushContext(m_sentFlushIdentifier);
m_needsFlush = false;
Expand Down
10 changes: 5 additions & 5 deletions Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h
Expand Up @@ -51,12 +51,12 @@ class RemoteImageBufferProxy : public WebCore::ImageBuffer {

~RemoteImageBufferProxy();

WebCore::GraphicsContextFlushIdentifier lastSentFlushIdentifier() const { return m_sentFlushIdentifier; }
DisplayListRecorderFlushIdentifier lastSentFlushIdentifier() const { return m_sentFlushIdentifier; }

void waitForDidFlushOnSecondaryThread(WebCore::GraphicsContextFlushIdentifier);
void waitForDidFlushOnSecondaryThread(DisplayListRecorderFlushIdentifier);

WebCore::ImageBufferBackend* ensureBackendCreated() const final;
void didFlush(WebCore::GraphicsContextFlushIdentifier) final;
void didFlush(DisplayListRecorderFlushIdentifier);

void clearBackend();
void backingStoreWillChange();
Expand Down Expand Up @@ -96,10 +96,10 @@ class RemoteImageBufferProxy : public WebCore::ImageBuffer {
std::unique_ptr<WebCore::ThreadSafeImageBufferFlusher> createFlusher() final;
void prepareForBackingStoreChange();

WebCore::GraphicsContextFlushIdentifier m_sentFlushIdentifier;
DisplayListRecorderFlushIdentifier m_sentFlushIdentifier;
Lock m_receivedFlushIdentifierLock;
Condition m_receivedFlushIdentifierChangedCondition;
WebCore::GraphicsContextFlushIdentifier m_receivedFlushIdentifier WTF_GUARDED_BY_LOCK(m_receivedFlushIdentifierLock); // Only modified on the main thread but may get queried on a secondary thread.
DisplayListRecorderFlushIdentifier m_receivedFlushIdentifier WTF_GUARDED_BY_LOCK(m_receivedFlushIdentifierLock); // Only modified on the main thread but may get queried on a secondary thread.
WeakPtr<RemoteRenderingBackendProxy> m_remoteRenderingBackendProxy;
RemoteDisplayListRecorderProxy m_remoteDisplayList;
bool m_needsFlush { false };
Expand Down
Expand Up @@ -400,7 +400,7 @@ void RemoteRenderingBackendProxy::didCreateImageBufferBackend(ImageBufferBackend
imageBuffer->didCreateImageBufferBackend(WTFMove(handle));
}

void RemoteRenderingBackendProxy::didFlush(GraphicsContextFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
void RemoteRenderingBackendProxy::didFlush(DisplayListRecorderFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
{
if (auto imageBuffer = m_remoteResourceCacheProxy.cachedImageBuffer(renderingResourceIdentifier))
imageBuffer->didFlush(flushIdentifier);
Expand Down
Expand Up @@ -173,7 +173,7 @@ class RemoteRenderingBackendProxy

// Messages to be received.
void didCreateImageBufferBackend(ImageBufferBackendHandle&&, WebCore::RenderingResourceIdentifier);
void didFlush(WebCore::GraphicsContextFlushIdentifier, WebCore::RenderingResourceIdentifier);
void didFlush(DisplayListRecorderFlushIdentifier, WebCore::RenderingResourceIdentifier);
void didFinalizeRenderingUpdate(RenderingUpdateID didRenderingUpdateID);
void didMarkLayersAsVolatile(MarkSurfacesAsVolatileRequestIdentifier, const Vector<WebCore::RenderingResourceIdentifier>& markedVolatileBufferIdentifiers, bool didMarkAllLayerAsVolatile);

Expand Down
Expand Up @@ -24,7 +24,7 @@

messages -> RemoteRenderingBackendProxy NotRefCounted {
DidCreateImageBufferBackend(WebKit::ImageBufferBackendHandle handle, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
DidFlush(WebCore::GraphicsContextFlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
DidFlush(WebKit::DisplayListRecorderFlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
DidFinalizeRenderingUpdate(WebKit::RenderingUpdateID didRenderingUpdateID)
DidInitialize(IPC::Semaphore wakeUpSemaphore, IPC::Semaphore clientWaitSemaphore)
DidMarkLayersAsVolatile(WebKit::MarkSurfacesAsVolatileRequestIdentifier requestIdentifier, Vector<WebCore::RenderingResourceIdentifier> markedVolatileBufferIdentifiers, bool didMarkAllLayersAsVolatile)
Expand Down

0 comments on commit 411c085

Please sign in to comment.