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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 int target_surface_layer_id) { | 200 int target_surface_layer_id) { |
201 // A layer will either contribute its own content, or its render surface's | 201 // A layer will either contribute its own content, or its render surface's |
202 // content, to the target surface. The layer contributes its surface's content | 202 // content, to the target surface. The layer contributes its surface's content |
203 // when both the following are true: | 203 // when both the following are true: |
204 // (1) The layer actually has a render surface and rendering into that | 204 // (1) The layer actually has a render surface and rendering into that |
205 // surface, and | 205 // surface, and |
206 // (2) The layer's render surface is not the same as the target surface. | 206 // (2) The layer's render surface is not the same as the target surface. |
207 // | 207 // |
208 // Otherwise, the layer just contributes itself to the target surface. | 208 // Otherwise, the layer just contributes itself to the target surface. |
209 | 209 |
210 return layer->render_target() == layer && | 210 return layer->has_render_surface() && |
| 211 layer->render_target() == layer->render_surface() && |
211 layer->id() != target_surface_layer_id; | 212 layer->id() != target_surface_layer_id; |
212 } | 213 } |
213 | 214 |
214 template <typename LayerType, typename Function> | 215 template <typename LayerType, typename Function> |
215 static void CallFunctionForLayer(LayerType* layer, | 216 static void CallFunctionForLayer(LayerType* layer, |
216 const Function& function, | 217 const Function& function, |
217 const CallFunctionLayerType& type) { | 218 const CallFunctionLayerType& type) { |
218 function(layer); | 219 function(layer); |
219 | 220 |
220 LayerType* mask_layer = layer->mask_layer(); | 221 LayerType* mask_layer = layer->mask_layer(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 for (auto* layer : *host_impl) | 259 for (auto* layer : *host_impl) |
259 CallFunctionForLayer(layer, function, type); | 260 CallFunctionForLayer(layer, function, type); |
260 } | 261 } |
261 | 262 |
262 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); | 263 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); |
263 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); | 264 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); |
264 | 265 |
265 } // namespace cc | 266 } // namespace cc |
266 | 267 |
267 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 268 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
OLD | NEW |