[GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accele...
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jun 2017 07:45:12 +0000 (07:45 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Jun 2017 07:45:12 +0000 (07:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172852

Reviewed by Michael Catanzaro.

Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
needed the player to have a renderer or it would return false. The renderer was needed in order to
access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
accelerated compositing setting directly.

Another problems with the approach before this change is that accelerated rendering was being disabled
when the video element was not visible, as there's no video renderer. Due to this, cases where the video
is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

index 5d2bfad..bec2413 100644 (file)
@@ -1,3 +1,25 @@
+2017-06-05  Miguel Gomez  <magomez@igalia.com>
+
+        [GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accelerated
+        https://bugs.webkit.org/show_bug.cgi?id=172852
+
+        Reviewed by Michael Catanzaro.
+
+        Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
+        needed the player to have a renderer or it would return false. The renderer was needed in order to
+        access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
+        compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
+        accelerated compositing setting directly.
+
+        Another problems with the approach before this change is that accelerated rendering was being disabled
+        when the video element was not visible, as there's no video renderer. Due to this, cases where the video
+        is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.
+
+        Covered by existent tests.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
+
 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
 
         Percentages are calculated wrong in SVG transform CSS property
index a6d71c5..df06e05 100644 (file)
@@ -650,7 +650,7 @@ void MediaPlayerPrivateGStreamerBase::muteChangedCallback(MediaPlayerPrivateGStr
 
 void MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged()
 {
-    m_renderingCanBeAccelerated = m_player && m_player->client().mediaPlayerAcceleratedCompositingEnabled() && m_player->client().mediaPlayerRenderingCanBeAccelerated(m_player);
+    m_renderingCanBeAccelerated = m_player && m_player->client().mediaPlayerAcceleratedCompositingEnabled();
 }
 
 #if USE(TEXTURE_MAPPER_GL)