Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: Source/core/rendering/compositing/CompositingPropertyUpdater.cpp

Issue 213773002: Make compositing updates 30.7% faster for calculator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ASSERT Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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->childNeedsToUpdateAncestorDependantProperties() && updateType != 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 m_geometryMap.popMappingsToAncestor(layer->parent());
44
45 layer->clearChildNeedsToUpdateAncestorDependantProperties();
46 }
47
48 #if !ASSERT_DISABLED
49
50 void CompositingPropertyUpdater::assertNeedsToUpdateAncestorDependantPropertiesB itsCleared(RenderLayer* layer)
51 {
52 ASSERT(!layer->childNeedsToUpdateAncestorDependantProperties());
53 ASSERT(!layer->needsToUpdateAncestorDependentProperties());
54
55 for (RenderLayer* child = layer->firstChild(); child; child = child->nextSib ling())
56 assertNeedsToUpdateAncestorDependantPropertiesBitsCleared(child);
57 }
58
59 #endif
60
61 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698