Title: [275181] trunk
Revision
275181
Author
mmaxfi...@apple.com
Date
2021-03-29 14:53:01 -0700 (Mon, 29 Mar 2021)

Log Message

[GPU Process] Simplify DisplayList::Iterator part 2: Rename setItemBufferClient to setItemBuffer{Writing,Reading}Client
https://bugs.webkit.org/show_bug.cgi?id=223863

Reviewed by Wenson Hsieh.

Source/WebCore:

Currently, we have:
void setItemBufferClient(ItemBufferReadingClient*);
void setItemBufferClient(ItemBufferWritingClient*);

This is unfortunate, because if you want to set one of these clients to nullptr, you have to do:
setItemBufferClient(static_cast<ItemBufferReadingClient*>(nullptr));

Instead, we can just rename these functions to:
void setItemBufferReadingClient(ItemBufferReadingClient*);
void setItemBufferWritingClient(ItemBufferWritingClient*);

So you can just do
setItemBufferReadingClient(nullptr);

No new tests because there is no behavior change.

* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::setItemBufferReadingClient):
(WebCore::DisplayList::DisplayList::setItemBufferWritingClient):
(WebCore::DisplayList::DisplayList::setItemBufferClient): Deleted.
* platform/graphics/displaylists/DisplayList.h:

Source/WebKit:

* GPUProcess/graphics/DisplayListReaderHandle.cpp:
(WebKit::DisplayListReaderHandle::displayListForReading const):
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy):

Tools:

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275180 => 275181)


--- trunk/Source/WebCore/ChangeLog	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebCore/ChangeLog	2021-03-29 21:53:01 UTC (rev 275181)
@@ -1,3 +1,32 @@
+2021-03-29  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [GPU Process] Simplify DisplayList::Iterator part 2: Rename setItemBufferClient to setItemBuffer{Writing,Reading}Client
+        https://bugs.webkit.org/show_bug.cgi?id=223863
+
+        Reviewed by Wenson Hsieh.
+
+        Currently, we have:
+        void setItemBufferClient(ItemBufferReadingClient*);
+        void setItemBufferClient(ItemBufferWritingClient*);
+
+        This is unfortunate, because if you want to set one of these clients to nullptr, you have to do:
+        setItemBufferClient(static_cast<ItemBufferReadingClient*>(nullptr));
+
+        Instead, we can just rename these functions to:
+        void setItemBufferReadingClient(ItemBufferReadingClient*);
+        void setItemBufferWritingClient(ItemBufferWritingClient*);
+
+        So you can just do
+        setItemBufferReadingClient(nullptr);
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/displaylists/DisplayList.cpp:
+        (WebCore::DisplayList::DisplayList::setItemBufferReadingClient):
+        (WebCore::DisplayList::DisplayList::setItemBufferWritingClient):
+        (WebCore::DisplayList::DisplayList::setItemBufferClient): Deleted.
+        * platform/graphics/displaylists/DisplayList.h:
+
 2021-03-29  Eric Carlson  <eric.carl...@apple.com>
 
         [macOS] Playback is paused after scrubbing with the touch bar

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp (275180 => 275181)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2021-03-29 21:53:01 UTC (rev 275181)
@@ -159,12 +159,12 @@
     return *m_items;
 }
 
-void DisplayList::setItemBufferClient(ItemBufferReadingClient* client)
+void DisplayList::setItemBufferReadingClient(ItemBufferReadingClient* client)
 {
     itemBuffer().setClient(client);
 }
 
-void DisplayList::setItemBufferClient(ItemBufferWritingClient* client)
+void DisplayList::setItemBufferWritingClient(ItemBufferWritingClient* client)
 {
     itemBuffer().setClient(client);
 }

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h (275180 => 275181)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h	2021-03-29 21:53:01 UTC (rev 275181)
@@ -77,8 +77,8 @@
     const NativeImageHashMap& nativeImages() const { return m_nativeImages; }
     const FontRenderingResourceMap& fonts() const { return m_fonts; }
 
-    WEBCORE_EXPORT void setItemBufferClient(ItemBufferReadingClient*);
-    WEBCORE_EXPORT void setItemBufferClient(ItemBufferWritingClient*);
+    WEBCORE_EXPORT void setItemBufferReadingClient(ItemBufferReadingClient*);
+    WEBCORE_EXPORT void setItemBufferWritingClient(ItemBufferWritingClient*);
     WEBCORE_EXPORT void prepareToAppend(ItemBufferHandle&&);
 
 #if !defined(NDEBUG) || !LOG_DISABLED

Modified: trunk/Source/WebKit/ChangeLog (275180 => 275181)


--- trunk/Source/WebKit/ChangeLog	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebKit/ChangeLog	2021-03-29 21:53:01 UTC (rev 275181)
@@ -1,3 +1,15 @@
+2021-03-29  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [GPU Process] Simplify DisplayList::Iterator part 2: Rename setItemBufferClient to setItemBuffer{Writing,Reading}Client
+        https://bugs.webkit.org/show_bug.cgi?id=223863
+
+        Reviewed by Wenson Hsieh.
+
+        * GPUProcess/graphics/DisplayListReaderHandle.cpp:
+        (WebKit::DisplayListReaderHandle::displayListForReading const):
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+        (WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy):
+
 2021-03-26  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [GPU Process]: Improve getImageData() perf part 2: Use shared memory and a semaphore

Modified: trunk/Source/WebKit/GPUProcess/graphics/DisplayListReaderHandle.cpp (275180 => 275181)


--- trunk/Source/WebKit/GPUProcess/graphics/DisplayListReaderHandle.cpp	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebKit/GPUProcess/graphics/DisplayListReaderHandle.cpp	2021-03-29 21:53:01 UTC (rev 275181)
@@ -40,7 +40,7 @@
 std::unique_ptr<DisplayList::DisplayList> DisplayListReaderHandle::displayListForReading(size_t offset, size_t capacity, DisplayList::ItemBufferReadingClient& client) const
 {
     auto displayList = makeUnique<DisplayList::DisplayList>(DisplayList::ItemBufferHandles {{ identifier(), data() + offset, capacity }});
-    displayList->setItemBufferClient(&client);
+    displayList->setItemBufferReadingClient(&client);
     return displayList;
 }
 

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


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-03-29 21:53:01 UTC (rev 275181)
@@ -103,7 +103,7 @@
         ASSERT(m_remoteRenderingBackendProxy);
         m_remoteRenderingBackendProxy->remoteResourceCacheProxy().cacheImageBuffer(*this);
 
-        m_drawingContext.displayList().setItemBufferClient(this);
+        m_drawingContext.displayList().setItemBufferWritingClient(this);
         m_drawingContext.displayList().setTracksDrawingItemExtents(false);
     }
 

Modified: trunk/Tools/ChangeLog (275180 => 275181)


--- trunk/Tools/ChangeLog	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Tools/ChangeLog	2021-03-29 21:53:01 UTC (rev 275181)
@@ -1,3 +1,15 @@
+2021-03-29  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [GPU Process] Simplify DisplayList::Iterator part 2: Rename setItemBufferClient to setItemBuffer{Writing,Reading}Client
+        https://bugs.webkit.org/show_bug.cgi?id=223863
+
+        Reviewed by Wenson Hsieh.
+
+        * TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
+        (TestWebKitAPI::TEST):
+
 2021-03-29  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, reverting r275170.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp (275180 => 275181)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp	2021-03-29 21:53:01 UTC (rev 275181)
@@ -212,7 +212,7 @@
 
     DisplayList list;
     StrokePathWriter writer { strokePathItems };
-    list.setItemBufferClient(&writer);
+    list.setItemBufferWritingClient(&writer);
 
     auto path = createComplexPath();
     list.append<SetInlineStrokeColor>(Color::blue);
@@ -222,7 +222,7 @@
 
     DisplayList shallowCopy {{ ItemBufferHandle { globalBufferIdentifier, globalItemBuffer, list.sizeInBytes() } }};
     StrokePathReader reader { strokePathItems };
-    shallowCopy.setItemBufferClient(&reader);
+    shallowCopy.setItemBufferReadingClient(&reader);
 
     Vector<ItemType> itemTypes;
     for (auto [handle, extent, size] : shallowCopy)

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


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp	2021-03-29 21:49:40 UTC (rev 275180)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp	2021-03-29 21:53:01 UTC (rev 275181)
@@ -114,7 +114,7 @@
 
     DisplayList originalList;
     WritingClient writer;
-    originalList.setItemBufferClient(&writer);
+    originalList.setItemBufferWritingClient(&writer);
 
     Path path;
     path.moveTo({ 10., 10. });
@@ -125,7 +125,7 @@
 
     DisplayList shallowCopy {{ ItemBufferHandle { globalBufferIdentifier, globalItemBuffer, originalList.sizeInBytes() } }};
     ReadingClient reader;
-    shallowCopy.setItemBufferClient(&reader);
+    shallowCopy.setItemBufferReadingClient(&reader);
 
     Replayer replayer { context, shallowCopy };
     auto result = replayer.replay();
@@ -145,7 +145,7 @@
 
     DisplayList list;
     ReadingClient reader;
-    list.setItemBufferClient(&reader);
+    list.setItemBufferReadingClient(&reader);
     list.append<FlushContext>(FlushIdentifier { });
 
     Replayer replayer { context, list };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to