| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/compositing/CompositingInputsUpdater.h" | 5 #include "core/layout/compositing/CompositingInputsUpdater.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
| 11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
| 12 #include "core/layout/compositing/CompositedLayerMapping.h" | 12 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 13 #include "core/layout/compositing/PaintLayerCompositor.h" | 13 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 14 #include "core/page/scrolling/RootScrollerController.h" | |
| 15 #include "core/page/scrolling/TopDocumentRootScrollerController.h" | |
| 16 #include "core/paint/PaintLayer.h" | 14 #include "core/paint/PaintLayer.h" |
| 17 #include "platform/tracing/TraceEvent.h" | 15 #include "platform/tracing/TraceEvent.h" |
| 18 | 16 |
| 19 namespace blink { | 17 namespace blink { |
| 20 | 18 |
| 21 CompositingInputsUpdater::CompositingInputsUpdater(PaintLayer* rootLayer) | 19 CompositingInputsUpdater::CompositingInputsUpdater(PaintLayer* rootLayer) |
| 22 : m_geometryMap(UseTransforms), m_rootLayer(rootLayer) {} | 20 : m_geometryMap(UseTransforms), m_rootLayer(rootLayer) {} |
| 23 | 21 |
| 24 CompositingInputsUpdater::~CompositingInputsUpdater() {} | 22 CompositingInputsUpdater::~CompositingInputsUpdater() {} |
| 25 | 23 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 232 |
| 235 if (layer->scrollsOverflow()) | 233 if (layer->scrollsOverflow()) |
| 236 info.lastScrollingAncestor = layer; | 234 info.lastScrollingAncestor = layer; |
| 237 | 235 |
| 238 if (layer->layoutObject()->hasClipRelatedProperty()) | 236 if (layer->layoutObject()->hasClipRelatedProperty()) |
| 239 info.hasAncestorWithClipRelatedProperty = true; | 237 info.hasAncestorWithClipRelatedProperty = true; |
| 240 | 238 |
| 241 if (layer->layoutObject()->hasClipPath()) | 239 if (layer->layoutObject()->hasClipPath()) |
| 242 info.hasAncestorWithClipPath = true; | 240 info.hasAncestorWithClipPath = true; |
| 243 | 241 |
| 244 bool hasDescendantWithClipPath = false; | |
| 245 bool hasNonIsolatedDescendantWithBlendMode = false; | |
| 246 bool hasRootScrollerAsDescendant = false; | |
| 247 for (PaintLayer* child = layer->firstChild(); child; | 242 for (PaintLayer* child = layer->firstChild(); child; |
| 248 child = child->nextSibling()) { | 243 child = child->nextSibling()) |
| 249 updateRecursive(child, updateType, info); | 244 updateRecursive(child, updateType, info); |
| 250 | 245 |
| 251 hasRootScrollerAsDescendant |= child->hasRootScrollerAsDescendant() || | |
| 252 (child == | |
| 253 child->layoutObject() | |
| 254 ->document() | |
| 255 .rootScrollerController() | |
| 256 ->rootScrollerPaintLayer()); | |
| 257 hasDescendantWithClipPath |= child->hasDescendantWithClipPath() || | |
| 258 child->layoutObject()->hasClipPath(); | |
| 259 hasNonIsolatedDescendantWithBlendMode |= | |
| 260 (!child->stackingNode()->isStackingContext() && | |
| 261 child->hasNonIsolatedDescendantWithBlendMode()) || | |
| 262 child->layoutObject()->style()->hasBlendMode(); | |
| 263 } | |
| 264 | |
| 265 layer->updateDescendantDependentCompositingInputs( | |
| 266 hasDescendantWithClipPath, hasNonIsolatedDescendantWithBlendMode, | |
| 267 hasRootScrollerAsDescendant); | |
| 268 layer->didUpdateCompositingInputs(); | 246 layer->didUpdateCompositingInputs(); |
| 269 | 247 |
| 270 m_geometryMap.popMappingsToAncestor(layer->parent()); | 248 m_geometryMap.popMappingsToAncestor(layer->parent()); |
| 271 } | 249 } |
| 272 | 250 |
| 273 #if ENABLE(ASSERT) | 251 #if ENABLE(ASSERT) |
| 274 | 252 |
| 275 void CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared( | 253 void CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared( |
| 276 PaintLayer* layer) { | 254 PaintLayer* layer) { |
| 277 ASSERT(!layer->childNeedsCompositingInputsUpdate()); | 255 ASSERT(!layer->childNeedsCompositingInputsUpdate()); |
| 278 ASSERT(!layer->needsCompositingInputsUpdate()); | 256 ASSERT(!layer->needsCompositingInputsUpdate()); |
| 279 | 257 |
| 280 for (PaintLayer* child = layer->firstChild(); child; | 258 for (PaintLayer* child = layer->firstChild(); child; |
| 281 child = child->nextSibling()) | 259 child = child->nextSibling()) |
| 282 assertNeedsCompositingInputsUpdateBitsCleared(child); | 260 assertNeedsCompositingInputsUpdateBitsCleared(child); |
| 283 } | 261 } |
| 284 | 262 |
| 285 #endif | 263 #endif |
| 286 | 264 |
| 287 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |