Title: [185763] trunk/Source/WebCore
- Revision
- 185763
- Author
- [email protected]
- Date
- 2015-06-19 12:28:52 -0700 (Fri, 19 Jun 2015)
Log 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 <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (185762 => 185763)
--- trunk/Source/WebCore/ChangeLog 2015-06-19 19:24:59 UTC (rev 185762)
+++ trunk/Source/WebCore/ChangeLog 2015-06-19 19:28:52 UTC (rev 185763)
@@ -1,3 +1,17 @@
+2015-06-19 Jeremy Jones <[email protected]>
+
+ Get CAContext directly for CALayer instead of walking the layer tree.
+ https://bugs.webkit.org/show_bug.cgi?id=146138
+ <rdar://problem/21455974>
+
+ 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):
+
2015-06-18 Brent Fulgham <[email protected]>
[iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (185762 => 185763)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-06-19 19:24:59 UTC (rev 185762)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-06-19 19:28:52 UTC (rev 185763)
@@ -1105,38 +1105,25 @@
[CATransaction begin];
[CATransaction setDisableActions:YES];
- CALayer *oldRootLayer = videoFullscreenLayer;
- while (oldRootLayer.superlayer)
- oldRootLayer = oldRootLayer.superlayer;
-
- CALayer *newRootLayer = nil;
+ CAContext *oldContext = [m_videoLayer context];
+ CAContext *newContext = nil;
if (m_videoFullscreenLayer && m_videoLayer) {
[m_videoLayer setFrame:CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height())];
[m_videoLayer removeFromSuperlayer];
[m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
- newRootLayer = m_videoFullscreenLayer.get();
+ newContext = [m_videoFullscreenLayer context];
} else if (m_videoInlineLayer && m_videoLayer) {
[m_videoLayer setFrame:[m_videoInlineLayer bounds]];
[m_videoLayer removeFromSuperlayer];
[m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
- newRootLayer = m_videoInlineLayer.get();
+ newContext = [m_videoInlineLayer context];
} else if (m_videoLayer)
[m_videoLayer removeFromSuperlayer];
- while (newRootLayer.superlayer)
- newRootLayer = newRootLayer.superlayer;
-
- if (oldRootLayer && newRootLayer && oldRootLayer != newRootLayer) {
- mach_port_t fencePort = 0;
- for (CAContext *context in [CAContext allContexts]) {
- if (context.layer == oldRootLayer || context.layer == newRootLayer) {
- if (!fencePort)
- fencePort = [context createFencePort];
- else
- [context setFencePort:fencePort];
- }
- }
+ if (oldContext && newContext && oldContext != newContext) {
+ mach_port_t fencePort = [oldContext createFencePort];
+ [newContext setFencePort:fencePort];
mach_port_deallocate(mach_task_self(), fencePort);
}
[CATransaction commit];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes