OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 ScopedPtrVector<SwapPromise> swap_promises; | 165 ScopedPtrVector<SwapPromise> swap_promises; |
166 }; | 166 }; |
167 | 167 |
168 template <typename LayerType> | 168 template <typename LayerType> |
169 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( | 169 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( |
170 LayerType* layer, | 170 LayerType* layer, |
171 int target_surface_layer_id) { | 171 int target_surface_layer_id) { |
172 // A layer will either contribute its own content, or its render surface's | 172 // A layer will either contribute its own content, or its render surface's |
173 // content, to the target surface. The layer contributes its surface's content | 173 // content, to the target surface. The layer contributes its surface's content |
174 // when both the following are true: | 174 // when both the following are true: |
175 // (1) The layer actually has a render surface, and | 175 // (1) The layer actually has a render surface and rendering into that |
| 176 // surface, and |
176 // (2) The layer's render surface is not the same as the target surface. | 177 // (2) The layer's render surface is not the same as the target surface. |
177 // | 178 // |
178 // Otherwise, the layer just contributes itself to the target surface. | 179 // Otherwise, the layer just contributes itself to the target surface. |
179 | 180 |
180 return layer->render_surface() && layer->id() != target_surface_layer_id; | 181 return layer->render_target() == layer && |
| 182 layer->id() != target_surface_layer_id; |
181 } | 183 } |
182 | 184 |
183 template <typename LayerType> | 185 template <typename LayerType> |
184 LayerType* LayerTreeHostCommon::FindLayerInSubtree(LayerType* root_layer, | 186 LayerType* LayerTreeHostCommon::FindLayerInSubtree(LayerType* root_layer, |
185 int layer_id) { | 187 int layer_id) { |
186 if (!root_layer) | 188 if (!root_layer) |
187 return NULL; | 189 return NULL; |
188 | 190 |
189 if (root_layer->id() == layer_id) | 191 if (root_layer->id() == layer_id) |
190 return root_layer; | 192 return root_layer; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 true, | 278 true, |
277 render_surface_layer_list, | 279 render_surface_layer_list, |
278 0) { | 280 0) { |
279 DCHECK(root_layer); | 281 DCHECK(root_layer); |
280 DCHECK(render_surface_layer_list); | 282 DCHECK(render_surface_layer_list); |
281 } | 283 } |
282 | 284 |
283 } // namespace cc | 285 } // namespace cc |
284 | 286 |
285 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 287 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
OLD | NEW |