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/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBlock.h" | 9 #include "core/layout/LayoutBlock.h" |
9 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
10 #include "core/layout/compositing/CompositedLayerMapping.h" | 11 #include "core/layout/compositing/CompositedLayerMapping.h" |
11 #include "core/layout/compositing/PaintLayerCompositor.h" | 12 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 13 #include "core/page/scrolling/RootScrollerController.h" |
12 #include "core/paint/PaintLayer.h" | 14 #include "core/paint/PaintLayer.h" |
13 #include "platform/TraceEvent.h" | 15 #include "platform/TraceEvent.h" |
14 | 16 |
15 namespace blink { | 17 namespace blink { |
16 | 18 |
17 CompositingInputsUpdater::CompositingInputsUpdater(PaintLayer* rootLayer) | 19 CompositingInputsUpdater::CompositingInputsUpdater(PaintLayer* rootLayer) |
18 : m_geometryMap(UseTransforms) | 20 : m_geometryMap(UseTransforms) |
19 , m_rootLayer(rootLayer) | 21 , m_rootLayer(rootLayer) |
20 { | 22 { |
21 } | 23 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 info.lastScrollingAncestor = layer; | 190 info.lastScrollingAncestor = layer; |
189 | 191 |
190 if (layer->layoutObject()->hasClipRelatedProperty()) | 192 if (layer->layoutObject()->hasClipRelatedProperty()) |
191 info.hasAncestorWithClipRelatedProperty = true; | 193 info.hasAncestorWithClipRelatedProperty = true; |
192 | 194 |
193 if (layer->layoutObject()->hasClipPath()) | 195 if (layer->layoutObject()->hasClipPath()) |
194 info.hasAncestorWithClipPath = true; | 196 info.hasAncestorWithClipPath = true; |
195 | 197 |
196 bool hasDescendantWithClipPath = false; | 198 bool hasDescendantWithClipPath = false; |
197 bool hasNonIsolatedDescendantWithBlendMode = false; | 199 bool hasNonIsolatedDescendantWithBlendMode = false; |
| 200 bool hasRootScrollerAsDescendant = false; |
198 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) { | 201 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) { |
199 updateRecursive(child, updateType, info); | 202 updateRecursive(child, updateType, info); |
200 | 203 |
| 204 hasRootScrollerAsDescendant |= child->hasRootScrollerAsDescendant() || (
child == child->layoutObject()->document().rootScrollerController()->rootScrolle
rPaintLayer()); |
201 hasDescendantWithClipPath |= child->hasDescendantWithClipPath() || child
->layoutObject()->hasClipPath(); | 205 hasDescendantWithClipPath |= child->hasDescendantWithClipPath() || child
->layoutObject()->hasClipPath(); |
202 hasNonIsolatedDescendantWithBlendMode |= (!child->stackingNode()->isStac
kingContext() && child->hasNonIsolatedDescendantWithBlendMode()) || child->layou
tObject()->style()->hasBlendMode(); | 206 hasNonIsolatedDescendantWithBlendMode |= (!child->stackingNode()->isStac
kingContext() && child->hasNonIsolatedDescendantWithBlendMode()) || child->layou
tObject()->style()->hasBlendMode(); |
203 } | 207 } |
204 | 208 |
205 layer->updateDescendantDependentCompositingInputs(hasDescendantWithClipPath,
hasNonIsolatedDescendantWithBlendMode); | 209 layer->updateDescendantDependentCompositingInputs(hasDescendantWithClipPath,
hasNonIsolatedDescendantWithBlendMode, hasRootScrollerAsDescendant); |
206 layer->didUpdateCompositingInputs(); | 210 layer->didUpdateCompositingInputs(); |
207 | 211 |
208 m_geometryMap.popMappingsToAncestor(layer->parent()); | 212 m_geometryMap.popMappingsToAncestor(layer->parent()); |
209 } | 213 } |
210 | 214 |
211 #if ENABLE(ASSERT) | 215 #if ENABLE(ASSERT) |
212 | 216 |
213 void CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared(Pai
ntLayer* layer) | 217 void CompositingInputsUpdater::assertNeedsCompositingInputsUpdateBitsCleared(Pai
ntLayer* layer) |
214 { | 218 { |
215 ASSERT(!layer->childNeedsCompositingInputsUpdate()); | 219 ASSERT(!layer->childNeedsCompositingInputsUpdate()); |
216 ASSERT(!layer->needsCompositingInputsUpdate()); | 220 ASSERT(!layer->needsCompositingInputsUpdate()); |
217 | 221 |
218 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) | 222 for (PaintLayer* child = layer->firstChild(); child; child = child->nextSibl
ing()) |
219 assertNeedsCompositingInputsUpdateBitsCleared(child); | 223 assertNeedsCompositingInputsUpdateBitsCleared(child); |
220 } | 224 } |
221 | 225 |
222 #endif | 226 #endif |
223 | 227 |
224 } // namespace blink | 228 } // namespace blink |
OLD | NEW |