Title: [283670] trunk
Revision
283670
Author
[email protected]
Date
2021-10-06 15:08:00 -0700 (Wed, 06 Oct 2021)

Log Message

Move FlushIdentifier out of the DisplayList namespace
https://bugs.webkit.org/show_bug.cgi?id=231263

Reviewed by Simon Fraser.

Source/WebCore:

See WebKit/ChangeLog for more details.

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsContextFlushIdentifier.h: Renamed from Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h.
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::didFlush):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::FlushContext::FlushContext):
(WebCore::DisplayList::FlushContext::identifier const):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::flushContext):

Source/WebKit:

In a future patch, I plan to use `DisplayList::FlushIdentifier` in code that is not specific to WebCore display
lists. As such, move this out into a separate header (`GraphicsContextFlushIdentifier.h`), and rename the enum
class accordingly.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::didFlush):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* Scripts/webkit/messages.py:
(types_that_cannot_be_forward_declared):
(headers_for_type):
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::lastSentFlushIdentifier const):
(WebKit::RemoteImageBufferProxy::waitForDidFlushOnSecondaryThread):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::didFlush):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in:

Tools:

* TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283669 => 283670)


--- trunk/Source/WebCore/ChangeLog	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/ChangeLog	2021-10-06 22:08:00 UTC (rev 283670)
@@ -1,3 +1,23 @@
+2021-10-06  Wenson Hsieh  <[email protected]>
+
+        Move FlushIdentifier out of the DisplayList namespace
+        https://bugs.webkit.org/show_bug.cgi?id=231263
+
+        Reviewed by Simon Fraser.
+
+        See WebKit/ChangeLog for more details.
+
+        * Headers.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/GraphicsContextFlushIdentifier.h: Renamed from Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h.
+        * platform/graphics/ImageBuffer.h:
+        (WebCore::ImageBuffer::didFlush):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::FlushContext::FlushContext):
+        (WebCore::DisplayList::FlushContext::identifier const):
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        (WebCore::DisplayList::Recorder::flushContext):
+
 2021-10-06  Chris Dumez  <[email protected]>
 
         Unreviewed build fix for non-unified build.

Modified: trunk/Source/WebCore/Headers.cmake (283669 => 283670)


--- trunk/Source/WebCore/Headers.cmake	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/Headers.cmake	2021-10-06 22:08:00 UTC (rev 283670)
@@ -1291,6 +1291,7 @@
     platform/graphics/GlyphPage.h
     platform/graphics/Gradient.h
     platform/graphics/GraphicsContext.h
+    platform/graphics/GraphicsContextFlushIdentifier.h
     platform/graphics/GraphicsContextGL.h
     platform/graphics/GraphicsContextGLAttributes.h
     platform/graphics/GraphicsLayer.h
@@ -1388,7 +1389,6 @@
 
     platform/graphics/displaylists/DisplayList.h
     platform/graphics/displaylists/DisplayListDrawingContext.h
-    platform/graphics/displaylists/DisplayListFlushIdentifier.h
     platform/graphics/displaylists/DisplayListImageBuffer.h
     platform/graphics/displaylists/DisplayListItemBuffer.h
     platform/graphics/displaylists/DisplayListItemBufferIdentifier.h

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (283669 => 283670)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-10-06 22:08:00 UTC (rev 283670)
@@ -2286,7 +2286,6 @@
 		72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		721B49742512BA3B00FE9D3B /* ImageBitmapBacking.h in Headers */ = {isa = PBXBuildFile; fileRef = 721B49702512AC0400FE9D3B /* ImageBitmapBacking.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		72283F0E230B268C00F5D828 /* ImagePaintingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C18A3F230B04B7006847C7 /* ImagePaintingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		7242AC9725758FE1005A9CF1 /* DisplayListFlushIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 7242AC9525758FE0005A9CF1 /* DisplayListFlushIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
 		724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5386,6 +5385,7 @@
 		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, ); }; };
 		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, ); }; };
 		F440E77A233D94D70063F9AB /* NavigatorClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F440E76F233D94D30063F9AB /* NavigatorClipboard.h */; };
@@ -10481,7 +10481,6 @@
 		721B496F2512AC0400FE9D3B /* ImageBitmapBacking.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBitmapBacking.cpp; sourceTree = "<group>"; };
 		721B49702512AC0400FE9D3B /* ImageBitmapBacking.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageBitmapBacking.h; sourceTree = "<group>"; };
 		722A815C238FD50500C00583 /* AnimationFrameRate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimationFrameRate.h; sourceTree = "<group>"; };
-		7242AC9525758FE0005A9CF1 /* DisplayListFlushIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayListFlushIdentifier.h; sourceTree = "<group>"; };
 		724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; };
 		724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; };
 		724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTBlendMinMax.idl; sourceTree = "<group>"; };
@@ -16775,6 +16774,7 @@
 		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>"; };
 		F42CEB54214031EE002DCA72 /* FontAttributeChangesCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FontAttributeChangesCocoa.mm; sourceTree = "<group>"; };
 		F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPasteboard.h; sourceTree = "<group>"; };
 		F433E9041DBBDBC200EF0D14 /* StaticPasteboard.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaticPasteboard.cpp; sourceTree = "<group>"; };
@@ -18168,7 +18168,6 @@
 				0FE5FBCB1C3DD51E0007A2CA /* DisplayList.h */,
 				55C0A29523FE2CE000F2CB93 /* DisplayListDrawingContext.cpp */,
 				72EA09F923FCCC6A008504A5 /* DisplayListDrawingContext.h */,
-				7242AC9525758FE0005A9CF1 /* DisplayListFlushIdentifier.h */,
 				72EA09F723FCCB3D008504A5 /* DisplayListImageBuffer.h */,
 				F422B8B6253F7065004E77E8 /* DisplayListItemBuffer.cpp */,
 				F422B8B5253F7065004E77E8 /* DisplayListItemBuffer.h */,
@@ -27109,6 +27108,7 @@
 				2D2FC0571460CD6F00263633 /* GradientImage.h */,
 				B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */,
 				B2A015930AF6CD53006BCE0E /* GraphicsContext.h */,
+				F42994F9270CFE480032298B /* GraphicsContextFlushIdentifier.h */,
 				313DE86D23A96966008FC47B /* GraphicsContextGL.cpp */,
 				313DE86F23A96967008FC47B /* GraphicsContextGL.h */,
 				7C330A011DF8FAC600D3395C /* GraphicsContextGLAttributes.h */,
@@ -32308,7 +32308,6 @@
 				7EDAAFC919A2CCDC0034DFD1 /* DiskCacheMonitorCocoa.h in Headers */,
 				0FE5FBD31C3DD51E0007A2CA /* DisplayList.h in Headers */,
 				55AD09402408964000DE4D2F /* DisplayListDrawingContext.h in Headers */,
-				7242AC9725758FE1005A9CF1 /* DisplayListFlushIdentifier.h in Headers */,
 				55AD093E2408963500DE4D2F /* DisplayListImageBuffer.h in Headers */,
 				F4D40BC9255463BF00721349 /* DisplayListItemBuffer.h in Headers */,
 				1CE8D12726185C0E00FC3AEF /* DisplayListItemBufferIdentifier.h in Headers */,
@@ -32704,6 +32703,7 @@
 				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 */,
 				7B45AB5525FBA9DE00FD27F4 /* GraphicsContextGLANGLEEGLUtilities.h in Headers */,
 				7BB34A1725345CB200029D08 /* GraphicsContextGLANGLEUtilities.h in Headers */,

Copied: trunk/Source/WebCore/platform/graphics/GraphicsContextFlushIdentifier.h (from rev 283669, trunk/Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h) (0 => 283670)


--- trunk/Source/WebCore/platform/graphics/GraphicsContextFlushIdentifier.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextFlushIdentifier.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -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 WebCore {
+
+enum GraphicsContextFlushIdentifierType { };
+using GraphicsContextFlushIdentifier = ObjectIdentifier<GraphicsContextFlushIdentifierType>;
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (283669 => 283670)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -27,7 +27,7 @@
 
 #pragma once
 
-#include "DisplayListFlushIdentifier.h"
+#include "GraphicsContextFlushIdentifier.h"
 #include "ImageBufferBackend.h"
 #include "RenderingMode.h"
 #include "RenderingResourceIdentifier.h"
@@ -80,7 +80,7 @@
     virtual bool prefersPreparationForDisplay() { return false; }
     virtual void flushDrawingContext() { }
     virtual void flushDrawingContextAsync() { }
-    virtual void didFlush(DisplayList::FlushIdentifier) { }
+    virtual void didFlush(GraphicsContextFlushIdentifier) { }
 
     virtual void changeDestinationImageBuffer(RenderingResourceIdentifier) { }
     virtual void prepareToAppendDisplayListItems(DisplayList::ItemBufferHandle&&) { }

Deleted: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h (283669 => 283670)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListFlushIdentifier.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2020 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 WebCore {
-
-namespace DisplayList {
-
-enum FlushIdentifierType { };
-using FlushIdentifier = ObjectIdentifier<FlushIdentifierType>;
-
-} // DisplayList
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (283669 => 283670)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "AlphaPremultiplication.h"
-#include "DisplayListFlushIdentifier.h"
 #include "DisplayListItemBufferIdentifier.h"
 #include "DisplayListItemType.h"
 #include "FloatRoundedRect.h"
@@ -34,6 +33,7 @@
 #include "GlyphBuffer.h"
 #include "Gradient.h"
 #include "GraphicsContext.h"
+#include "GraphicsContextFlushIdentifier.h"
 #include "Image.h"
 #include "MediaPlayerIdentifier.h"
 #include "Pattern.h"
@@ -2402,18 +2402,18 @@
     static constexpr bool isInlineItem = true;
     static constexpr bool isDrawingItem = false;
 
-    explicit FlushContext(FlushIdentifier identifier)
+    explicit FlushContext(GraphicsContextFlushIdentifier identifier)
         : m_identifier(identifier)
     {
     }
 
-    FlushIdentifier identifier() const { return m_identifier; }
+    GraphicsContextFlushIdentifier identifier() const { return m_identifier; }
     bool isValid() const { return m_identifier.isValid(); }
 
     void apply(GraphicsContext&) const;
 
 private:
-    FlushIdentifier m_identifier;
+    GraphicsContextFlushIdentifier m_identifier;
 };
 
 // FIXME: This should be refactored so that the command to "switch to the next item buffer"

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (283669 => 283670)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -74,7 +74,7 @@
         virtual RenderingMode renderingMode() const { return RenderingMode::Unaccelerated; }
     };
 
-    void flushContext(FlushIdentifier identifier) { append<FlushContext>(identifier); }
+    void flushContext(GraphicsContextFlushIdentifier identifier) { append<FlushContext>(identifier); }
 
 private:
     Recorder(Recorder& parent, const GraphicsContextState&, const FloatRect& initialClip, const AffineTransform& initialCTM);

Modified: trunk/Source/WebKit/ChangeLog (283669 => 283670)


--- trunk/Source/WebKit/ChangeLog	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/ChangeLog	2021-10-06 22:08:00 UTC (rev 283670)
@@ -1,3 +1,28 @@
+2021-10-06  Wenson Hsieh  <[email protected]>
+
+        Move FlushIdentifier out of the DisplayList namespace
+        https://bugs.webkit.org/show_bug.cgi?id=231263
+
+        Reviewed by Simon Fraser.
+
+        In a future patch, I plan to use `DisplayList::FlushIdentifier` in code that is not specific to WebCore display
+        lists. As such, move this out into a separate header (`GraphicsContextFlushIdentifier.h`), and rename the enum
+        class accordingly.
+
+        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+        (WebKit::RemoteRenderingBackend::didFlush):
+        * GPUProcess/graphics/RemoteRenderingBackend.h:
+        * Scripts/webkit/messages.py:
+        (types_that_cannot_be_forward_declared):
+        (headers_for_type):
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+        (WebKit::RemoteImageBufferProxy::lastSentFlushIdentifier const):
+        (WebKit::RemoteImageBufferProxy::waitForDidFlushOnSecondaryThread):
+        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+        (WebKit::RemoteRenderingBackendProxy::didFlush):
+        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
+        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in:
+
 2021-10-06  Aditya Keerthi  <[email protected]>
 
         Fix watchOS, tvOS, and macCatalyst builds after r283592

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (283669 => 283670)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-10-06 22:08:00 UTC (rev 283670)
@@ -147,7 +147,7 @@
     send(Messages::RemoteRenderingBackendProxy::DidCreateImageBufferBackend(WTFMove(handle), renderingResourceIdentifier), m_renderingBackendIdentifier);
 }
 
-void RemoteRenderingBackend::didFlush(DisplayList::FlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
+void RemoteRenderingBackend::didFlush(GraphicsContextFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
 {
     send(Messages::RemoteRenderingBackendProxy::DidFlush(flushIdentifier, renderingResourceIdentifier), m_renderingBackendIdentifier);
 }

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h (283669 => 283670)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -82,7 +82,7 @@
 
     // Messages to be sent.
     void didCreateImageBufferBackend(ImageBufferBackendHandle, WebCore::RenderingResourceIdentifier);
-    void didFlush(WebCore::DisplayList::FlushIdentifier, WebCore::RenderingResourceIdentifier);
+    void didFlush(WebCore::GraphicsContextFlushIdentifier, WebCore::RenderingResourceIdentifier);
 
     void setNextItemBufferToRead(WebCore::DisplayList::ItemBufferIdentifier, WebCore::RenderingResourceIdentifier destination);
 

Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (283669 => 283670)


--- trunk/Source/WebKit/Scripts/webkit/messages.py	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py	2021-10-06 22:08:00 UTC (rev 283670)
@@ -275,7 +275,6 @@
         'WebCore::DestinationColorSpace',
         'WebCore::DiagnosticLoggingDomain',
         'WebCore::DictationContext',
-        'WebCore::DisplayList::FlushIdentifier',
         'WebCore::DisplayList::ItemBufferIdentifier',
         'WebCore::DocumentIdentifier',
         'WebCore::DocumentOrWorkerIdentifier',
@@ -283,6 +282,7 @@
         'WebCore::FetchIdentifier',
         'WebCore::FileSystemHandleIdentifier',
         'WebCore::FrameIdentifier',
+        'WebCore::GraphicsContextFlushIdentifier',
         'WebCore::GraphicsContextGLAttributes',
         'WebCore::ImageDecoderIdentifier',
         'WebCore::LibWebRTCSocketIdentifier',
@@ -682,7 +682,6 @@
         'Inspector::ExtensionError': ['"InspectorExtensionTypes.h"'],
         'Inspector::FrontendChannel::ConnectionType': ['<_javascript_Core/InspectorFrontendChannel.h>'],
         'Inspector::InspectorTargetType': ['<_javascript_Core/InspectorTarget.h>'],
-        'WebCore::DisplayList::FlushIdentifier': ['<WebCore/DisplayList.h>'],
         'WebCore::DisplayList::ItemBufferIdentifier': ['<WebCore/DisplayList.h>'],
         'MediaTime': ['<wtf/MediaTime.h>'],
         'MonotonicTime': ['<wtf/MonotonicTime.h>'],

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h (283669 => 283670)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -80,9 +80,9 @@
         return m_backend->createImageBufferBackendHandle();
     }
 
-    WebCore::DisplayList::FlushIdentifier lastSentFlushIdentifier() const { return m_sentFlushIdentifier; }
+    WebCore::GraphicsContextFlushIdentifier lastSentFlushIdentifier() const { return m_sentFlushIdentifier; }
 
-    void waitForDidFlushOnSecondaryThread(WebCore::DisplayList::FlushIdentifier targetFlushIdentifier)
+    void waitForDidFlushOnSecondaryThread(WebCore::GraphicsContextFlushIdentifier targetFlushIdentifier)
     {
         ASSERT(!isMainRunLoop());
         Locker locker { m_receivedFlushIdentifierLock };
@@ -119,7 +119,7 @@
         return m_sentFlushIdentifier != m_receivedFlushIdentifier;
     }
 
-    void didFlush(WebCore::DisplayList::FlushIdentifier flushIdentifier) final
+    void didFlush(WebCore::GraphicsContextFlushIdentifier flushIdentifier) final
     {
         ASSERT(isMainRunLoop());
         Locker locker { m_receivedFlushIdentifierLock };
@@ -261,7 +261,7 @@
             return;
 
         if (!m_drawingContext.displayList().isEmpty() || !hasPendingFlush()) {
-            m_sentFlushIdentifier = WebCore::DisplayList::FlushIdentifier::generate();
+            m_sentFlushIdentifier = WebCore::GraphicsContextFlushIdentifier::generate();
             m_drawingContext.recorder().flushContext(m_sentFlushIdentifier);
         }
 
@@ -353,10 +353,10 @@
         return WTF::makeUnique<ThreadSafeRemoteImageBufferFlusher<BackendType>>(*this);
     }
 
-    WebCore::DisplayList::FlushIdentifier m_sentFlushIdentifier;
+    WebCore::GraphicsContextFlushIdentifier m_sentFlushIdentifier;
     Lock m_receivedFlushIdentifierLock;
     Condition m_receivedFlushIdentifierChangedCondition;
-    WebCore::DisplayList::FlushIdentifier m_receivedFlushIdentifier WTF_GUARDED_BY_LOCK(m_receivedFlushIdentifierLock); // Only modified on the main thread but may get queried on a secondary thread.
+    WebCore::GraphicsContextFlushIdentifier 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;
 };
 
@@ -377,7 +377,7 @@
 
 private:
     Ref<RemoteImageBufferProxy<BackendType>> m_imageBuffer;
-    WebCore::DisplayList::FlushIdentifier m_targetFlushIdentifier;
+    WebCore::GraphicsContextFlushIdentifier m_targetFlushIdentifier;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp (283669 => 283670)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp	2021-10-06 22:08:00 UTC (rev 283670)
@@ -281,7 +281,7 @@
         imageBuffer->setBackend(AcceleratedImageBufferShareableBackend::create(imageBuffer->parameters(), WTFMove(handle)));
 }
 
-void RemoteRenderingBackendProxy::didFlush(DisplayList::FlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
+void RemoteRenderingBackendProxy::didFlush(GraphicsContextFlushIdentifier flushIdentifier, RenderingResourceIdentifier renderingResourceIdentifier)
 {
     if (auto imageBuffer = m_remoteResourceCacheProxy.cachedImageBuffer(renderingResourceIdentifier))
         imageBuffer->didFlush(flushIdentifier);

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h (283669 => 283670)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h	2021-10-06 22:08:00 UTC (rev 283670)
@@ -100,7 +100,7 @@
     RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat);
     String getDataURLForImageBuffer(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution, WebCore::RenderingResourceIdentifier);
     Vector<uint8_t> getDataForImageBuffer(const String& mimeType, std::optional<double> quality, WebCore::RenderingResourceIdentifier);
-    WebCore::DisplayList::FlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
+    WebCore::GraphicsContextFlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
     RefPtr<ShareableBitmap> getShareableBitmap(WebCore::RenderingResourceIdentifier, WebCore::PreserveResolution);
     void cacheNativeImage(const ShareableBitmap::Handle&, WebCore::RenderingResourceIdentifier);
     void cacheFont(Ref<WebCore::Font>&&);
@@ -134,7 +134,7 @@
 
     // Messages to be received.
     void didCreateImageBufferBackend(ImageBufferBackendHandle, WebCore::RenderingResourceIdentifier);
-    void didFlush(WebCore::DisplayList::FlushIdentifier, WebCore::RenderingResourceIdentifier);
+    void didFlush(WebCore::GraphicsContextFlushIdentifier, WebCore::RenderingResourceIdentifier);
     void didFinalizeRenderingUpdate(RenderingUpdateID didRenderingUpdateID);
 
     RefPtr<DisplayListWriterHandle> mostRecentlyUsedDisplayListHandle();

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in (283669 => 283670)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in	2021-10-06 22:08:00 UTC (rev 283670)
@@ -24,7 +24,7 @@
 
 messages -> RemoteRenderingBackendProxy NotRefCounted {
     DidCreateImageBufferBackend(WebKit::ImageBufferBackendHandle handle, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
-    DidFlush(WebCore::DisplayList::FlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
+    DidFlush(WebCore::GraphicsContextFlushIdentifier flushIdentifier, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
     DidFinalizeRenderingUpdate(WebKit::RenderingUpdateID didRenderingUpdateID)
 }
 

Modified: trunk/Tools/ChangeLog (283669 => 283670)


--- trunk/Tools/ChangeLog	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Tools/ChangeLog	2021-10-06 22:08:00 UTC (rev 283670)
@@ -1,3 +1,13 @@
+2021-10-06  Wenson Hsieh  <[email protected]>
+
+        Move FlushIdentifier out of the DisplayList namespace
+        https://bugs.webkit.org/show_bug.cgi?id=231263
+
+        Reviewed by Simon Fraser.
+
+        * TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
+        (TestWebKitAPI::TEST):
+
 2021-10-06  Alex Christensen  <[email protected]>
 
         [ iOS15 Release ] TestWebKitAPI.WebSocket.CloseCode

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp (283669 => 283670)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp	2021-10-06 22:03:29 UTC (rev 283669)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp	2021-10-06 22:08:00 UTC (rev 283670)
@@ -147,7 +147,7 @@
     auto cgContext = adoptCF(CGBitmapContextCreate(nullptr, contextWidth, contextHeight, 8, 4 * contextWidth, colorSpace.get(), kCGImageAlphaPremultipliedLast));
     GraphicsContextCG context { cgContext.get() };
 
-    auto runTestWithInvalidIdentifier = [&](FlushIdentifier identifier) {
+    auto runTestWithInvalidIdentifier = [&](GraphicsContextFlushIdentifier identifier) {
         EXPECT_FALSE(identifier.isValid());
 
         DisplayList list;
@@ -163,8 +163,8 @@
         EXPECT_EQ(result.reasonForStopping, StopReplayReason::InvalidItemOrExtent);
     };
 
-    runTestWithInvalidIdentifier(FlushIdentifier { });
-    runTestWithInvalidIdentifier(FlushIdentifier { WTF::HashTableDeletedValue });
+    runTestWithInvalidIdentifier(GraphicsContextFlushIdentifier { });
+    runTestWithInvalidIdentifier(GraphicsContextFlushIdentifier { WTF::HashTableDeletedValue });
 }
 
 } // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to