Title: [292360] trunk/Source/WebKit
Revision
292360
Author
simon.fra...@apple.com
Date
2022-04-04 18:41:10 -0700 (Mon, 04 Apr 2022)

Log Message

Remove lots of WebCore:: in RemoteRenderingBackend
https://bugs.webkit.org/show_bug.cgi?id=238763

Reviewed by Wenson Hsieh.

RemoteRenderingBackend already has a `using namespace WebCore` so remove the explicit namespacing.

Also clean up some includes in the header.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::getPixelBufferForImageBuffer):
(WebKit::RemoteRenderingBackend::getPixelBufferForImageBufferWithNewMemory):
(WebKit::RemoteRenderingBackend::putPixelBufferForImageBuffer):
(WebKit::RemoteRenderingBackend::getDataURLForImageBuffer):
(WebKit::RemoteRenderingBackend::getDataURLForImageBufferWithQualifiedIdentifier):
(WebKit::RemoteRenderingBackend::getDataForImageBuffer):
(WebKit::RemoteRenderingBackend::getShareableBitmapForImageBuffer):
(WebKit::RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier):
(WebKit::RemoteRenderingBackend::cacheFont):
(WebKit::handleFromBuffer):
(WebKit::RemoteRenderingBackend::markSurfacesVolatile):
* GPUProcess/graphics/RemoteRenderingBackend.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (292359 => 292360)


--- trunk/Source/WebKit/ChangeLog	2022-04-05 01:33:11 UTC (rev 292359)
+++ trunk/Source/WebKit/ChangeLog	2022-04-05 01:41:10 UTC (rev 292360)
@@ -1,3 +1,28 @@
+2022-04-04  Simon Fraser  <simon.fra...@apple.com>
+
+        Remove lots of WebCore:: in RemoteRenderingBackend
+        https://bugs.webkit.org/show_bug.cgi?id=238763
+
+        Reviewed by Wenson Hsieh.
+
+        RemoteRenderingBackend already has a `using namespace WebCore` so remove the explicit namespacing.
+
+        Also clean up some includes in the header.
+
+        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+        (WebKit::RemoteRenderingBackend::getPixelBufferForImageBuffer):
+        (WebKit::RemoteRenderingBackend::getPixelBufferForImageBufferWithNewMemory):
+        (WebKit::RemoteRenderingBackend::putPixelBufferForImageBuffer):
+        (WebKit::RemoteRenderingBackend::getDataURLForImageBuffer):
+        (WebKit::RemoteRenderingBackend::getDataURLForImageBufferWithQualifiedIdentifier):
+        (WebKit::RemoteRenderingBackend::getDataForImageBuffer):
+        (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBuffer):
+        (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier):
+        (WebKit::RemoteRenderingBackend::cacheFont):
+        (WebKit::handleFromBuffer):
+        (WebKit::RemoteRenderingBackend::markSurfacesVolatile):
+        * GPUProcess/graphics/RemoteRenderingBackend.h:
+
 2022-04-04  Tim Horton  <timothy_hor...@apple.com>
 
         Remove VP8/9 and WebM-related system feature flags

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (292359 => 292360)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-05 01:33:11 UTC (rev 292359)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-05 01:41:10 UTC (rev 292360)
@@ -202,7 +202,7 @@
     updateRenderingResourceRequest();
 }
 
-void RemoteRenderingBackend::getPixelBufferForImageBuffer(RenderingResourceIdentifier imageBuffer, WebCore::PixelBufferFormat&& destinationFormat, WebCore::IntRect&& srcRect, CompletionHandler<void()>&& completionHandler)
+void RemoteRenderingBackend::getPixelBufferForImageBuffer(RenderingResourceIdentifier imageBuffer, PixelBufferFormat&& destinationFormat, IntRect&& srcRect, CompletionHandler<void()>&& completionHandler)
 {
     MESSAGE_CHECK(m_getPixelBufferSharedMemory, "No shared memory for getPixelBufferForImageBuffer");
     QualifiedRenderingResourceIdentifier qualifiedImageBuffer { imageBuffer, m_gpuConnectionToWebProcess->webProcessIdentifier() };
@@ -217,7 +217,7 @@
     completionHandler();
 }
 
-void RemoteRenderingBackend::getPixelBufferForImageBufferWithNewMemory(RenderingResourceIdentifier imageBuffer, SharedMemory::IPCHandle&& handle, WebCore::PixelBufferFormat&& destinationFormat, WebCore::IntRect&& srcRect, CompletionHandler<void()>&& completionHandler)
+void RemoteRenderingBackend::getPixelBufferForImageBufferWithNewMemory(RenderingResourceIdentifier imageBuffer, SharedMemory::IPCHandle&& handle, PixelBufferFormat&& destinationFormat, IntRect&& srcRect, CompletionHandler<void()>&& completionHandler)
 {
     m_getPixelBufferSharedMemory = nullptr;
     auto sharedMemory = WebKit::SharedMemory::map(handle.handle, WebKit::SharedMemory::Protection::ReadWrite);
@@ -232,7 +232,7 @@
     m_getPixelBufferSharedMemory = nullptr;
 }
 
-void RemoteRenderingBackend::putPixelBufferForImageBuffer(WebCore::RenderingResourceIdentifier imageBuffer, WebCore::PixelBuffer&& pixelBuffer, WebCore::IntRect&& srcRect, WebCore::IntPoint&& destPoint, WebCore::AlphaPremultiplication destFormat)
+void RemoteRenderingBackend::putPixelBufferForImageBuffer(RenderingResourceIdentifier imageBuffer, PixelBuffer&& pixelBuffer, IntRect&& srcRect, IntPoint&& destPoint, AlphaPremultiplication destFormat)
 {
     QualifiedRenderingResourceIdentifier qualifiedImageBuffer { imageBuffer, m_gpuConnectionToWebProcess->webProcessIdentifier() };
     if (auto imageBuffer = m_remoteResourceCache.cachedImageBuffer(qualifiedImageBuffer))
@@ -239,7 +239,7 @@
         imageBuffer->putPixelBuffer(pixelBuffer, srcRect, destPoint, destFormat);
 }
 
-void RemoteRenderingBackend::getDataURLForImageBuffer(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution preserveResolution, WebCore::RenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(String&&)>&& completionHandler)
+void RemoteRenderingBackend::getDataURLForImageBuffer(const String& mimeType, std::optional<double> quality, PreserveResolution preserveResolution, RenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(String&&)>&& completionHandler)
 {
     // Immediately turn the RenderingResourceIdentifier (which is error-prone) to a QualifiedRenderingResourceIdentifier,
     // and use a helper function to make sure that don't accidentally use the RenderingResourceIdentifier (because the helper function can't see it).
@@ -246,7 +246,7 @@
     getDataURLForImageBufferWithQualifiedIdentifier(mimeType, quality, preserveResolution, { renderingResourceIdentifier, m_gpuConnectionToWebProcess->webProcessIdentifier() }, WTFMove(completionHandler));
 }
 
-void RemoteRenderingBackend::getDataURLForImageBufferWithQualifiedIdentifier(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution preserveResolution, QualifiedRenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(String&&)>&& completionHandler)
+void RemoteRenderingBackend::getDataURLForImageBufferWithQualifiedIdentifier(const String& mimeType, std::optional<double> quality, PreserveResolution preserveResolution, QualifiedRenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(String&&)>&& completionHandler)
 {
     ASSERT(!RunLoop::isMain());
 
@@ -256,7 +256,7 @@
     completionHandler(WTFMove(urlString));
 }
 
-void RemoteRenderingBackend::getDataForImageBuffer(const String& mimeType, std::optional<double> quality, WebCore::RenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(Vector<uint8_t>&&)>&& completionHandler)
+void RemoteRenderingBackend::getDataForImageBuffer(const String& mimeType, std::optional<double> quality, RenderingResourceIdentifier renderingResourceIdentifier, CompletionHandler<void(Vector<uint8_t>&&)>&& completionHandler)
 {
     // Immediately turn the RenderingResourceIdentifier (which is error-prone) to a QualifiedRenderingResourceIdentifier,
     // and use a helper function to make sure that don't accidentally use the RenderingResourceIdentifier (because the helper function can't see it).
@@ -273,7 +273,7 @@
     completionHandler(WTFMove(data));
 }
 
-void RemoteRenderingBackend::getShareableBitmapForImageBuffer(WebCore::RenderingResourceIdentifier identifier, WebCore::PreserveResolution preserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&& completionHandler)
+void RemoteRenderingBackend::getShareableBitmapForImageBuffer(RenderingResourceIdentifier identifier, PreserveResolution preserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&& completionHandler)
 {
     // Immediately turn the RenderingResourceIdentifier (which is error-prone) to a QualifiedRenderingResourceIdentifier,
     // and use a helper function to make sure that don't accidentally use the RenderingResourceIdentifier (because the helper function can't see it).
@@ -280,7 +280,7 @@
     getShareableBitmapForImageBufferWithQualifiedIdentifier({ identifier, m_gpuConnectionToWebProcess->webProcessIdentifier() }, preserveResolution, WTFMove(completionHandler));
 }
 
-void RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier(QualifiedRenderingResourceIdentifier identifier, WebCore::PreserveResolution preserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&& completionHandler)
+void RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier(QualifiedRenderingResourceIdentifier identifier, PreserveResolution preserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&& completionHandler)
 {
     ASSERT(!RunLoop::isMain());
 
@@ -290,7 +290,7 @@
         if (!imageBuffer)
             return;
         auto backendSize = imageBuffer->backendSize();
-        auto resultSize = preserveResolution == WebCore::PreserveResolution::Yes ? backendSize : imageBuffer->truncatedLogicalSize();
+        auto resultSize = preserveResolution == PreserveResolution::Yes ? backendSize : imageBuffer->truncatedLogicalSize();
         auto bitmap = ShareableBitmap::createShareable(resultSize, { imageBuffer->colorSpace() });
         if (!bitmap)
             return;
@@ -297,7 +297,7 @@
         auto context = bitmap->createGraphicsContext();
         if (!context)
             return;
-        context->drawImageBuffer(*imageBuffer, FloatRect { { }, resultSize }, FloatRect { { }, backendSize }, { WebCore::CompositeOperator::Copy });
+        context->drawImageBuffer(*imageBuffer, FloatRect { { }, resultSize }, FloatRect { { }, backendSize }, { CompositeOperator::Copy });
         bitmap->createHandle(handle);
     }();
     completionHandler(WTFMove(handle));
@@ -352,7 +352,7 @@
     m_remoteResourceCache.cacheNativeImage(*image, nativeImageResourceIdentifier);
 }
 
-void RemoteRenderingBackend::cacheFont(Ref<WebCore::Font>&& font)
+void RemoteRenderingBackend::cacheFont(Ref<Font>&& font)
 {
     // Immediately turn the RenderingResourceIdentifier (which is error-prone) to a QualifiedRenderingResourceIdentifier,
     // and use a helper function to make sure that don't accidentally use the RenderingResourceIdentifier (because the helper function can't see it).
@@ -393,7 +393,7 @@
     updateRenderingResourceRequest();
 }
 
-static std::optional<ImageBufferBackendHandle> handleFromBuffer(WebCore::ImageBuffer& buffer)
+static std::optional<ImageBufferBackendHandle> handleFromBuffer(ImageBuffer& buffer)
 {
     auto* backend = buffer.ensureBackendCreated();
     if (!backend)
@@ -487,7 +487,7 @@
     outputData.displayRequirement = needsFullDisplay ? SwapBuffersDisplayRequirement::NeedsFullDisplay : SwapBuffersDisplayRequirement::NeedsNormalDisplay;
 }
 
-void RemoteRenderingBackend::markSurfacesVolatile(const Vector<WebCore::RenderingResourceIdentifier>& identifiers, CompletionHandler<void(const Vector<WebCore::RenderingResourceIdentifier>& markedVolatileBufferIdentifiers)>&& completionHandler)
+void RemoteRenderingBackend::markSurfacesVolatile(const Vector<RenderingResourceIdentifier>& identifiers, CompletionHandler<void(const Vector<RenderingResourceIdentifier>& markedVolatileBufferIdentifiers)>&& completionHandler)
 {
     LOG_WITH_STREAM(RemoteRenderingBufferVolatility, stream << "GPU Process: RemoteRenderingBackend::markSurfacesVolatile " << identifiers);
 
@@ -496,7 +496,7 @@
         return imageBuffer.setVolatile();
     };
 
-    Vector<WebCore::RenderingResourceIdentifier> markedVolatileBufferIdentifiers;
+    Vector<RenderingResourceIdentifier> markedVolatileBufferIdentifiers;
     for (auto identifier : identifiers) {
         auto imageBuffer = m_remoteResourceCache.cachedImageBuffer({ identifier, m_gpuConnectionToWebProcess->webProcessIdentifier() });
         if (imageBuffer) {

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h (292359 => 292360)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h	2022-04-05 01:33:11 UTC (rev 292359)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h	2022-04-05 01:41:10 UTC (rev 292360)
@@ -42,9 +42,8 @@
 #include "StreamMessageReceiver.h"
 #include "StreamServerConnection.h"
 #include <WebCore/ColorSpace.h>
-#include <WebCore/DisplayList.h>
-#include <WebCore/DisplayListItems.h>
-#include <WebCore/DisplayListReplayer.h>
+#include <WebCore/DisplayListItemBufferIdentifier.h>
+#include <WebCore/MediaPlayerIdentifier.h>
 #include <WebCore/ProcessIdentifier.h>
 #include <WebCore/ProcessIdentity.h>
 #include <wtf/WeakPtr.h>
@@ -53,6 +52,7 @@
 
 class DestinationColorSpace;
 class FloatSize;
+class MediaPlayer;
 class NativeImage;
 
 enum class RenderingMode : bool;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to