Changeset 154775 in webkit


Ignore:
Timestamp:
Aug 28, 2013 1:26:22 PM (11 years ago)
Author:
eric.carlson@apple.com
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().

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r154769 r154775  
     12013-08-28  Eric Carlson  <eric.carlson@apple.com>
     2
     3        MediaPlayerPrivateAVFoundationObjC is painting video frames under the video layer
     4        https://bugs.webkit.org/show_bug.cgi?id=120170
     5
     6        Reviewed by Simon Fraser.
     7
     8        No new tests, it is only possible to test in the debugger.
     9
     10        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     11        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Drive by optimization.
     12        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): Move logic from paint here.
     13        (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Do nothing if we already have a video layer,
     14            otherwise call paint().
     15
    1162013-08-28  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r154706 r154775  
    391391bool MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame() const
    392392{
    393     return (m_videoFrameHasDrawn || (m_videoLayer && [m_videoLayer.get() isReadyForDisplay]));
     393    if (currentRenderingMode() == MediaRenderingToLayer)
     394        return m_videoLayer && [m_videoLayer.get() isReadyForDisplay];
     395
     396    return m_videoFrameHasDrawn;
    394397}
    395398
     
    788791        return;
    789792
    790     paint(context, rect);
    791 }
    792 
    793 void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
    794 {
    795     if (!metaDataAvailable() || context->paintingDisabled())
    796         return;
    797 
    798793    setDelayCallbacks(true);
    799794    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
    809804
    810805    m_videoFrameHasDrawn = true;
     806}
     807
     808void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const IntRect& rect)
     809{
     810    if (!metaDataAvailable() || context->paintingDisabled())
     811        return;
     812
     813    // We can ignore the request if we are already rendering to a layer.
     814    if (currentRenderingMode() == MediaRenderingToLayer)
     815        return;
     816
     817    paintCurrentFrameInContext(context, rect);
    811818}
    812819
Note: See TracChangeset for help on using the changeset viewer.