Title: [212436] branches/safari-603-branch/Source/WebKit2
Revision
212436
Author
[email protected]
Date
2017-02-16 09:17:18 -0800 (Thu, 16 Feb 2017)

Log Message

Merge r212398. rdar://problem/29906848

Modified Paths

Diff

Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (212435 => 212436)


--- branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-02-16 17:11:05 UTC (rev 212435)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-02-16 17:17:18 UTC (rev 212436)
@@ -1,3 +1,25 @@
+2017-02-16  Matthew Hanson  <[email protected]>
+
+        Merge r212398. rdar://problem/29906848
+
+    2017-02-15  Jer Noble  <[email protected]>
+
+            REGRESSION(r183937): Fullscreen Exit animation missing mask
+            https://bugs.webkit.org/show_bug.cgi?id=168360
+
+            Reviewed by Eric Carlson.
+
+            In r183937, the fullscreen window's clip layer has it's mask removed when the enter
+            fullscreen animation completes, allowing low-power video playback mode to be entered. But
+            this breaks the exit fullscreen animaiton, which assumes a mask is present. Abstract the
+            mask creation code out into a static helper method, and use it at the beginning of the exit
+            fullscreen animation to re-create the mask before adding animations to it.
+
+            * UIProcess/mac/WKFullScreenWindowController.mm:
+            (createMask):
+            (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
+            (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
+
 2017-02-09  Matthew Hanson  <[email protected]>
 
         Roll out r209845. rdar://problem/30114564

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (212435 => 212436)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2017-02-16 17:11:05 UTC (rev 212435)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2017-02-16 17:17:18 UTC (rev 212436)
@@ -556,6 +556,16 @@
     return scaleAnimation;
 }
 
+static CALayer *createMask(const FloatRect& bounds)
+{
+    CALayer *maskLayer = [CALayer layer];
+    maskLayer.anchorPoint = CGPointZero;
+    maskLayer.frame = bounds;
+    maskLayer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
+    maskLayer.autoresizingMask = (NSViewWidthSizable | NSViewHeightSizable);
+    return maskLayer;
+}
+
 static CAAnimation *maskAnimation(const FloatRect& initialFrame, const FloatRect& finalFrame, const FloatRect& screenFrame, CFTimeInterval duration, AnimationDirection direction)
 {
     CABasicAnimation *boundsAnimation = [CABasicAnimation animationWithKeyPath:@"bounds"];
@@ -601,11 +611,7 @@
     NSView* contentView = [[self window] contentView];
 
     [[_clipView layer] addAnimation:zoomAnimation(_initialFrame, _finalFrame, self.window.screen.frame, duration, AnimateIn) forKey:@"fullscreen"];
-    CALayer *maskLayer = [CALayer layer];
-    maskLayer.anchorPoint = CGPointZero;
-    maskLayer.frame = NSRectToCGRect(contentView.bounds);
-    maskLayer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
-    maskLayer.autoresizingMask = (NSViewWidthSizable | NSViewHeightSizable);
+    CALayer *maskLayer = createMask(contentView.bounds);
     [maskLayer addAnimation:maskAnimation(_initialFrame, _finalFrame, self.window.screen.frame, duration, AnimateIn) forKey:@"fullscreen"];
     [_clipView layer].mask = maskLayer;
 
@@ -636,9 +642,11 @@
     }
 
     [[_clipView layer] addAnimation:zoomAnimation(_initialFrame, _finalFrame, self.window.screen.frame, duration, AnimateOut) forKey:@"fullscreen"];
-    [[_clipView layer].mask addAnimation:maskAnimation(_initialFrame, _finalFrame, self.window.screen.frame, duration, AnimateOut) forKey:@"fullscreen"];
+    NSView* contentView = [[self window] contentView];
+    CALayer *maskLayer = createMask(contentView.bounds);
+    [maskLayer addAnimation:maskAnimation(_initialFrame, _finalFrame, self.window.screen.frame, duration, AnimateOut) forKey:@"fullscreen"];
+    [_clipView layer].mask = maskLayer;
 
-    NSView* contentView = [[self window] contentView];
     contentView.hidden = NO;
     [_backgroundView.get().layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@"fullscreen"];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to