Title: [154775] trunk/Source/WebCore
Revision
154775
Author
[email protected]
Date
2013-08-28 13:26:22 -0700 (Wed, 28 Aug 2013)

Log Message

MediaPlayerPrivateAVFoundationObjC is painting video frames under the video layer
https://bugs.webkit.org/show_bug.cgi?id=120170

Reviewed by Simon Fraser.

No new tests, it is only possible to test in the debugger.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Drive by optimization.
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): Move logic from paint here.
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Do nothing if we already have a video layer,
    otherwise call paint().

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154774 => 154775)


--- trunk/Source/WebCore/ChangeLog	2013-08-28 20:06:11 UTC (rev 154774)
+++ trunk/Source/WebCore/ChangeLog	2013-08-28 20:26:22 UTC (rev 154775)
@@ -1,3 +1,18 @@
+2013-08-28  Eric Carlson  <[email protected]>
+
+        MediaPlayerPrivateAVFoundationObjC is painting video frames under the video layer
+        https://bugs.webkit.org/show_bug.cgi?id=120170
+
+        Reviewed by Simon Fraser.
+
+        No new tests, it is only possible to test in the debugger.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Drive by optimization.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): Move logic from paint here.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Do nothing if we already have a video layer,
+            otherwise call paint().
+
 2013-08-28  Antti Koivisto  <[email protected]>
 
         Add child and descendant const iterators

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (154774 => 154775)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-08-28 20:06:11 UTC (rev 154774)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2013-08-28 20:26:22 UTC (rev 154775)
@@ -390,7 +390,10 @@
 
 bool MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame() const
 {
-    return (m_videoFrameHasDrawn || (m_videoLayer && [m_videoLayer.get() isReadyForDisplay]));
+    if (currentRenderingMode() == MediaRenderingToLayer)
+        return m_videoLayer && [m_videoLayer.get() isReadyForDisplay];
+
+    return m_videoFrameHasDrawn;
 }
 
 void MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL(const String& url)
@@ -787,14 +790,6 @@
     if (!metaDataAvailable() || context->paintingDisabled())
         return;
 
-    paint(context, rect);
-}
-
-void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
-{
-    if (!metaDataAvailable() || context->paintingDisabled())
-        return;
-
     setDelayCallbacks(true);
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
@@ -810,6 +805,18 @@
     m_videoFrameHasDrawn = true;
 }
 
+void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
+{
+    if (!metaDataAvailable() || context->paintingDisabled())
+        return;
+
+    // We can ignore the request if we are already rendering to a layer.
+    if (currentRenderingMode() == MediaRenderingToLayer)
+        return;
+
+    paintCurrentFrameInContext(context, rect);
+}
+
 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1080
 void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const IntRect& rect)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to