Title: [179574] trunk/Source
- Revision
- 179574
- Author
- [email protected]
- Date
- 2015-02-03 15:41:47 -0800 (Tue, 03 Feb 2015)
Log Message
Prevent flicker when exiting fullscreen by synchronizing transactions.
https://bugs.webkit.org/show_bug.cgi?id=140897
Patch by Jeremy Jones <[email protected]> on 2015-02-03
Reviewed by Tim Horton.
Source/WebCore:
Synchronize across CAContexts when moving the video layer between layer hierarchies.
Normally transactions involving multiple CAContexts are not synchronized.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
* platform/spi/cocoa/QuartzCoreSPI.h: add additional CAContext SPI declarations.
Source/WebKit2:
Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (179573 => 179574)
--- trunk/Source/WebCore/ChangeLog 2015-02-03 23:21:47 UTC (rev 179573)
+++ trunk/Source/WebCore/ChangeLog 2015-02-03 23:41:47 UTC (rev 179574)
@@ -1,3 +1,17 @@
+2015-02-03 Jeremy Jones <[email protected]>
+
+ Prevent flicker when exiting fullscreen by synchronizing transactions.
+ https://bugs.webkit.org/show_bug.cgi?id=140897
+
+ Reviewed by Tim Horton.
+
+ Synchronize across CAContexts when moving the video layer between layer hierarchies.
+ Normally transactions involving multiple CAContexts are not synchronized.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
+ * platform/spi/cocoa/QuartzCoreSPI.h: add additional CAContext SPI declarations.
+
2015-02-03 Ryosuke Niwa <[email protected]>
Smart quoting could move the caret backwards in some configurations
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (179573 => 179574)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-02-03 23:21:47 UTC (rev 179573)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-02-03 23:41:47 UTC (rev 179574)
@@ -49,6 +49,7 @@
#import "MediaSelectionGroupAVFObjC.h"
#import "MediaTimeAVFoundation.h"
#import "PlatformTimeRanges.h"
+#import "QuartzCoreSPI.h"
#import "SecurityOrigin.h"
#import "SerializedPlatformRepresentationMac.h"
#import "SoftLinking.h"
@@ -80,6 +81,7 @@
#if PLATFORM(IOS)
#import "WAKAppKitStubs.h"
#import <CoreImage/CoreImage.h>
+#import <mach/mach_port.h>
#else
#import <Foundation/NSGeometry.h>
#import <QuartzCore/CoreImage.h>
@@ -1039,18 +1041,41 @@
[CATransaction begin];
[CATransaction setDisableActions:YES];
+
+ CALayer *oldRootLayer = videoFullscreenLayer;
+ while (oldRootLayer.superlayer)
+ oldRootLayer = oldRootLayer.superlayer;
+ CALayer *newRootLayer = 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();
} 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();
} 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];
+ }
+ }
+ mach_port_deallocate(mach_task_self(), fencePort);
+ }
[CATransaction commit];
if (m_videoFullscreenLayer && m_textTrackRepresentationLayer) {
Modified: trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (179573 => 179574)
--- trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h 2015-02-03 23:21:47 UTC (rev 179573)
+++ trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h 2015-02-03 23:41:47 UTC (rev 179574)
@@ -57,11 +57,13 @@
@end
@interface CAContext (Details)
++ (NSArray *)allContexts;
+ (CAContext *)remoteContextWithOptions:(NSDictionary *)dict;
+ (id)objectForSlot:(uint32_t)name;
- (uint32_t)createImageSlot:(CGSize)size hasAlpha:(BOOL)flag;
- (void)deleteSlot:(uint32_t)name;
- (void)invalidate;
+- (mach_port_t)createFencePort;
- (void)setFencePort:(mach_port_t)port;
@property (readonly) uint32_t contextId;
@property (strong) CALayer *layer;
Modified: trunk/Source/WebKit2/ChangeLog (179573 => 179574)
--- trunk/Source/WebKit2/ChangeLog 2015-02-03 23:21:47 UTC (rev 179573)
+++ trunk/Source/WebKit2/ChangeLog 2015-02-03 23:41:47 UTC (rev 179574)
@@ -1,3 +1,15 @@
+2015-02-03 Jeremy Jones <[email protected]>
+
+ Prevent flicker when exiting fullscreen by synchronizing transactions.
+ https://bugs.webkit.org/show_bug.cgi?id=140897
+
+ Reviewed by Tim Horton.
+
+ Flush transactions before removing layerHost. This allows existing transactions to be completed before the hosting layer disappears.
+
+ * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+ (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
+
2015-02-03 Brian J. Burg <[email protected]>
Convert WebInspectorProxy to use WKWebView API for the inspector view
Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (179573 => 179574)
--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm 2015-02-03 23:21:47 UTC (rev 179573)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm 2015-02-03 23:41:47 UTC (rev 179574)
@@ -135,6 +135,7 @@
void WebVideoFullscreenManagerProxy::didCleanupFullscreen()
{
+ [CATransaction flush];
[m_layerHost removeFromSuperlayer];
m_layerHost.clear();
m_page->send(Messages::WebVideoFullscreenManager::DidCleanupFullscreen(), m_page->pageID());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes