| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 DocumentLifecycle::DeprecatedTransition m_deprecatedTransition; | 81 DocumentLifecycle::DeprecatedTransition m_deprecatedTransition; |
| 82 DocumentLifecycle::State m_originalState; | 82 DocumentLifecycle::State m_originalState; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView) | 85 RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView) |
| 86 : m_renderView(renderView) | 86 : m_renderView(renderView) |
| 87 , m_compositingReasonFinder(renderView) | 87 , m_compositingReasonFinder(renderView) |
| 88 , m_pendingUpdateType(CompositingUpdateNone) | 88 , m_pendingUpdateType(CompositingUpdateNone) |
| 89 , m_hasAcceleratedCompositing(true) | 89 , m_hasAcceleratedCompositing(true) |
| 90 , m_compositing(false) | 90 , m_compositing(false) |
| 91 , m_compositingLayersNeedRebuild(false) | |
| 92 , m_rootShouldAlwaysCompositeDirty(true) | 91 , m_rootShouldAlwaysCompositeDirty(true) |
| 93 , m_needsUpdateFixedBackground(false) | 92 , m_needsUpdateFixedBackground(false) |
| 94 , m_isTrackingRepaints(false) | 93 , m_isTrackingRepaints(false) |
| 95 , m_rootLayerAttachment(RootLayerUnattached) | 94 , m_rootLayerAttachment(RootLayerUnattached) |
| 96 { | 95 { |
| 97 updateAcceleratedCompositingSettings(); | 96 updateAcceleratedCompositingSettings(); |
| 98 } | 97 } |
| 99 | 98 |
| 100 RenderLayerCompositor::~RenderLayerCompositor() | 99 RenderLayerCompositor::~RenderLayerCompositor() |
| 101 { | 100 { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (!m_rootShouldAlwaysCompositeDirty) | 144 if (!m_rootShouldAlwaysCompositeDirty) |
| 146 return; | 145 return; |
| 147 | 146 |
| 148 m_rootShouldAlwaysCompositeDirty = false; | 147 m_rootShouldAlwaysCompositeDirty = false; |
| 149 if (m_compositing) | 148 if (m_compositing) |
| 150 return; | 149 return; |
| 151 | 150 |
| 152 if (rootShouldAlwaysComposite()) { | 151 if (rootShouldAlwaysComposite()) { |
| 153 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_b
ug.cgi?id=26651. | 152 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_b
ug.cgi?id=26651. |
| 154 // No tests fail if it's deleted. | 153 // No tests fail if it's deleted. |
| 155 setCompositingLayersNeedRebuild(); | 154 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 156 setCompositingModeEnabled(true); | 155 setCompositingModeEnabled(true); |
| 157 } | 156 } |
| 158 } | 157 } |
| 159 | 158 |
| 160 bool RenderLayerCompositor::compositingLayersNeedRebuild() | |
| 161 { | |
| 162 // enableCompositingModeIfNeeded can set the m_compositingLayersNeedRebuild
bit. | |
| 163 ASSERT(!m_rootShouldAlwaysCompositeDirty); | |
| 164 return m_compositingLayersNeedRebuild; | |
| 165 } | |
| 166 | |
| 167 bool RenderLayerCompositor::rootShouldAlwaysComposite() const | 159 bool RenderLayerCompositor::rootShouldAlwaysComposite() const |
| 168 { | 160 { |
| 169 if (!m_hasAcceleratedCompositing) | 161 if (!m_hasAcceleratedCompositing) |
| 170 return false; | 162 return false; |
| 171 return m_renderView.frame()->isMainFrame() || m_compositingReasonFinder.requ
iresCompositingForScrollableFrame(); | 163 return m_renderView.frame()->isMainFrame() || m_compositingReasonFinder.requ
iresCompositingForScrollableFrame(); |
| 172 } | 164 } |
| 173 | 165 |
| 174 void RenderLayerCompositor::updateAcceleratedCompositingSettings() | 166 void RenderLayerCompositor::updateAcceleratedCompositingSettings() |
| 175 { | 167 { |
| 176 m_compositingReasonFinder.updateTriggers(); | 168 m_compositingReasonFinder.updateTriggers(); |
| 177 | 169 |
| 178 bool hasAcceleratedCompositing = m_renderView.document().settings()->acceler
atedCompositingEnabled(); | 170 bool hasAcceleratedCompositing = m_renderView.document().settings()->acceler
atedCompositingEnabled(); |
| 179 | 171 |
| 180 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_bug.c
gi?id=26651. | 172 // FIXME: Is this needed? It was added in https://bugs.webkit.org/show_bug.c
gi?id=26651. |
| 181 // No tests fail if it's deleted. | 173 // No tests fail if it's deleted. |
| 182 if (hasAcceleratedCompositing != m_hasAcceleratedCompositing) | 174 if (hasAcceleratedCompositing != m_hasAcceleratedCompositing) |
| 183 setCompositingLayersNeedRebuild(); | 175 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 184 | 176 |
| 185 m_hasAcceleratedCompositing = hasAcceleratedCompositing; | 177 m_hasAcceleratedCompositing = hasAcceleratedCompositing; |
| 186 m_rootShouldAlwaysCompositeDirty = true; | 178 m_rootShouldAlwaysCompositeDirty = true; |
| 187 } | 179 } |
| 188 | 180 |
| 189 bool RenderLayerCompositor::layerSquashingEnabled() const | 181 bool RenderLayerCompositor::layerSquashingEnabled() const |
| 190 { | 182 { |
| 191 if (!RuntimeEnabledFeatures::layerSquashingEnabled()) | 183 if (!RuntimeEnabledFeatures::layerSquashingEnabled()) |
| 192 return false; | 184 return false; |
| 193 if (Settings* settings = m_renderView.document().settings()) | 185 if (Settings* settings = m_renderView.document().settings()) |
| 194 return settings->layerSquashingEnabled(); | 186 return settings->layerSquashingEnabled(); |
| 195 return true; | 187 return true; |
| 196 } | 188 } |
| 197 | 189 |
| 198 bool RenderLayerCompositor::acceleratedCompositingForOverflowScrollEnabled() con
st | 190 bool RenderLayerCompositor::acceleratedCompositingForOverflowScrollEnabled() con
st |
| 199 { | 191 { |
| 200 return m_compositingReasonFinder.hasOverflowScrollTrigger(); | 192 return m_compositingReasonFinder.hasOverflowScrollTrigger(); |
| 201 } | 193 } |
| 202 | 194 |
| 203 void RenderLayerCompositor::setCompositingLayersNeedRebuild() | |
| 204 { | |
| 205 // FIXME: crbug.com/332248 ideally this could be merged with setNeedsComposi
tingUpdate(). | |
| 206 m_compositingLayersNeedRebuild = true; | |
| 207 page()->animator().scheduleVisualUpdate(); | |
| 208 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); | |
| 209 } | |
| 210 | |
| 211 static RenderVideo* findFullscreenVideoRenderer(Document& document) | 195 static RenderVideo* findFullscreenVideoRenderer(Document& document) |
| 212 { | 196 { |
| 213 Element* fullscreenElement = FullscreenElementStack::fullscreenElementFrom(d
ocument); | 197 Element* fullscreenElement = FullscreenElementStack::fullscreenElementFrom(d
ocument); |
| 214 while (fullscreenElement && fullscreenElement->isFrameOwnerElement()) { | 198 while (fullscreenElement && fullscreenElement->isFrameOwnerElement()) { |
| 215 Document* contentDocument = toHTMLFrameOwnerElement(fullscreenElement)->
contentDocument(); | 199 Document* contentDocument = toHTMLFrameOwnerElement(fullscreenElement)->
contentDocument(); |
| 216 if (!contentDocument) | 200 if (!contentDocument) |
| 217 return 0; | 201 return 0; |
| 218 fullscreenElement = FullscreenElementStack::fullscreenElementFrom(*conte
ntDocument); | 202 fullscreenElement = FullscreenElementStack::fullscreenElementFrom(*conte
ntDocument); |
| 219 } | 203 } |
| 220 if (!isHTMLVideoElement(fullscreenElement)) | 204 if (!isHTMLVideoElement(fullscreenElement)) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // track which RenderLayers moved during layout and only dirty those | 256 // track which RenderLayers moved during layout and only dirty those |
| 273 // specific RenderLayers. | 257 // specific RenderLayers. |
| 274 rootRenderLayer()->setNeedsToUpdateAncestorDependentProperties(); | 258 rootRenderLayer()->setNeedsToUpdateAncestorDependentProperties(); |
| 275 setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange); | 259 setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange); |
| 276 } | 260 } |
| 277 | 261 |
| 278 #if ASSERT_ENABLED | 262 #if ASSERT_ENABLED |
| 279 | 263 |
| 280 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() | 264 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() |
| 281 { | 265 { |
| 282 ASSERT(!compositingLayersNeedRebuild()); | |
| 283 ASSERT(m_pendingUpdateType == CompositingUpdateNone); | 266 ASSERT(m_pendingUpdateType == CompositingUpdateNone); |
| 284 ASSERT(!m_rootShouldAlwaysCompositeDirty); | 267 ASSERT(!m_rootShouldAlwaysCompositeDirty); |
| 285 } | 268 } |
| 286 | 269 |
| 287 #endif | 270 #endif |
| 288 | 271 |
| 289 void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() | 272 void RenderLayerCompositor::applyOverlayFullscreenVideoAdjustment() |
| 290 { | 273 { |
| 291 if (!m_rootContentLayer) | 274 if (!m_rootContentLayer) |
| 292 return; | 275 return; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 319 } | 302 } |
| 320 | 303 |
| 321 void RenderLayerCompositor::updateIfNeeded() | 304 void RenderLayerCompositor::updateIfNeeded() |
| 322 { | 305 { |
| 323 { | 306 { |
| 324 // FIXME: Notice that we call this function before checking the dirty bi
ts below. | 307 // FIXME: Notice that we call this function before checking the dirty bi
ts below. |
| 325 // We'll need to remove DeprecatedDirtyCompositingDuringCompositingUpdat
e | 308 // We'll need to remove DeprecatedDirtyCompositingDuringCompositingUpdat
e |
| 326 // before moving this function after checking the dirty bits. | 309 // before moving this function after checking the dirty bits. |
| 327 DeprecatedDirtyCompositingDuringCompositingUpdate marker(lifecycle()); | 310 DeprecatedDirtyCompositingDuringCompositingUpdate marker(lifecycle()); |
| 328 | 311 |
| 329 // FIXME: enableCompositingModeIfNeeded can call setCompositingLayersNee
dRebuild, | 312 // FIXME: enableCompositingModeIfNeeded can trigger a CompositingUpdateR
ebuildTree, |
| 330 // which asserts that it's not InCompositingUpdate. | 313 // which asserts that it's not InCompositingUpdate. |
| 331 enableCompositingModeIfNeeded(); | 314 enableCompositingModeIfNeeded(); |
| 332 } | 315 } |
| 333 | 316 |
| 334 CompositingUpdateType updateType = m_pendingUpdateType; | 317 CompositingUpdateType updateType = m_pendingUpdateType; |
| 335 bool needHierarchyAndGeometryUpdate = compositingLayersNeedRebuild(); | |
| 336 | |
| 337 m_pendingUpdateType = CompositingUpdateNone; | 318 m_pendingUpdateType = CompositingUpdateNone; |
| 338 m_compositingLayersNeedRebuild = false; | |
| 339 | 319 |
| 340 if (!hasAcceleratedCompositing()) | 320 if (!hasAcceleratedCompositing()) |
| 341 return; | 321 return; |
| 342 | 322 |
| 343 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling
Coordinator()->needsToUpdateAfterCompositingChange(); | 323 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling
Coordinator()->needsToUpdateAfterCompositingChange(); |
| 344 if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate &
& !needsToUpdateScrollingCoordinator) | 324 if (updateType == CompositingUpdateNone && !needsToUpdateScrollingCoordinato
r) |
| 345 return; | 325 return; |
| 346 | 326 |
| 347 GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpda
ter::DoNotForceUpdate; | |
| 348 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo
sitingPropertyUpdater::DoNotForceUpdate; | |
| 349 | |
| 350 RenderLayer* updateRoot = rootRenderLayer(); | 327 RenderLayer* updateRoot = rootRenderLayer(); |
| 351 | 328 |
| 352 Vector<RenderLayer*> layersNeedingRepaint; | 329 Vector<RenderLayer*> layersNeedingRepaint; |
| 353 | 330 |
| 354 if (updateType >= CompositingUpdateAfterCompositingInputChange) { | 331 if (updateType >= CompositingUpdateAfterCompositingInputChange) { |
| 355 bool layersChanged = false; | 332 bool layersChanged = false; |
| 356 { | 333 { |
| 357 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA
ncestorDependentProperties"); | 334 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA
ncestorDependentProperties"); |
| 358 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper
ties(updateRoot, compositingPropertyUpdateType); | 335 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper
ties(updateRoot); |
| 359 #if ASSERT_ENABLED | 336 #if ASSERT_ENABLED |
| 360 CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantProp
ertiesBitsCleared(updateRoot); | 337 CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantProp
ertiesBitsCleared(updateRoot); |
| 361 #endif | 338 #endif |
| 362 } | 339 } |
| 363 | 340 |
| 364 CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder).
update(updateRoot); | 341 CompositingRequirementsUpdater(m_renderView, m_compositingReasonFinder).
update(updateRoot); |
| 365 | 342 |
| 366 { | 343 { |
| 367 TRACE_EVENT0("blink_rendering", "CompositingLayerAssigner::assign"); | 344 TRACE_EVENT0("blink_rendering", "CompositingLayerAssigner::assign"); |
| 368 CompositingLayerAssigner(this).assign(updateRoot, layersChanged, lay
ersNeedingRepaint); | 345 CompositingLayerAssigner(this).assign(updateRoot, layersChanged, lay
ersNeedingRepaint); |
| 369 } | 346 } |
| 370 | 347 |
| 371 { | 348 { |
| 372 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateAfterC
ompositingChange"); | 349 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateAfterC
ompositingChange"); |
| 373 if (const FrameView::ScrollableAreaSet* scrollableAreas = m_renderVi
ew.frameView()->scrollableAreas()) { | 350 if (const FrameView::ScrollableAreaSet* scrollableAreas = m_renderVi
ew.frameView()->scrollableAreas()) { |
| 374 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas
->begin(); it != scrollableAreas->end(); ++it) | 351 for (FrameView::ScrollableAreaSet::iterator it = scrollableAreas
->begin(); it != scrollableAreas->end(); ++it) |
| 375 (*it)->updateAfterCompositingChange(); | 352 (*it)->updateAfterCompositingChange(); |
| 376 } | 353 } |
| 377 } | 354 } |
| 378 | 355 |
| 379 if (layersChanged) | 356 if (layersChanged) |
| 380 needHierarchyAndGeometryUpdate = true; | 357 updateType = std::max(updateType, CompositingUpdateRebuildTree); |
| 381 } | 358 } |
| 382 | 359 |
| 383 if (updateType != CompositingUpdateNone || needHierarchyAndGeometryUpdate) { | 360 if (updateType != CompositingUpdateNone) { |
| 384 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive")
; | 361 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive")
; |
| 385 GraphicsLayerUpdater updater; | 362 GraphicsLayerUpdater updater; |
| 386 updater.update(*updateRoot, graphicsLayerUpdateType); | 363 updater.update(*updateRoot); |
| 387 | 364 |
| 388 if (updater.needsRebuildTree()) | 365 if (updater.needsRebuildTree()) |
| 389 needHierarchyAndGeometryUpdate = true; | 366 updateType = std::max(updateType, CompositingUpdateRebuildTree); |
| 390 | 367 |
| 391 #if !ASSERT_DISABLED | 368 #if !ASSERT_DISABLED |
| 392 // FIXME: Move this check to the end of the compositing update. | 369 // FIXME: Move this check to the end of the compositing update. |
| 393 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat
eRoot); | 370 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat
eRoot); |
| 394 #endif | 371 #endif |
| 395 } | 372 } |
| 396 | 373 |
| 397 if (needHierarchyAndGeometryUpdate) { | 374 if (updateType >= CompositingUpdateRebuildTree) { |
| 398 // Update the hierarchy of the compositing layers. | |
| 399 GraphicsLayerVector childList; | 375 GraphicsLayerVector childList; |
| 400 { | 376 { |
| 401 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::rebuildTree")
; | 377 TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::rebuildTree")
; |
| 402 GraphicsLayerUpdater().rebuildTree(*updateRoot, childList); | 378 GraphicsLayerUpdater().rebuildTree(*updateRoot, childList); |
| 403 } | 379 } |
| 404 | 380 |
| 405 if (childList.isEmpty()) | 381 if (childList.isEmpty()) |
| 406 destroyRootLayer(); | 382 destroyRootLayer(); |
| 407 else | 383 else |
| 408 m_rootContentLayer->setChildren(childList); | 384 m_rootContentLayer->setChildren(childList); |
| 409 | 385 |
| 410 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) | 386 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) |
| 411 applyOverlayFullscreenVideoAdjustment(); | 387 applyOverlayFullscreenVideoAdjustment(); |
| 412 } | 388 } |
| 413 | 389 |
| 414 if (m_needsUpdateFixedBackground) { | 390 if (m_needsUpdateFixedBackground) { |
| 415 rootFixedBackgroundsChanged(); | 391 rootFixedBackgroundsChanged(); |
| 416 m_needsUpdateFixedBackground = false; | 392 m_needsUpdateFixedBackground = false; |
| 417 } | 393 } |
| 418 | 394 |
| 419 ASSERT(updateRoot || !compositingLayersNeedRebuild()); | |
| 420 | |
| 421 // The scrolling coordinator may realize that it needs updating while compos
iting was being updated in this function. | 395 // The scrolling coordinator may realize that it needs updating while compos
iting was being updated in this function. |
| 422 needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoor
dinator()->needsToUpdateAfterCompositingChange(); | 396 needsToUpdateScrollingCoordinator |= scrollingCoordinator() && scrollingCoor
dinator()->needsToUpdateAfterCompositingChange(); |
| 423 if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame()
&& scrollingCoordinator() && inCompositingMode()) | 397 if (needsToUpdateScrollingCoordinator && m_renderView.frame()->isMainFrame()
&& scrollingCoordinator() && inCompositingMode()) |
| 424 scrollingCoordinator()->updateAfterCompositingChange(); | 398 scrollingCoordinator()->updateAfterCompositingChange(); |
| 425 | 399 |
| 426 for (unsigned i = 0; i < layersNeedingRepaint.size(); i++) { | 400 for (unsigned i = 0; i < layersNeedingRepaint.size(); i++) { |
| 427 RenderLayer* layer = layersNeedingRepaint[i]; | 401 RenderLayer* layer = layersNeedingRepaint[i]; |
| 428 layer->repainter().computeRepaintRectsIncludingDescendants(); | 402 layer->repainter().computeRepaintRectsIncludingDescendants(); |
| 429 | 403 |
| 430 repaintOnCompositingChange(layer); | 404 repaintOnCompositingChange(layer); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 if (compositedLayerUpdate != NoCompositingStateChange) | 509 if (compositedLayerUpdate != NoCompositingStateChange) |
| 536 allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate); | 510 allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate); |
| 537 } | 511 } |
| 538 | 512 |
| 539 void RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, Upda
teLayerCompositingStateOptions options) | 513 void RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, Upda
teLayerCompositingStateOptions options) |
| 540 { | 514 { |
| 541 updateDirectCompositingReasons(layer); | 515 updateDirectCompositingReasons(layer); |
| 542 CompositingStateTransitionType compositedLayerUpdate = CompositingLayerAssig
ner(this).computeCompositedLayerUpdate(layer); | 516 CompositingStateTransitionType compositedLayerUpdate = CompositingLayerAssig
ner(this).computeCompositedLayerUpdate(layer); |
| 543 | 517 |
| 544 if (compositedLayerUpdate != NoCompositingStateChange) | 518 if (compositedLayerUpdate != NoCompositingStateChange) |
| 545 setCompositingLayersNeedRebuild(); | 519 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 546 | 520 |
| 547 if (options == UseChickenEggHacks) | 521 if (options == UseChickenEggHacks) |
| 548 applyUpdateLayerCompositingStateChickenEggHacks(layer, compositedLayerUp
date); | 522 applyUpdateLayerCompositingStateChickenEggHacks(layer, compositedLayerUp
date); |
| 549 } | 523 } |
| 550 | 524 |
| 551 void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer) | 525 void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer) |
| 552 { | 526 { |
| 553 // If the renderer is not attached yet, no need to repaint. | 527 // If the renderer is not attached yet, no need to repaint. |
| 554 if (layer->renderer() != &m_renderView && !layer->renderer()->parent()) | 528 if (layer->renderer() != &m_renderView && !layer->renderer()->parent()) |
| 555 return; | 529 return; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 567 | 541 |
| 568 LayoutPoint offset; | 542 LayoutPoint offset; |
| 569 layer->convertToLayerCoords(compositedAncestor, offset); | 543 layer->convertToLayerCoords(compositedAncestor, offset); |
| 570 LayoutRect repaintRect = rect; | 544 LayoutRect repaintRect = rect; |
| 571 repaintRect.moveBy(offset); | 545 repaintRect.moveBy(offset); |
| 572 compositedAncestor->repainter().setBackingNeedsRepaintInRect(repaintRect); | 546 compositedAncestor->repainter().setBackingNeedsRepaintInRect(repaintRect); |
| 573 } | 547 } |
| 574 | 548 |
| 575 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer*
/*child*/) | 549 void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer*
/*child*/) |
| 576 { | 550 { |
| 577 setCompositingLayersNeedRebuild(); | 551 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 578 } | 552 } |
| 579 | 553 |
| 580 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer*
child) | 554 void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer*
child) |
| 581 { | 555 { |
| 582 if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeing
Destroyed()) | 556 if (!child->hasCompositedLayerMapping() || parent->renderer()->documentBeing
Destroyed()) |
| 583 return; | 557 return; |
| 584 | 558 |
| 585 { | 559 { |
| 586 // FIXME: This is called from within RenderLayer::removeChild, which is
called from RenderObject::RemoveChild. | 560 // FIXME: This is called from within RenderLayer::removeChild, which is
called from RenderObject::RemoveChild. |
| 587 // There's no guarantee that compositor state is up to date. | 561 // There's no guarantee that compositor state is up to date. |
| 588 DisableCompositingQueryAsserts disabler; | 562 DisableCompositingQueryAsserts disabler; |
| 589 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp
ositedBounds()); | 563 repaintInCompositedAncestor(child, child->compositedLayerMapping()->comp
ositedBounds()); |
| 590 } | 564 } |
| 591 | 565 |
| 592 setCompositingLayersNeedRebuild(); | 566 setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 593 } | 567 } |
| 594 | 568 |
| 595 void RenderLayerCompositor::frameViewDidChangeLocation(const IntPoint& contentsO
ffset) | 569 void RenderLayerCompositor::frameViewDidChangeLocation(const IntPoint& contentsO
ffset) |
| 596 { | 570 { |
| 597 if (m_overflowControlsHostLayer) | 571 if (m_overflowControlsHostLayer) |
| 598 m_overflowControlsHostLayer->setPosition(contentsOffset); | 572 m_overflowControlsHostLayer->setPosition(contentsOffset); |
| 599 } | 573 } |
| 600 | 574 |
| 601 void RenderLayerCompositor::frameViewDidChangeSize() | 575 void RenderLayerCompositor::frameViewDidChangeSize() |
| 602 { | 576 { |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 } else if (graphicsLayer == m_scrollLayer.get()) { | 1304 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 1331 name = "LocalFrame Scrolling Layer"; | 1305 name = "LocalFrame Scrolling Layer"; |
| 1332 } else { | 1306 } else { |
| 1333 ASSERT_NOT_REACHED(); | 1307 ASSERT_NOT_REACHED(); |
| 1334 } | 1308 } |
| 1335 | 1309 |
| 1336 return name; | 1310 return name; |
| 1337 } | 1311 } |
| 1338 | 1312 |
| 1339 } // namespace WebCore | 1313 } // namespace WebCore |
| OLD | NEW |