Changeset 83994 in webkit
- Timestamp:
- Apr 15, 2011 11:07:01 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r83988 r83994 1 2011-04-14 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Eric Carlson. 4 5 REGRESSION: Rendering in <video> element appears to render quickly to catch up if it has been playing in a background tab 6 https://bugs.webkit.org/show_bug.cgi?id=58637 7 8 Notify AVFoundation that no one will be rendering when the view or window moves off screen. 9 10 * UIProcess/API/mac/PageClientImpl.mm: 11 (WebKit::PageClientImpl::isViewVisible): Return false if the view's window is not visible. 12 * UIProcess/API/mac/WKView.mm: 13 (-[WKView addWindowObserversForWindow:]): Observe orderOut and orderIn events. 14 (-[WKView removeWindowObservers]): Ditto. 15 (-[WKView _windowDidOrderOffScreen:]): Added. 16 (-[WKView _windowDidOrderOnScreen:]): Added. 17 * WebProcess/WebPage/DrawingAreaImpl.cpp: 18 (WebKit::DrawingAreaImpl::suspendPainting): Call LayerTreeHost::pauseRendering. 19 (WebKit::DrawingAreaImpl::resumePainting): Call LayerTreeHost::resumeRendering. 20 * WebProcess/WebPage/LayerTreeHost.h: 21 (WebKit::LayerTreeHost::pauseRendering): Added stub. 22 (WebKit::LayerTreeHost::resumeRendering): Added stub. 23 * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h: 24 * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm: 25 (WebKit::LayerTreeHostCAMac::pauseRendering): Added. Post a notification with our 26 intention to stop rendering. 27 (WebKit::LayerTreeHostCAMac::resumeRendering): Added. Post a notification with our 28 intention to start rendering. 29 1 30 2011-04-15 Jessie Berlin <jberlin@apple.com> 2 31 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r83919 r83994 166 166 { 167 167 if (![m_wkView window]) 168 return false; 169 170 if (![[m_wkView window] isVisible]) 168 171 return false; 169 172 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r83812 r83994 1641 1641 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowFrameDidChange:) 1642 1642 name:NSWindowDidResizeNotification object:window]; 1643 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOffScreen:) 1644 name:@"NSWindowDidOrderOffScreenNotification" object:window]; 1645 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOnScreen:) 1646 name:@"_NSWindowDidBecomeVisible" object:window]; 1643 1647 } 1644 1648 } … … 1656 1660 [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMoveNotification object:window]; 1657 1661 [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:window]; 1662 [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window]; 1663 [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window]; 1658 1664 } 1659 1665 … … 1736 1742 } 1737 1743 1744 - (void)_windowDidOrderOffScreen:(NSNotification *)notification 1745 { 1746 _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible); 1747 } 1748 1749 - (void)_windowDidOrderOnScreen:(NSNotification *)notification 1750 { 1751 _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible); 1752 } 1753 1738 1754 static void drawPageBackground(CGContextRef context, WebPageProxy* page, const IntRect& rect) 1739 1755 { -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r83647 r83994 357 357 ASSERT(!m_isPaintingSuspended); 358 358 359 if (m_layerTreeHost) 360 m_layerTreeHost->pauseRendering(); 361 359 362 m_isPaintingSuspended = true; 360 363 m_displayTimer.stop(); … … 368 371 return; 369 372 } 373 374 if (m_layerTreeHost) 375 m_layerTreeHost->resumeRendering(); 370 376 371 377 m_isPaintingSuspended = false; -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r82966 r83994 64 64 virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&) = 0; 65 65 66 virtual void pauseRendering() { } 67 virtual void resumeRendering() { } 68 66 69 // If a derived class overrides this function to return true, the derived class must also 67 70 // override the functions beneath it. -
trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
r82675 r83994 47 47 virtual void sizeDidChange(const WebCore::IntSize& newSize); 48 48 virtual void forceRepaint(); 49 virtual void pauseRendering(); 50 virtual void resumeRendering(); 49 51 50 52 // LayerTreeHostCA -
trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
r82854 r83994 111 111 [CATransaction flush]; 112 112 [CATransaction synchronize]; 113 } 113 } 114 115 void LayerTreeHostCAMac::pauseRendering() 116 { 117 CALayer* root = rootLayer()->platformLayer(); 118 [root setValue:(id)kCFBooleanTrue forKey:@"NSCAViewRenderPaused"]; 119 [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidPauseNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:root forKey:@"layer"]]; 120 } 121 122 void LayerTreeHostCAMac::resumeRendering() 123 { 124 CALayer* root = rootLayer()->platformLayer(); 125 [root setValue:(id)kCFBooleanFalse forKey:@"NSCAViewRenderPaused"]; 126 [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:root forKey:@"layer"]]; 127 } 114 128 115 129 void LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)
Note: See TracChangeset
for help on using the changeset viewer.