⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185763 in webkit


Ignore:
Timestamp:
Jun 19, 2015, 12:28:52 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Get CAContext directly for CALayer instead of walking the layer tree.
https://bugs.webkit.org/show_bug.cgi?id=146138
<rdar://problem/21455974>

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-06-19
Reviewed by Darin Adler.

This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree
to the root and comparing that against each CAContext's root layer.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185762 r185763  
     12015-06-19  Jeremy Jones  <jeremyj@apple.com>
     2
     3        Get CAContext directly for CALayer instead of walking the layer tree.
     4        https://bugs.webkit.org/show_bug.cgi?id=146138
     5        <rdar://problem/21455974>
     6
     7        Reviewed by Darin Adler.
     8
     9        This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree
     10        to the root and comparing that against each CAContext's root layer.
     11
     12        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     13        (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
     14
    1152015-06-18  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r185727 r185763  
    11061106    [CATransaction setDisableActions:YES];
    11071107   
    1108     CALayer *oldRootLayer = videoFullscreenLayer;
    1109     while (oldRootLayer.superlayer)
    1110         oldRootLayer = oldRootLayer.superlayer;
    1111 
    1112     CALayer *newRootLayer = nil;
     1108    CAContext *oldContext = [m_videoLayer context];
     1109    CAContext *newContext = nil;
    11131110   
    11141111    if (m_videoFullscreenLayer && m_videoLayer) {
     
    11161113        [m_videoLayer removeFromSuperlayer];
    11171114        [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
    1118         newRootLayer = m_videoFullscreenLayer.get();
     1115        newContext = [m_videoFullscreenLayer context];
    11191116    } else if (m_videoInlineLayer && m_videoLayer) {
    11201117        [m_videoLayer setFrame:[m_videoInlineLayer bounds]];
    11211118        [m_videoLayer removeFromSuperlayer];
    11221119        [m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
    1123         newRootLayer = m_videoInlineLayer.get();
     1120        newContext = [m_videoInlineLayer context];
    11241121    } else if (m_videoLayer)
    11251122        [m_videoLayer removeFromSuperlayer];
    11261123
    1127     while (newRootLayer.superlayer)
    1128         newRootLayer = newRootLayer.superlayer;
    1129 
    1130     if (oldRootLayer && newRootLayer && oldRootLayer != newRootLayer) {
    1131         mach_port_t fencePort = 0;
    1132         for (CAContext *context in [CAContext allContexts]) {
    1133             if (context.layer == oldRootLayer || context.layer == newRootLayer) {
    1134                 if (!fencePort)
    1135                     fencePort = [context createFencePort];
    1136                 else
    1137                     [context setFencePort:fencePort];
    1138             }
    1139         }
     1124    if (oldContext && newContext && oldContext != newContext) {
     1125        mach_port_t fencePort = [oldContext createFencePort];
     1126        [newContext setFencePort:fencePort];
    11401127        mach_port_deallocate(mach_task_self(), fencePort);
    11411128    }
Note: See TracChangeset for help on using the changeset viewer.