OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/layer.h" | 5 #include "cc/layer.h" |
6 | 6 |
7 #include "cc/active_animation.h" | 7 #include "cc/active_animation.h" |
8 #include "cc/animation_events.h" | 8 #include "cc/animation_events.h" |
9 #include "cc/layer_animation_controller.h" | 9 #include "cc/layer_animation_controller.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // values x and y, ceil((x / y) * y) may be x + 1. | 123 // values x and y, ceil((x / y) * y) may be x + 1. |
124 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 124 contentRect.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
125 return gfx::ToEnclosingRect(contentRect); | 125 return gfx::ToEnclosingRect(contentRect); |
126 } | 126 } |
127 | 127 |
128 bool Layer::blocksPendingCommit() const | 128 bool Layer::blocksPendingCommit() const |
129 { | 129 { |
130 return false; | 130 return false; |
131 } | 131 } |
132 | 132 |
| 133 bool Layer::blocksPendingCommitRecursive() const |
| 134 { |
| 135 if (blocksPendingCommit()) |
| 136 return true; |
| 137 if (maskLayer() && maskLayer()->blocksPendingCommitRecursive()) |
| 138 return true; |
| 139 if (replicaLayer() && replicaLayer()->blocksPendingCommitRecursive()) |
| 140 return true; |
| 141 for (size_t i = 0; i < m_children.size(); ++i) |
| 142 { |
| 143 if (m_children[i]->blocksPendingCommitRecursive()) |
| 144 return true; |
| 145 } |
| 146 return false; |
| 147 } |
| 148 |
133 void Layer::setParent(Layer* layer) | 149 void Layer::setParent(Layer* layer) |
134 { | 150 { |
135 DCHECK(!layer || !layer->hasAncestor(this)); | 151 DCHECK(!layer || !layer->hasAncestor(this)); |
136 m_parent = layer; | 152 m_parent = layer; |
137 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); | 153 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); |
138 | 154 |
139 forceAutomaticRasterScaleToBeRecomputed(); | 155 forceAutomaticRasterScaleToBeRecomputed(); |
140 } | 156 } |
141 | 157 |
142 bool Layer::hasAncestor(Layer* ancestor) const | 158 bool Layer::hasAncestor(Layer* ancestor) const |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 { | 861 { |
846 return 0; | 862 return 0; |
847 } | 863 } |
848 | 864 |
849 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) | 865 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped
_refptr<Layer> >::iterator, void*) |
850 { | 866 { |
851 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. | 867 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort Layers. |
852 } | 868 } |
853 | 869 |
854 } // namespace cc | 870 } // namespace cc |
OLD | NEW |