RenderVideo should not paint the video frame when video is fullscreen.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 00:58:59 +0000 (00:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2015 00:58:59 +0000 (00:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142097

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-03-02
Reviewed by Eric Carlson.

For performance and correctness, RenderVideo should not paint the current video frame
inline when video is fullscreen. This happens when snapshots are taken and can have a
negative performance impact.

* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderVideo.cpp

index 0dd05ce..2e9efce 100644 (file)
@@ -1,3 +1,17 @@
+2015-03-02  Jeremy Jones  <jeremyj@apple.com>
+
+        RenderVideo should not paint the video frame when video is fullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=142097
+
+        Reviewed by Eric Carlson.
+
+        For performance and correctness, RenderVideo should not paint the current video frame
+        inline when video is fullscreen. This happens when snapshots are taken and can have a
+        negative performance impact.
+
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::paintReplaced):
+
 2015-03-02  Dean Jackson  <dino@apple.com>
 
         [iOS Media] Airplay button should be blue when active
index 09e1cac..6c4d787 100644 (file)
@@ -188,10 +188,12 @@ void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
 
     if (displayingPoster)
         paintIntoRect(context, rect);
-    else if (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers)
-        mediaPlayer->paintCurrentFrameInContext(context, rect);
-    else
-        mediaPlayer->paint(context, rect);
+    else if (!videoElement().isFullscreen()) {
+        if (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers)
+            mediaPlayer->paintCurrentFrameInContext(context, rect);
+        else
+            mediaPlayer->paint(context, rect);
+    }
 }
 
 void RenderVideo::layout()