Changeset 86588 in webkit
- Timestamp:
- May 16, 2011 10:50:54 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86586 r86588 1 2011-05-13 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Video is blank, controller is misplaced on trailers.apple.com movie in fullscreen (with two screens) 6 https://bugs.webkit.org/show_bug.cgi?id=60826 7 8 Listen for a WebKitLayerHostChanged notification and, if the affected layer is an 9 ancestor layer of the qtMovieLayer, tear down the layer and recreate it the 10 next time setVisible(true) is called. 11 12 * dom/Document.cpp: 13 (WebCore::Document::webkitDidEnterFullScreenForElement): Call setFullScreenRootLayer(0) 14 before disabling animation on the full screen renderer. 15 * platform/graphics/mac/MediaPlayerPrivateQTKit.h: 16 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 17 (WebCore::MediaPlayerPrivateQTKit::createQTMovie): Register an observer for the new 18 WebKitLayerHostChanged notification. 19 (WebCore::layerIsDescendentOf): Added. 20 (WebCore::MediaPlayerPrivateQTKit::layerHostChanged): Added. If the changed 21 layer is an ancestor of the movie layer, tear down rendering and re- 22 create the next time setVisible(true) is called. 23 (-[WebCoreMovieObserver layerHostChanged:]): Added ObjC listener wrapper. 24 1 25 2011-05-16 Adam Barth <abarth@webkit.org> 2 26 -
trunk/Source/WebCore/dom/Document.cpp
r86584 r86588 4893 4893 { 4894 4894 if (m_fullScreenRenderer) { 4895 #if USE(ACCELERATED_COMPOSITING) 4896 page()->chrome()->client()->setRootFullScreenLayer(0); 4897 #endif 4895 4898 m_fullScreenRenderer->setAnimating(false); 4896 4899 #if USE(ACCELERATED_COMPOSITING) 4897 4900 view()->updateCompositingLayers(); 4898 page()->chrome()->client()->setRootFullScreenLayer(0);4899 4901 #endif 4900 4902 } -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r86418 r86588 69 69 void timeChanged(); 70 70 void didEnd(); 71 #if USE(ACCELERATED_COMPOSITING) 72 void layerHostChanged(PlatformLayer* rootLayer); 73 #endif 71 74 72 75 private: -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r86451 r86588 171 171 -(void)timeChanged:(NSNotification *)notification; 172 172 -(void)didEnd:(NSNotification *)notification; 173 -(void)layerHostChanged:(NSNotification *)notification; 173 174 @end 174 175 … … 404 405 name:QTMovieDidEndNotification 405 406 object:m_qtMovie.get()]; 407 #if defined(BUILDING_ON_SNOW_LEOPARD) 408 [[NSNotificationCenter defaultCenter] addObserver:m_objcObserver.get() 409 selector:@selector(layerHostChanged:) 410 name:@"WebKitLayerHostChanged" 411 object:nil]; 412 #endif 406 413 } 407 414 … … 1205 1212 m_player->timeChanged(); 1206 1213 } 1214 1215 #if USE(ACCELERATED_COMPOSITING) 1216 static bool layerIsDescendentOf(PlatformLayer* child, PlatformLayer* descendent) 1217 { 1218 if (!child || !descendent) 1219 return false; 1220 1221 do { 1222 if (child == descendent) 1223 return true; 1224 } while((child = [child superlayer])); 1225 1226 return false; 1227 } 1228 1229 void MediaPlayerPrivateQTKit::layerHostChanged(PlatformLayer* rootLayer) 1230 { 1231 #if defined(BUILDING_ON_SNOW_LEOPARD) 1232 if (!rootLayer) 1233 return; 1234 1235 if (layerIsDescendentOf(m_qtVideoLayer.get(), rootLayer)) { 1236 // We own a child layer of a layer which has switched contexts. 1237 // Tear down our layer, and set m_visible to false, so that the 1238 // next time setVisible(true) is called, the layer will be re- 1239 // created in the correct context. 1240 tearDownVideoRendering(); 1241 m_visible = false; 1242 } 1243 #else 1244 UNUSED_PARAM(rootLayer); 1245 #endif 1246 } 1247 #endif 1207 1248 1208 1249 void MediaPlayerPrivateQTKit::setSize(const IntSize&) … … 1700 1741 } 1701 1742 1743 - (void)layerHostChanged:(NSNotification *)notification 1744 { 1745 #if USE(ACCELERATED_COMPOSITING) 1746 CALayer* rootLayer = static_cast<CALayer*>([notification object]); 1747 m_callback->layerHostChanged(rootLayer); 1748 #else 1749 UNUSED_PARAM(notification); 1750 #endif 1751 } 1752 1702 1753 - (void)setDelayCallbacks:(BOOL)shouldDelay 1703 1754 { -
trunk/Source/WebKit2/ChangeLog
r86585 r86588 1 2011-05-13 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Video is blank, controller is misplaced on trailers.apple.com movie in fullscreen (with two screens) 6 https://bugs.webkit.org/show_bug.cgi?id=60826 7 8 Emit a notification when moving a CALayer from the WebProcess's main 9 layer host to a new context. This allows listeners to invalidate their 10 layers which may not support moving between different CAContexts (as is 11 the case with QTMovieLayer). In order to allow listeners to determine if they 12 are affected, the notification will pass the root CALayer in a userInfo 13 dictionary. 14 15 In WebFullScreenManagerMac, move from storing a pointer to a non-refcounted 16 class (GraphicsLayer) to a retainable class (PlatformLayer). 17 18 * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: 19 * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: 20 (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): No need to initialize 21 m_fullScreenRootLayer now that it is a RetainPtr<>. 22 (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Emit a notification 23 after either creating or destroying the full screen layer host. 24 (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): 25 (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): 26 1 27 2011-05-16 Siddharth Mathur <siddharth.mathur@nokia.com> 2 28 -
trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h
r80925 r86588 32 32 #import "WebFullScreenManager.h" 33 33 34 #import <WebCore/GraphicsLayer.h> 34 35 #import <WebCore/IntRect.h> 35 36 #import <wtf/RetainPtr.h> … … 54 55 55 56 OwnPtr<WebCore::GraphicsLayer> m_rootLayer; 56 WebCore::GraphicsLayer*m_fullScreenRootLayer;57 RetainPtr<PlatformLayer> m_fullScreenRootLayer; 57 58 LayerTreeContext m_layerTreeContext; 58 59 RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient; -
trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm
r85515 r86588 118 118 WebFullScreenManagerMac::WebFullScreenManagerMac(WebPage* page) 119 119 : WebFullScreenManager(page) 120 , m_fullScreenRootLayer(0)121 120 { 122 121 m_enterFullScreenListener.adoptNS([[WebFullScreenManagerAnimationListener alloc] initWithManager:this began:&WebFullScreenManagerMac::beganEnterFullScreenAnimation finished:&WebFullScreenManagerMac::finishedEnterFullScreenAnimation]); … … 133 132 void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* layer) 134 133 { 135 if (m_fullScreenRootLayer == layer) 136 return; 137 m_fullScreenRootLayer = layer; 138 139 if (!m_fullScreenRootLayer) { 134 if (m_fullScreenRootLayer == (layer ? layer->platformLayer() : 0)) 135 return; 136 137 if (!layer) { 140 138 m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); 141 139 if (m_rootLayer) { … … 143 141 m_rootLayer = nullptr; 144 142 } 145 return; 146 } 147 143 144 [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil]; 145 m_fullScreenRootLayer = 0; 146 return; 147 } 148 148 149 if (!m_rootLayer) { 149 150 mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort(); … … 164 165 165 166 m_rootLayer->removeAllChildren(); 166 167 if (m_fullScreenRootLayer) 168 m_rootLayer->addChild(m_fullScreenRootLayer); 167 m_rootLayer->addChild(layer); 169 168 170 169 m_rootLayer->syncCompositingStateForThisLayerOnly(); 171 170 m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); 171 m_fullScreenRootLayer = layer->platformLayer(); 172 layer->syncCompositingState(); 173 174 [[NSNotificationCenter defaultCenter] postNotificationName:@"WebKitLayerHostChanged" object:m_fullScreenRootLayer.get() userInfo:nil]; 172 175 } 173 176 … … 191 194 // content, this can change to use them. Meanwhile, we'll have to animate the 192 195 // CALayer directly: 193 CALayer* caLayer = m_fullScreenRootLayer ->platformLayer();196 CALayer* caLayer = m_fullScreenRootLayer.get(); 194 197 195 198 // Create a transformation matrix that will transform the renderer layer such that … … 246 249 // content, this can change to use them. Meanwhile, we'll have to animate the 247 250 // CALayer directly: 248 CALayer* caLayer = m_fullScreenRootLayer ->platformLayer();251 CALayer* caLayer = m_fullScreenRootLayer.get(); 249 252 250 253 // Create a transformation matrix that will transform the renderer layer such that
Note: See TracChangeset
for help on using the changeset viewer.