Changeset 86924 in webkit
- Timestamp:
- May 19, 2011 10:31:07 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86921 r86924 1 2011-05-19 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 WebKit2: Flashing when entering and exiting full screen mode 6 https://bugs.webkit.org/show_bug.cgi?id=56957 7 8 Guard against the parameter of setAnimating() matching the ivar value it's 9 setting, thus avoiding tearing down the renderer's layer backing. 10 11 * rendering/RenderFullScreen.cpp: 12 (RenderFullScreen::setAnimating): 13 1 14 2011-05-19 Julien Chaffraix <jchaffraix@codeaurora.org> 2 15 -
trunk/Source/WebCore/rendering/RenderFullScreen.cpp
r85767 r86924 39 39 void RenderFullScreen::setAnimating(bool animating) 40 40 { 41 if (m_isAnimating == animating) 42 return; 43 41 44 m_isAnimating = animating; 42 45 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebKit2/ChangeLog
r86898 r86924 1 2011-05-19 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 WebKit2: Flashing when entering and exiting full screen mode 6 https://bugs.webkit.org/show_bug.cgi?id=56957 7 8 In the WKFullscreenWindowController, when exiting accelerated compositing mode, 9 force a repaint, and don't actually remove the animation layer until the repaint 10 completes. Also, move back to parenting the WebView in a layer-backed view, and 11 work around the SnowLeopard bug which causes a crash in those situations. We no 12 longer need to do a bunch of work in finishedEnterFullScreenAnimation, because 13 the animation layer is "hiding" all the drawing happening in the webView underneath. 14 15 In the WebFullScreenManagerMac, when asked to tear down the root layer, instead 16 remove all its children, and set its contents to a flattened image of the full 17 screen element and its children. This helps patch over the time where everything 18 is re-rendering and helps give the appearance of continuousness in the animation. 19 20 * UIProcess/mac/WKFullScreenWindowController.mm: 21 (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): 22 (-[WKFullScreenWindowController beganExitFullScreenAnimation]): 23 (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): 24 (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): 25 (-[WKFullScreenWindowController exitCompositedModeRepaintCompleted]): 26 (exitCompositedModeRepaintCompleted): 27 (-[WKFullScreenWindowController _page]): 28 (-[WKFullScreenWindowController _manager]): 29 (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): 30 * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: 31 (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): 32 1 33 2011-05-19 Anders Carlsson <andersca@apple.com> 2 34 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r86738 r86924 47 47 using namespace WebCore; 48 48 49 static void exitCompositedModeRepaintCompleted(WKErrorRef, void* context); 50 49 51 #if defined(BUILDING_ON_LEOPARD) 50 52 @interface CATransaction(SnowLeopardConvenienceFunctions) … … 83 85 - (CFTimeInterval)_animationDuration; 84 86 - (void)_swapView:(NSView*)view with:(NSView*)otherView; 87 - (WebPageProxy*)_page; 85 88 - (WebFullScreenManagerProxy*)_manager; 86 89 @end … … 242 245 return; 243 246 _isEnteringFullScreen = NO; 244 245 NSDisableScreenUpdates();246 247 247 248 if (completed) { … … 253 254 // Then insert the WebView into the full screen window 254 255 NSView* contentView = [[self _fullScreenWindow] contentView]; 255 [contentView addSubview:_webView positioned:NSWindowBelow relativeTo: _layerHostingView.get()];256 [contentView addSubview:_webView positioned:NSWindowBelow relativeTo:nil]; 256 257 [_webView setFrame:[contentView bounds]]; 257 258 [CATransaction begin];259 [CATransaction setDisableActions:YES];260 [[[self _fullScreenWindow] backgroundLayer] setHidden:YES];261 [CATransaction commit];262 258 263 259 NSWindow *webWindow = [_webViewPlaceholder.get() window]; … … 272 268 [webWindow setAnimationBehavior:animationBehavior]; 273 269 #endif 274 [ [self window] makeKeyAndOrderFront:self];270 [self _manager]->didEnterFullScreen(); 275 271 } 276 277 [self _manager]->didEnterFullScreen();278 NSEnableScreenUpdates();279 272 } 280 273 … … 306 299 // Swap the webView back into its original position: 307 300 if ([_webView window] == [self window]) { 301 #if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) 302 // Work around a bug in AppKit <rdar://problem/9443385> where moving a 303 // layer-hosted view from a layer-backed view to a non-layer-backed view 304 // generates an exception. 305 if (![_webView wantsLayer] && [_webView layer]) { 306 [_webView removeFromSuperview]; 307 for (NSView* child in [_webView subviews]) 308 [[child layer] removeFromSuperlayer]; 309 } 310 #endif 308 311 [self _swapView:_webViewPlaceholder.get() with:_webView]; 309 312 NSWindow* webWindow = [_webView window]; … … 365 368 [CATransaction setDisableActions:YES]; 366 369 WKFullScreenWindow* window = [self _fullScreenWindow]; 367 [[window contentView] addSubview:_layerHostingView.get() positioned:NSWindowAbove relativeTo: [window animationView]];370 [[window contentView] addSubview:_layerHostingView.get() positioned:NSWindowAbove relativeTo:nil]; 368 371 369 372 // Create a root layer that will back the NSView. … … 386 389 if (!_layerHostingView) 387 390 return; 388 391 392 NSDisableScreenUpdates(); 393 [self _page]->forceRepaint(VoidCallback::create(self, exitCompositedModeRepaintCompleted)); 394 } 395 396 - (void)exitCompositedModeRepaintCompleted 397 { 389 398 [CATransaction begin]; 390 399 [CATransaction setDisableActions:YES]; … … 396 405 397 406 _layerHostingView = 0; 407 NSEnableScreenUpdates(); 408 } 409 410 static void exitCompositedModeRepaintCompleted(WKErrorRef, void* context) 411 { 412 [(WKFullScreenWindowController*)context exitCompositedModeRepaintCompleted]; 398 413 } 399 414 … … 501 516 } 502 517 518 - (WebPageProxy*)_page 519 { 520 return toImpl([_webView pageRef]); 521 } 522 503 523 - (WebFullScreenManagerProxy*)_manager 504 524 { 505 WebPageProxy* webPage = toImpl([_webView pageRef]);525 WebPageProxy* webPage = [self _page]; 506 526 if (!webPage) 507 527 return 0; … … 583 603 584 604 NSView* contentView = [self contentView]; 605 [contentView setWantsLayer:YES]; 585 606 _animationView = [[NSView alloc] initWithFrame:[contentView bounds]]; 586 607 -
trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm
r86738 r86924 138 138 m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); 139 139 [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_rootLayer->platformLayer() userInfo:nil]; 140 141 Frame* frame = m_element->document()->frame(); 142 DragImageRef dragImage = frame ? frame->nodeImage(m_element.get()) : 0; 143 140 144 if (m_rootLayer) { 145 [CATransaction begin]; 146 PlatformLayer* rootPlatformLayer = m_rootLayer->platformLayer(); 141 147 m_rootLayer->removeAllChildren(); 148 m_rootLayer->syncCompositingStateForThisLayerOnly(); 142 149 m_rootLayer = nullptr; 150 [rootPlatformLayer setContents:dragImage.get()]; 151 [CATransaction commit]; 143 152 } 144 153 145 154 return; 146 155 }
Note: See TracChangeset
for help on using the changeset viewer.