OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView) | 86 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView) |
87 : m_renderView(renderView) | 87 : m_renderView(renderView) |
88 , m_compositingReasonFinder(renderView) | 88 , m_compositingReasonFinder(renderView) |
89 , m_pendingUpdateType(CompositingUpdateNone) | 89 , m_pendingUpdateType(CompositingUpdateNone) |
90 , m_hasAcceleratedCompositing(true) | 90 , m_hasAcceleratedCompositing(true) |
91 , m_compositing(false) | 91 , m_compositing(false) |
92 , m_rootShouldAlwaysCompositeDirty(true) | 92 , m_rootShouldAlwaysCompositeDirty(true) |
93 , m_needsUpdateFixedBackground(false) | 93 , m_needsUpdateFixedBackground(false) |
94 , m_isTrackingRepaints(false) | 94 , m_isTrackingRepaints(false) |
95 , m_rootLayerAttachment(RootLayerUnattached) | 95 , m_rootLayerAttachment(RootLayerUnattached) |
| 96 , m_inOverlayFullscreenVideo(false) |
96 { | 97 { |
97 updateAcceleratedCompositingSettings(); | 98 updateAcceleratedCompositingSettings(); |
98 } | 99 } |
99 | 100 |
100 RenderLayerCompositor::~RenderLayerCompositor() | 101 RenderLayerCompositor::~RenderLayerCompositor() |
101 { | 102 { |
102 ASSERT(m_rootLayerAttachment == RootLayerUnattached); | 103 ASSERT(m_rootLayerAttachment == RootLayerUnattached); |
103 } | 104 } |
104 | 105 |
105 bool RenderLayerCompositor::inCompositingMode() const | 106 bool RenderLayerCompositor::inCompositingMode() const |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() | 270 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() |
270 { | 271 { |
271 ASSERT(m_pendingUpdateType == CompositingUpdateNone); | 272 ASSERT(m_pendingUpdateType == CompositingUpdateNone); |
272 ASSERT(!m_rootShouldAlwaysCompositeDirty); | 273 ASSERT(!m_rootShouldAlwaysCompositeDirty); |
273 } | 274 } |
274 | 275 |
275 #endif | 276 #endif |
276 | 277 |
277 void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() | 278 void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() |
278 { | 279 { |
| 280 m_inOverlayFullscreenVideo = false; |
279 if (!m_rootContentLayer) | 281 if (!m_rootContentLayer) |
280 return; | 282 return; |
281 | 283 |
282 bool isMainFrame = m_renderView.frame()->isMainFrame(); | 284 bool isMainFrame = m_renderView.frame()->isMainFrame(); |
283 RenderVideo* video = findFullscreenVideoRenderer(m_renderView.document()); | 285 RenderVideo* video = findFullscreenVideoRenderer(m_renderView.document()); |
284 if (!video || !video->hasCompositedLayerMapping()) { | 286 if (!video || !video->hasCompositedLayerMapping()) { |
285 if (isMainFrame) { | 287 if (isMainFrame) { |
286 GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer(); | 288 GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer(); |
287 if (backgroundLayer && !backgroundLayer->parent()) | 289 if (backgroundLayer && !backgroundLayer->parent()) |
288 rootFixedBackgroundsChanged(); | 290 rootFixedBackgroundsChanged(); |
289 } | 291 } |
290 return; | 292 return; |
291 } | 293 } |
292 | 294 |
293 GraphicsLayer* videoLayer = video->compositedLayerMapping()->mainGraphicsLay
er(); | 295 GraphicsLayer* videoLayer = video->compositedLayerMapping()->mainGraphicsLay
er(); |
294 | 296 |
295 // The fullscreen video has layer position equal to its enclosing frame's sc
roll position because fullscreen container is fixed-positioned. | 297 // The fullscreen video has layer position equal to its enclosing frame's sc
roll position because fullscreen container is fixed-positioned. |
296 // We should reset layer position here since we are going to reattach the la
yer at the very top level. | 298 // We should reset layer position here since we are going to reattach the la
yer at the very top level. |
297 videoLayer->setPosition(IntPoint()); | 299 videoLayer->setPosition(IntPoint()); |
298 | 300 |
299 // Only steal fullscreen video layer and clear all other layers if we are th
e main frame. | 301 // Only steal fullscreen video layer and clear all other layers if we are th
e main frame. |
300 if (!isMainFrame) | 302 if (!isMainFrame) |
301 return; | 303 return; |
302 | 304 |
303 m_rootContentLayer->removeAllChildren(); | 305 m_rootContentLayer->removeAllChildren(); |
304 m_overflowControlsHostLayer->addChild(videoLayer); | 306 m_overflowControlsHostLayer->addChild(videoLayer); |
305 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer()) | 307 if (GraphicsLayer* backgroundLayer = fixedRootBackgroundLayer()) |
306 backgroundLayer->removeFromParent(); | 308 backgroundLayer->removeFromParent(); |
| 309 m_inOverlayFullscreenVideo = true; |
307 } | 310 } |
308 | 311 |
309 void RenderLayerCompositor::updateIfNeeded() | 312 void RenderLayerCompositor::updateIfNeeded() |
310 { | 313 { |
311 { | 314 { |
312 // FIXME: Notice that we call this function before checking the dirty bi
ts below. | 315 // FIXME: Notice that we call this function before checking the dirty bi
ts below. |
313 // We'll need to remove DeprecatedDirtyCompositingDuringCompositingUpdat
e | 316 // We'll need to remove DeprecatedDirtyCompositingDuringCompositingUpdat
e |
314 // before moving this function after checking the dirty bits. | 317 // before moving this function after checking the dirty bits. |
315 DeprecatedDirtyCompositingDuringCompositingUpdate marker(lifecycle()); | 318 DeprecatedDirtyCompositingDuringCompositingUpdate marker(lifecycle()); |
316 | 319 |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 } else if (graphicsLayer == m_scrollLayer.get()) { | 1312 } else if (graphicsLayer == m_scrollLayer.get()) { |
1310 name = "LocalFrame Scrolling Layer"; | 1313 name = "LocalFrame Scrolling Layer"; |
1311 } else { | 1314 } else { |
1312 ASSERT_NOT_REACHED(); | 1315 ASSERT_NOT_REACHED(); |
1313 } | 1316 } |
1314 | 1317 |
1315 return name; | 1318 return name; |
1316 } | 1319 } |
1317 | 1320 |
1318 } // namespace WebCore | 1321 } // namespace WebCore |
OLD | NEW |