Title: [271295] trunk
Revision
271295
Author
[email protected]
Date
2021-01-08 07:26:34 -0800 (Fri, 08 Jan 2021)

Log Message

PaintFrameForMedia has a null identifier when media player is a media stream track video player
https://bugs.webkit.org/show_bug.cgi?id=220411

Reviewed by Wenson Hsieh.

Source/WebCore:

MediaStreamTrack video player is running in WebProcess as WebProcess gets each video sample.
There is no corresponding remote media player.
Disable the GPU code path for painting the video element and use the in-process one instead.

Covered by test in GPU process mode.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::paintFrameForMedia):
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::canPaintFrameForMedia const):
(WebCore::DisplayList::Recorder::paintFrameForMedia):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* platform/graphics/win/GraphicsContextImplDirect2D.h:

LayoutTests:

* gpu-process/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271294 => 271295)


--- trunk/LayoutTests/ChangeLog	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/LayoutTests/ChangeLog	2021-01-08 15:26:34 UTC (rev 271295)
@@ -1,3 +1,12 @@
+2021-01-08  Youenn Fablet  <[email protected]>
+
+        PaintFrameForMedia has a null identifier when media player is a media stream track video player
+        https://bugs.webkit.org/show_bug.cgi?id=220411
+
+        Reviewed by Wenson Hsieh.
+
+        * gpu-process/TestExpectations:
+
 2021-01-08  Rob Buis  <[email protected]>
 
         Take aspect-ratio into account for percentage resolution

Modified: trunk/LayoutTests/gpu-process/TestExpectations (271294 => 271295)


--- trunk/LayoutTests/gpu-process/TestExpectations	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2021-01-08 15:26:34 UTC (rev 271295)
@@ -509,6 +509,7 @@
 imported/w3c/web-platform-tests/webrtc [ Skip ]
 
 webrtc [ Skip ]
+webrtc/video.html [ Pass ]
 
 webgl [ Skip ]
 http/tests/security/webgl-remote-read-remote-image-allowed.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (271294 => 271295)


--- trunk/Source/WebCore/ChangeLog	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/ChangeLog	2021-01-08 15:26:34 UTC (rev 271295)
@@ -1,3 +1,27 @@
+2021-01-08  Youenn Fablet  <[email protected]>
+
+        PaintFrameForMedia has a null identifier when media player is a media stream track video player
+        https://bugs.webkit.org/show_bug.cgi?id=220411
+
+        Reviewed by Wenson Hsieh.
+
+        MediaStreamTrack video player is running in WebProcess as WebProcess gets each video sample.
+        There is no corresponding remote media player.
+        Disable the GPU code path for painting the video element and use the in-process one instead.
+
+        Covered by test in GPU process mode.
+
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::paintFrameForMedia):
+        * platform/graphics/GraphicsContextImpl.h:
+        * platform/graphics/cairo/GraphicsContextImplCairo.h:
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::canPaintFrameForMedia const):
+        (WebCore::DisplayList::Recorder::paintFrameForMedia):
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
+        * platform/graphics/win/GraphicsContextImplDirect2D.h:
+
 2021-01-08  Rob Buis  <[email protected]>
 
         Take aspect-ratio into account for percentage resolution

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (271294 => 271295)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2021-01-08 15:26:34 UTC (rev 271295)
@@ -1302,7 +1302,7 @@
     if (paintingDisabled())
         return;
 
-    if (m_impl && m_impl->canPaintFrameForMedia()) {
+    if (m_impl && m_impl->canPaintFrameForMedia(player)) {
         m_impl->paintFrameForMedia(player, destination);
         return;
     }

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h (271294 => 271295)


--- trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2021-01-08 15:26:34 UTC (rev 271295)
@@ -105,7 +105,7 @@
     virtual void clipToImageBuffer(ImageBuffer&, const FloatRect&) = 0;
     virtual void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&& drawingFunction) = 0;
     virtual void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) = 0;
-    virtual bool canPaintFrameForMedia() const = 0;
+    virtual bool canPaintFrameForMedia(const MediaPlayer&) const = 0;
     
     virtual void applyDeviceScaleFactor(float) = 0;
 

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h (271294 => 271295)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h	2021-01-08 15:26:34 UTC (rev 271295)
@@ -106,7 +106,7 @@
     void clipToImageBuffer(ImageBuffer&, const FloatRect&) override;
     void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override;
     void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override;
-    bool canPaintFrameForMedia() const override { return false; }
+    bool canPaintFrameForMedia(const MediaPlayer&) const override { return false; }
     
     void applyDeviceScaleFactor(float) override;
 

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


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2021-01-08 15:26:34 UTC (rev 271295)
@@ -446,8 +446,14 @@
     append<ClipToDrawingCommands>(destination, colorSpace, recordingContext->takeDisplayList());
 }
 
+bool Recorder::canPaintFrameForMedia(const MediaPlayer& player) const
+{
+    return !!player.identifier();
+}
+
 void Recorder::paintFrameForMedia(MediaPlayer& player, const FloatRect& destination)
 {
+    ASSERT(player.identifier());
     append<PaintFrameForMedia>(player, destination);
 }
 

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


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2021-01-08 15:26:34 UTC (rev 271295)
@@ -143,8 +143,8 @@
     void clipToImageBuffer(WebCore::ImageBuffer&, const FloatRect&) override;
     void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override;
     void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override;
-    bool canPaintFrameForMedia() const override { return true; }
-    
+    bool canPaintFrameForMedia(const MediaPlayer&) const override;
+
     void applyDeviceScaleFactor(float) override;
 
     FloatRect roundToDevicePixels(const FloatRect&, GraphicsContext::RoundingMode) override;

Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h (271294 => 271295)


--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h	2021-01-08 15:26:34 UTC (rev 271295)
@@ -99,7 +99,7 @@
     void clipToImageBuffer(WebCore::ImageBuffer&, const WebCore::FloatRect&) override;
     void clipToDrawingCommands(const WebCore::FloatRect& destination, WebCore::ColorSpace, Function<void(WebCore::GraphicsContext&)>&&) override;
     void paintFrameForMedia(WebCore::MediaPlayer&, const WebCore::FloatRect& destination) override;
-    bool canPaintFrameForMedia() const override { return false; }
+    bool canPaintFrameForMedia(const WebCore::MediaPlayer&) const override { return false; }
 
     void applyDeviceScaleFactor(float) override;
 

Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextImplDirect2D.h (271294 => 271295)


--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextImplDirect2D.h	2021-01-08 15:22:28 UTC (rev 271294)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextImplDirect2D.h	2021-01-08 15:26:34 UTC (rev 271295)
@@ -103,7 +103,7 @@
     void clipToImageBuffer(ImageBuffer&, const FloatRect&) override;
     void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override;
     void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override;
-    bool canPaintFrameForMedia() const override { return false; }
+    bool canPaintFrameForMedia(const MediaPlayer&) const override { return false; }
     
     void applyDeviceScaleFactor(float) override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to