Title: [288240] trunk/Source
Revision
288240
Author
[email protected]
Date
2022-01-19 13:38:24 -0800 (Wed, 19 Jan 2022)

Log Message

[GPU Process] ImageBuffer::convertToLuminanceMask() and transformToColorSpace() should not access the backend in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=235305
rdar://83437815

Reviewed by Sam Weinig.

Source/WebCore:

When DOM rendering is handled in GPU Process, no backend access will be
allowed. So all the operations that require access to the backend should
be handled in GPU Process. The WebProcess will stream messages for these
operations to GPUProcess.

* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/displaylists/DisplayListRecorderImpl.h:

Source/WebKit:

* GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::convertToLuminanceMask):
(WebKit::RemoteDisplayListRecorder::transformToColorSpace):
* GPUProcess/graphics/RemoteDisplayListRecorder.h:
* GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
* WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::convertToLuminanceMask):
(WebKit::RemoteDisplayListRecorderProxy::transformToColorSpace):
* WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288239 => 288240)


--- trunk/Source/WebCore/ChangeLog	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebCore/ChangeLog	2022-01-19 21:38:24 UTC (rev 288240)
@@ -1,3 +1,19 @@
+2022-01-19  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] ImageBuffer::convertToLuminanceMask() and transformToColorSpace() should not access the backend in WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=235305
+        rdar://83437815
+
+        Reviewed by Sam Weinig.
+
+        When DOM rendering is handled in GPU Process, no backend access will be 
+        allowed. So all the operations that require access to the backend should
+        be handled in GPU Process. The WebProcess will stream messages for these
+        operations to GPUProcess.
+
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        * platform/graphics/displaylists/DisplayListRecorderImpl.h:
+
 2022-01-19  Yusuke Suzuki  <[email protected]>
 
         Do not use pas utils outside of libpas

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


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2022-01-19 21:38:24 UTC (rev 288240)
@@ -60,6 +60,8 @@
 
     virtual void getPixelBuffer(const PixelBufferFormat& outputFormat, const IntRect& sourceRect) = 0;
     virtual void putPixelBuffer(const PixelBuffer&, const IntRect& srcRect, const IntPoint& destPoint, AlphaPremultiplication destFormat) = 0;
+    virtual void convertToLuminanceMask() = 0;
+    virtual void transformToColorSpace(const DestinationColorSpace&) = 0;
     virtual void flushContext(GraphicsContextFlushIdentifier) = 0;
 
 protected:

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h (288239 => 288240)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h	2022-01-19 21:38:24 UTC (rev 288240)
@@ -54,8 +54,10 @@
         virtual RenderingMode renderingMode() const { return RenderingMode::Unaccelerated; }
     };
 
-    WEBCORE_EXPORT void getPixelBuffer(const PixelBufferFormat& outputFormat, const IntRect& sourceRect) final;
-    WEBCORE_EXPORT void putPixelBuffer(const PixelBuffer&, const IntRect& srcRect, const IntPoint& destPoint, AlphaPremultiplication destFormat) final;
+    void getPixelBuffer(const PixelBufferFormat& outputFormat, const IntRect& sourceRect) final;
+    void putPixelBuffer(const PixelBuffer&, const IntRect& srcRect, const IntPoint& destPoint, AlphaPremultiplication destFormat) final;
+    void convertToLuminanceMask() final { }
+    void transformToColorSpace(const DestinationColorSpace&) final { }
     void flushContext(GraphicsContextFlushIdentifier identifier) final { append<FlushContext>(identifier); }
 
 private:

Modified: trunk/Source/WebKit/ChangeLog (288239 => 288240)


--- trunk/Source/WebKit/ChangeLog	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/ChangeLog	2022-01-19 21:38:24 UTC (rev 288240)
@@ -1,3 +1,22 @@
+2022-01-19  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] ImageBuffer::convertToLuminanceMask() and transformToColorSpace() should not access the backend in WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=235305
+        rdar://83437815
+
+        Reviewed by Sam Weinig.
+
+        * GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
+        (WebKit::RemoteDisplayListRecorder::convertToLuminanceMask):
+        (WebKit::RemoteDisplayListRecorder::transformToColorSpace):
+        * GPUProcess/graphics/RemoteDisplayListRecorder.h:
+        * GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
+        * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
+        (WebKit::RemoteDisplayListRecorderProxy::convertToLuminanceMask):
+        (WebKit::RemoteDisplayListRecorderProxy::transformToColorSpace):
+        * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+
 2022-01-19  Chris Dumez  <[email protected]>
 
         WebsiteDataStore.cpp uses switch statements for WebKit::ProcessAccessType enum that fall through ASSERT_NOT_REACHED()

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp (288239 => 288240)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp	2022-01-19 21:38:24 UTC (rev 288240)
@@ -459,6 +459,16 @@
     m_imageBuffer->putPixelBuffer(pixelBuffer, srcRect, destPoint, destFormat);
 }
 
+void RemoteDisplayListRecorder::convertToLuminanceMask()
+{
+    m_imageBuffer->convertToLuminanceMask();
+}
+
+void RemoteDisplayListRecorder::transformToColorSpace(const WebCore::DestinationColorSpace& colorSpace)
+{
+    m_imageBuffer->transformToColorSpace(colorSpace);
+}
+
 void RemoteDisplayListRecorder::paintFrameForMedia(MediaPlayerIdentifier identifier, const FloatRect& destination)
 {
     m_renderingBackend->performWithMediaPlayerOnMainThread(identifier, [imageBuffer = RefPtr { m_imageBuffer.get() }, destination](MediaPlayer& player) {

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h (288239 => 288240)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h	2022-01-19 21:38:24 UTC (rev 288240)
@@ -111,6 +111,8 @@
     void fillEllipse(const WebCore::FloatRect&);
     void getPixelBuffer(const WebCore::IntRect& srcRect, const WebCore::PixelBufferFormat& outputFormat);
     void putPixelBuffer(const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint, const WebCore::PixelBuffer&, WebCore::AlphaPremultiplication destFormat);
+    void convertToLuminanceMask();
+    void transformToColorSpace(const WebCore::DestinationColorSpace&);
     void paintFrameForMedia(WebCore::MediaPlayerIdentifier, const WebCore::FloatRect& destination);
     void strokeRect(const WebCore::FloatRect&, float lineWidth);
 #if ENABLE(INLINE_PATH_DATA)

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in (288239 => 288240)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in	2022-01-19 21:38:24 UTC (rev 288240)
@@ -77,6 +77,8 @@
     FillEllipse(WebCore::FloatRect rect)
     GetPixelBuffer(WebCore::IntRect srcRect, struct WebCore::PixelBufferFormat outputFormat)
     PutPixelBuffer(WebCore::IntRect srcRect, WebCore::IntPoint destPoint, WebCore::PixelBuffer pixelBuffer, enum:uint8_t WebCore::AlphaPremultiplication destFormat)
+    ConvertToLuminanceMask()
+    TransformToColorSpace(WebCore::DestinationColorSpace colorSpace)
     PaintFrameForMedia(WebCore::MediaPlayerIdentifier identifier, WebCore::FloatRect destination)
     StrokeRect(WebCore::FloatRect rect, float lineWidth)
 #if ENABLE(INLINE_PATH_DATA)

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp (288239 => 288240)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp	2022-01-19 21:38:24 UTC (rev 288240)
@@ -70,6 +70,16 @@
     send(Messages::RemoteDisplayListRecorder::PutPixelBuffer(srcRect, destPoint, pixelBuffer, destFormat));
 }
 
+void RemoteDisplayListRecorderProxy::convertToLuminanceMask()
+{
+    send(Messages::RemoteDisplayListRecorder::ConvertToLuminanceMask());
+}
+
+void RemoteDisplayListRecorderProxy::transformToColorSpace(const WebCore::DestinationColorSpace& colorSpace)
+{
+    send(Messages::RemoteDisplayListRecorder::TransformToColorSpace(colorSpace));
+}
+
 bool RemoteDisplayListRecorderProxy::canDrawImageBuffer(const ImageBuffer& imageBuffer) const
 {
     return m_renderingBackend && m_renderingBackend->isCached(imageBuffer);

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h (288239 => 288240)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h	2022-01-19 21:38:24 UTC (rev 288240)
@@ -49,6 +49,8 @@
 
     void getPixelBuffer(const WebCore::PixelBufferFormat& outputFormat, const WebCore::IntRect& sourceRect) final;
     void putPixelBuffer(const WebCore::PixelBuffer&, const WebCore::IntRect& srcRect, const WebCore::IntPoint& destPoint, WebCore::AlphaPremultiplication destFormat) final;
+    void convertToLuminanceMask() final;
+    void transformToColorSpace(const WebCore::DestinationColorSpace&) final;
     void flushContext(WebCore::GraphicsContextFlushIdentifier) final;
 
 private:

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


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2022-01-19 21:35:02 UTC (rev 288239)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2022-01-19 21:38:24 UTC (rev 288240)
@@ -254,7 +254,17 @@
         ASSERT(resolutionScale() == 1);
         m_remoteDisplayList.putPixelBuffer(pixelBuffer, srcRect, destPoint, destFormat);
     }
+    
+    void convertToLuminanceMask() final
+    {
+        m_remoteDisplayList.convertToLuminanceMask();
+    }
 
+    void transformToColorSpace(const WebCore::DestinationColorSpace& colorSpace) final
+    {
+        m_remoteDisplayList.transformToColorSpace(colorSpace);
+    }
+
     bool prefersPreparationForDisplay() final { return true; }
 
     void flushContext() final
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to