Title: [273956] trunk
Revision
273956
Author
[email protected]
Date
2021-03-05 02:18:29 -0800 (Fri, 05 Mar 2021)

Log Message

[GPU Process] RemoteImageBuffer recording GraphicsContext should report its backend RenderingMode
https://bugs.webkit.org/show_bug.cgi?id=222772

Reviewed by Simon Fraser.

Source/WebCore:

This will allow compositing the 2D canvas elements when GPU rendering is
enabled for 2D canvas.

* platform/graphics/GraphicsContextImpl.h:
(WebCore::GraphicsContextImpl::renderingMode const):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setIsCALayerContext):
(WebCore::GraphicsContext::isCALayerContext const):
(WebCore::GraphicsContext::setIsAcceleratedContext):
(WebCore::GraphicsContext::isAcceleratedContext const):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::renderingMode const):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::Delegate::renderingMode const):

Source/WebKit:

* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

LayoutTests:

* gpu-process/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273955 => 273956)


--- trunk/LayoutTests/ChangeLog	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/LayoutTests/ChangeLog	2021-03-05 10:18:29 UTC (rev 273956)
@@ -1,3 +1,12 @@
+2021-03-05  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] RemoteImageBuffer recording GraphicsContext should report its backend RenderingMode
+        https://bugs.webkit.org/show_bug.cgi?id=222772
+
+        Reviewed by Simon Fraser.
+
+        * gpu-process/TestExpectations:
+
 2021-03-01  Sergio Villar Senin  <[email protected]>
 
         WPT test css/css-flexbox/flex-minimum-height-flex-items-023.html fails

Modified: trunk/LayoutTests/gpu-process/TestExpectations (273955 => 273956)


--- trunk/LayoutTests/gpu-process/TestExpectations	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2021-03-05 10:18:29 UTC (rev 273956)
@@ -1,19 +1,8 @@
 # webkit.org/b/222728
-compositing/canvas/accelerated-canvas-compositing.html [ Failure ]
-compositing/layer-creation/spanOverlapsCanvas.html [ Failure ]
-css3/blending/blend-mode-clip-accelerated-blending-canvas.html [ Failure ]
-fast/images/ordered-animated-image-frames.html [ ImageOnlyFailure ]
-fast/repaint/canvas-object-fit.html [ Failure ]
-fast/repaint/canvas-putImageData.html [ Failure ]
 imported/w3c/web-platform-tests/html/canvas/element/path-objects/2d.path.stroke.scale2.html [ Failure ]
 inspector/canvas/memory.html [ Failure ]
 svg/canvas/canvas-global-alpha-svg.html [ ImageOnlyFailure ]
 
-# webkit.org/b/220389
-fast/canvas/canvas-drawImage-composite-copy.html [ ImageOnlyFailure ]
-fast/canvas/canvas-render-layer.html [ Failure ]
-fast/canvas/hidpi-repaint-on-retina-leaves-bits-behind.html [ ImageOnlyFailure ]
-
 # webkit.org/b/222341
 imported/blink/fast/canvas/canvas-clip-stack-persistence.html [ ImageOnlyFailure ]
 imported/blink/fast/canvas/canvas-state-persistence-no-dirty.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (273955 => 273956)


--- trunk/Source/WebCore/ChangeLog	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebCore/ChangeLog	2021-03-05 10:18:29 UTC (rev 273956)
@@ -1,3 +1,25 @@
+2021-03-05  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] RemoteImageBuffer recording GraphicsContext should report its backend RenderingMode
+        https://bugs.webkit.org/show_bug.cgi?id=222772
+
+        Reviewed by Simon Fraser.
+
+        This will allow compositing the 2D canvas elements when GPU rendering is
+        enabled for 2D canvas.
+
+        * platform/graphics/GraphicsContextImpl.h:
+        (WebCore::GraphicsContextImpl::renderingMode const):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::setIsCALayerContext):
+        (WebCore::GraphicsContext::isCALayerContext const):
+        (WebCore::GraphicsContext::setIsAcceleratedContext):
+        (WebCore::GraphicsContext::isAcceleratedContext const):
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::renderingMode const):
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        (WebCore::DisplayList::Recorder::Delegate::renderingMode const):
+
 2021-03-01  Sergio Villar Senin  <[email protected]>
 
         WPT test css/css-flexbox/flex-minimum-height-flex-items-023.html fails

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h (273955 => 273956)


--- trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2021-03-05 10:18:29 UTC (rev 273956)
@@ -41,6 +41,7 @@
     virtual bool hasPlatformContext() const = 0;
     virtual bool canDrawImageBuffer(const ImageBuffer&) const { return true; }
     virtual PlatformGraphicsContext* platformContext() const = 0;
+    virtual RenderingMode renderingMode() const { return RenderingMode::Unaccelerated; }
 
     virtual void updateState(const GraphicsContextState&, GraphicsContextState::StateChangeFlags) = 0;
     virtual void clearShadow() = 0;

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (273955 => 273956)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2021-03-05 10:18:29 UTC (rev 273956)
@@ -1617,10 +1617,8 @@
     if (paintingDisabled())
         return;
 
-    // FIXME
-    if (m_impl)
-        return;
-
+    // Should be called for CA Context.
+    ASSERT(m_data);
     if (isLayerContext)
         m_data->m_contextFlags |= IsLayerCGContext;
     else
@@ -1629,14 +1627,7 @@
 
 bool GraphicsContext::isCALayerContext() const
 {
-    if (paintingDisabled())
-        return false;
-
-    // FIXME
-    if (m_impl)
-        return false;
-
-    return m_data->m_contextFlags & IsLayerCGContext;
+    return m_data && (m_data->m_contextFlags & IsLayerCGContext);
 }
 
 void GraphicsContext::setIsAcceleratedContext(bool isAccelerated)
@@ -1644,10 +1635,8 @@
     if (paintingDisabled())
         return;
 
-    // FIXME
-    if (m_impl)
-        return;
-
+    // Should be called for CA Context.
+    ASSERT(m_data);
     if (isAccelerated)
         m_data->m_contextFlags |= IsAcceleratedCGContext;
     else
@@ -1659,9 +1648,8 @@
     if (paintingDisabled())
         return false;
 
-    // FIXME
     if (m_impl)
-        return false;
+        return m_impl->renderingMode() == RenderingMode::Accelerated;
 
     return m_data->m_contextFlags & IsAcceleratedCGContext;
 }

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (273955 => 273956)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2021-03-05 10:18:29 UTC (rev 273956)
@@ -148,6 +148,11 @@
     return !m_delegate || m_delegate->isCachedImageBuffer(imageBuffer);
 }
 
+RenderingMode Recorder::renderingMode() const
+{
+    return m_delegate ? m_delegate->renderingMode() : RenderingMode::Unaccelerated;
+}
+
 void Recorder::clearShadow()
 {
     append<ClearShadow>();

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


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-03-05 10:18:29 UTC (rev 273956)
@@ -68,6 +68,7 @@
         virtual void cacheNativeImage(NativeImage&) { }
         virtual bool isCachedImageBuffer(const ImageBuffer&) const { return false; }
         virtual void cacheFont(Font&) { }
+        virtual RenderingMode renderingMode() const { return RenderingMode::Unaccelerated; }
     };
 
     void flushContext(FlushIdentifier identifier) { append<FlushContext>(identifier); }
@@ -77,6 +78,7 @@
     bool hasPlatformContext() const override { return false; }
     bool canDrawImageBuffer(const ImageBuffer&) const override;
     PlatformGraphicsContext* platformContext() const override { return nullptr; }
+    RenderingMode renderingMode() const override;
 
     void updateState(const GraphicsContextState&, GraphicsContextState::StateChangeFlags) override;
     void clearShadow() override;

Modified: trunk/Source/WebKit/ChangeLog (273955 => 273956)


--- trunk/Source/WebKit/ChangeLog	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebKit/ChangeLog	2021-03-05 10:18:29 UTC (rev 273956)
@@ -1,3 +1,12 @@
+2021-03-05  Said Abou-Hallawa  <[email protected]>
+
+        [GPU Process] RemoteImageBuffer recording GraphicsContext should report its backend RenderingMode
+        https://bugs.webkit.org/show_bug.cgi?id=222772
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+
 2021-03-04  Alex Christensen  <[email protected]>
 
         Add internal preference to disable HTTPS upgrade

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


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-03-05 10:14:57 UTC (rev 273955)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h	2021-03-05 10:18:29 UTC (rev 273956)
@@ -104,6 +104,8 @@
         m_drawingContext.displayList().setTracksDrawingItemExtents(false);
     }
 
+    WebCore::RenderingMode renderingMode() const override { return BaseDisplayListImageBuffer::renderingMode(); }
+
     bool hasPendingFlush() const { return m_sentFlushIdentifier != m_receivedFlushIdentifier; }
 
     void didFlush(WebCore::DisplayList::FlushIdentifier flushIdentifier) override
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to