Title: [289766] trunk/Source/WebKit
Revision
289766
Author
[email protected]
Date
2022-02-14 14:46:48 -0800 (Mon, 14 Feb 2022)

Log Message

[GPU Process] RemoteImageBufferProxy should not sink itself to an Image or a NativeImage though its backend
https://bugs.webkit.org/show_bug.cgi?id=236484

Reviewed by Simon Fraser.

The purpose of sinkIntoImage() and sinkIntoNativeImage() is to reuse the
pixels of an ImageBuffer to be a NativeImage or an Image which encapsulates
a NativeImage.

But for RemoteImageBufferProxy these functions are meaningless because
the pixels (or the backend) can't be accessed in WebProcess.

So to keep the code in WebCore untouched, these two functions will be
overridden by RemoteImageBufferProxy to call the 'copy' methods. The
'copy' methods use the IPC messages to get a NativeImage from GPUProcess.

* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289765 => 289766)


--- trunk/Source/WebKit/ChangeLog	2022-02-14 22:22:42 UTC (rev 289765)
+++ trunk/Source/WebKit/ChangeLog	2022-02-14 22:46:48 UTC (rev 289766)
@@ -1,3 +1,23 @@
+2022-02-14  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] RemoteImageBufferProxy should not sink itself to an Image or a NativeImage though its backend
+        https://bugs.webkit.org/show_bug.cgi?id=236484
+
+        Reviewed by Simon Fraser.
+
+        The purpose of sinkIntoImage() and sinkIntoNativeImage() is to reuse the
+        pixels of an ImageBuffer to be a NativeImage or an Image which encapsulates
+        a NativeImage.
+
+        But for RemoteImageBufferProxy these functions are meaningless because
+        the pixels (or the backend) can't be accessed in WebProcess.
+
+        So to keep the code in WebCore untouched, these two functions will be 
+        overridden by RemoteImageBufferProxy to call the 'copy' methods. The
+        'copy' methods use the IPC messages to get a NativeImage from GPUProcess.
+
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+
 2022-02-14  Wenson Hsieh  <[email protected]>
 
         [Live Text] Plumb platform image analysis objects to the web process

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


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2022-02-14 22:22:42 UTC (rev 289765)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2022-02-14 22:46:48 UTC (rev 289766)
@@ -198,8 +198,18 @@
         return bitmap->createImage();
     }
 
-    RefPtr<WebCore::Image> filteredImage(WebCore::Filter& filter) override
+    RefPtr<WebCore::NativeImage> sinkIntoNativeImage() final
     {
+        return copyNativeImage();
+    }
+
+    RefPtr<WebCore::Image> sinkIntoImage(WebCore::PreserveResolution preserveResolution = WebCore::PreserveResolution::No) final
+    {
+        return copyImage(WebCore::BackingStoreCopy::CopyBackingStore, preserveResolution);
+    }
+
+    RefPtr<WebCore::Image> filteredImage(WebCore::Filter& filter) final
+    {
         if (UNLIKELY(!m_remoteRenderingBackendProxy))
             return { };
         flushDrawingContext();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to