OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "config.h" | |
6 #include "core/rendering/compositing/CompositingPropertyUpdater.h" | |
7 | |
8 #include "core/rendering/RenderLayer.h" | |
9 | |
10 namespace WebCore { | |
11 | |
12 CompositingPropertyUpdater::CompositingPropertyUpdater() | |
13 : m_geometryMap(UseTransforms) | |
14 { | |
15 } | |
16 | |
17 CompositingPropertyUpdater::~CompositingPropertyUpdater() | |
18 { | |
19 } | |
20 | |
21 void CompositingPropertyUpdater::updateAncestorDependentProperties(RenderLayer* layer, UpdateType updateType) | |
22 { | |
23 if (!layer->decendantNeedsToUpdateAncestorDependentProperties() && updateTyp e != ForceUpdate) | |
24 return; | |
25 | |
26 m_geometryMap.pushMappingsToAncestor(layer, layer->parent()); | |
27 | |
28 if (layer->needsToUpdateAncestorDependentProperties()) | |
29 updateType = ForceUpdate; | |
30 | |
31 if (updateType == ForceUpdate) { | |
32 RenderLayer::AncestorDependentProperties properties; | |
33 | |
34 if (!layer->isRootLayer()) | |
35 properties.absoluteBoundingBox = enclosingIntRect(m_geometryMap.abso luteRect(layer->overlapBounds())); | |
36 | |
37 layer->updateAncestorDependentProperties(properties); | |
38 } | |
39 | |
40 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling()) | |
41 updateAncestorDependentProperties(child, updateType); | |
42 | |
43 layer->clearDecendantNeedsToUpdateAncestorDependentProperties(); | |
ojan
2014/03/27 01:06:42
Nit: I'd put this line at the very end of this fun
abarth-chromium
2014/03/27 01:40:11
Ok. Maybe I should make a RAII for the geometry m
| |
44 | |
45 m_geometryMap.popMappingsToAncestor(layer->parent()); | |
46 } | |
47 | |
48 } // namespace WebCore | |
OLD | NEW |