Commit 97ae6a3c authored by eric.carlson@apple.com's avatar eric.carlson@apple.com
Browse files

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().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6005794d
2013-08-28 Eric Carlson <eric.carlson@apple.com>
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 <antti@apple.com> 2013-08-28 Antti Koivisto <antti@apple.com>
   
Add child and descendant const iterators Add child and descendant const iterators
...@@ -390,7 +390,10 @@ void MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer() ...@@ -390,7 +390,10 @@ void MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer()
bool MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame() const 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) void MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL(const String& url)
...@@ -783,14 +786,6 @@ MediaPlayerPrivateAVFoundation::AssetStatus MediaPlayerPrivateAVFoundationObjC:: ...@@ -783,14 +786,6 @@ MediaPlayerPrivateAVFoundation::AssetStatus MediaPlayerPrivateAVFoundationObjC::
} }
void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect) void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
{
if (!metaDataAvailable() || context->paintingDisabled())
return;
paint(context, rect);
}
void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
{ {
if (!metaDataAvailable() || context->paintingDisabled()) if (!metaDataAvailable() || context->paintingDisabled())
return; return;
...@@ -810,6 +805,18 @@ void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const I ...@@ -810,6 +805,18 @@ void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const I
m_videoFrameHasDrawn = true; 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 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1080
void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const IntRect& rect) void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const IntRect& rect)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment