RESOLVED FIXED 136870
Improve fullscreen video rotation animation.
https://bugs.webkit.org/show_bug.cgi?id=136870
Summary Improve fullscreen video rotation animation.
Jeremy Jones
Reported 2014-09-16 14:41:22 PDT
Improve fullscreen video rotation animation.
Attachments
Patch (12.72 KB, patch)
2014-09-16 14:55 PDT, Jeremy Jones
no flags
Patch (15.58 KB, patch)
2014-09-17 13:55 PDT, Jeremy Jones
no flags
Patch (16.23 KB, patch)
2014-09-17 19:57 PDT, Jeremy Jones
no flags
Patch (25.01 KB, patch)
2014-09-17 20:24 PDT, Jeremy Jones
no flags
Patch (16.93 KB, patch)
2014-09-17 21:17 PDT, Jeremy Jones
no flags
Patch (16.86 KB, patch)
2014-09-18 12:14 PDT, Jeremy Jones
simon.fraser: review+
Patch for landing. (16.85 KB, patch)
2014-09-18 15:58 PDT, Jeremy Jones
no flags
Jeremy Jones
Comment 1 2014-09-16 14:55:40 PDT
Jeremy Jones
Comment 2 2014-09-16 14:58:15 PDT
Simon Fraser (smfr)
Comment 3 2014-09-16 15:42:16 PDT
Comment on attachment 238213 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238213&action=review > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:486 > + RetainPtr<CALayer> _videoSublayer; WebAVVideoLayer has a videoSublayer? Needs some comments so we know which layers are which. > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:538 > + [CATransaction setAnimationDuration:[self animationForKey:@"bounds"].duration ?:0.0001]; ?:0.0001 is weird, both the magic number and the ?: This needs an explanatory comment. > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:539 > + [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; Do you want to explicitly end the transaction after setting the properties? > Source/WebKit2/Platform/mac/LayerHostingContext.mm:116 > + WKCAContextSetFencePort(m_context.get(), fencePort); I don't see WKCAContextSetFencePort anywhere. I assume this depends on other changes? > Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:43 > +SOFT_LINK_FRAMEWORK(UIKit) > +SOFT_LINK_CLASS(UIKit, UIWindow) WebKit2 doesn't need to soft link with UIKit.
Jeremy Jones
Comment 4 2014-09-17 13:55:14 PDT
Jeremy Jones
Comment 5 2014-09-17 13:58:01 PDT
(In reply to comment #3) > (From update of attachment 238213 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=238213&action=review > > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:486 > > + RetainPtr<CALayer> _videoSublayer; > > WebAVVideoLayer has a videoSublayer? Needs some comments so we know which layers are which. Not sure what to say here. This just formalized the relationship that already existed. See the change from addSublayer: to setVideoSublayer: > > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:538 > > + [CATransaction setAnimationDuration:[self animationForKey:@"bounds"].duration ?:0.0001]; > > ?:0.0001 is weird, both the magic number and the ?: This needs an explanatory comment. > Comment added. > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:539 > > + [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; > > Do you want to explicitly end the transaction after setting the properties? Added transaction begin/commit. > > > Source/WebKit2/Platform/mac/LayerHostingContext.mm:116 > > + WKCAContextSetFencePort(m_context.get(), fencePort); > > I don't see WKCAContextSetFencePort anywhere. I assume this depends on other changes? I removed this and moved LayerHostingContext off of WKCAContext per AVSystemInterface guidelines. > > > Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:43 > > +SOFT_LINK_FRAMEWORK(UIKit) > > +SOFT_LINK_CLASS(UIKit, UIWindow) > > WebKit2 doesn't need to soft link with UIKit. Removed.
Simon Fraser (smfr)
Comment 6 2014-09-17 14:05:58 PDT
Comment on attachment 238263 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238263&action=review > Source/WebKit2/Platform/mac/LayerHostingContext.mm:51 > + layerHostingContext->m_context = (CAContext*)WKCAContextMakeRemoteWithServerPort(serverPort); CAContext * > Source/WebKit2/Platform/mac/LayerHostingContext.mm:86 > + return [m_context setLayer:rootLayer]; no return. > Source/WebKit2/Platform/mac/LayerHostingContext.mm:102 > + return [m_context invalidate]; no return > Source/WebKit2/Platform/mac/LayerHostingContext.mm:107 > + return [m_context setColorSpace:colorSpace]; no return > Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm:37 > +#include <UIKit/UIWindow_Private.h> This will annoy dbates who is trying to make us build with the public SDK. You should do the platform/spi thing.
Jeremy Jones
Comment 7 2014-09-17 19:57:47 PDT
Simon Fraser (smfr)
Comment 8 2014-09-17 20:07:57 PDT
Comment on attachment 238283 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238283&action=review > Source/WebKit2/Platform/mac/LayerHostingContext.mm:41 > +@interface CAContext : NSObject (Details) > +- (void)invalidate; > +@property (readonly) uint32_t contextId; > +@property (strong) CALayer *layer; > +@property CGColorSpaceRef colorSpace; > +- (void)setFencePort:(mach_port_t)port; > + (CAContext *)remoteContextWithOptions:(NSDictionary *)dict; > @end This should really go into its own spi header, but that can happen in a later commit. > Source/WebKit2/Platform/mac/LayerHostingContext.mm:88 > + return [m_context setLayer:rootLayer]; No return. > Source/WebKit2/Platform/mac/LayerHostingContext.mm:104 > + return [m_context invalidate]; No return. > Source/WebKit2/Platform/mac/LayerHostingContext.mm:109 > + return [m_context setColorSpace:colorSpace]; No return.
Jeremy Jones
Comment 9 2014-09-17 20:24:27 PDT
Simon Fraser (smfr)
Comment 10 2014-09-17 20:31:21 PDT
Comment on attachment 238284 [details] Patch Patch doesn't apply to TOT!
Jeremy Jones
Comment 11 2014-09-17 21:05:46 PDT
(In reply to comment #10) > (From update of attachment 238284 [details]) > Patch doesn't apply to TOT! dbates backed out his changes for platform/spi. So I'm removing mine also.
Jeremy Jones
Comment 12 2014-09-17 21:17:18 PDT
Jeremy Jones
Comment 13 2014-09-18 12:14:25 PDT
Simon Fraser (smfr)
Comment 14 2014-09-18 13:17:23 PDT
Comment on attachment 238318 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238318&action=review > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:540 > + if (animationDuration == 0.0) // a duration of 0 for CA means 0.25. This is a way to approximate 0. We normally write this as if (!animationDuration)
Jeremy Jones
Comment 15 2014-09-18 15:58:05 PDT
Created attachment 238330 [details] Patch for landing.
Jeremy Jones
Comment 16 2014-09-18 16:09:13 PDT
(In reply to comment #14) > (From update of attachment 238318 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=238318&action=review > > > Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:540 > > + if (animationDuration == 0.0) // a duration of 0 for CA means 0.25. This is a way to approximate 0. > > We normally write this as if (!animationDuration) Fixed.
WebKit Commit Bot
Comment 17 2014-09-18 16:40:55 PDT
Comment on attachment 238330 [details] Patch for landing. Clearing flags on attachment: 238330 Committed r173741: <http://trac.webkit.org/changeset/173741>
Chris Dumez
Comment 18 2014-09-19 09:44:12 PDT
I get the following build error after this change (but the bots seem fine): Source/WebKit2/Platform/mac/LayerHostingContext.mm:121:16: error: instance method '-setFencePort:' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access] [m_context setFencePort:fencePort]; ^~~~~~~~~~~~ Anyone knows what I am missing?
Simon Fraser (smfr)
Comment 19 2014-09-19 11:05:40 PDT
Chris Dumez
Comment 20 2014-09-19 11:26:44 PDT
(In reply to comment #19) > Mac build fixed in https://trac.webkit.org/r173762. You rock Simon :) Thanks.
Note You need to log in before you can comment on or make changes to this bug.