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 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 DCHECK(found_render_target); | 336 DCHECK(found_render_target); |
337 } | 337 } |
338 | 338 |
339 template <typename LayerType> static inline bool IsRootLayer(LayerType* layer) { | 339 template <typename LayerType> static inline bool IsRootLayer(LayerType* layer) { |
340 return !layer->parent(); | 340 return !layer->parent(); |
341 } | 341 } |
342 | 342 |
343 template <typename LayerType> | 343 template <typename LayerType> |
344 static inline bool LayerIsInExisting3DRenderingContext(LayerType* layer) { | 344 static inline bool LayerIsInExisting3DRenderingContext(LayerType* layer) { |
345 return layer->Is3dSorted() && layer->parent() && | 345 return layer->Is3dSorted() && layer->parent() && |
346 layer->parent()->Is3dSorted(); | 346 layer->parent()->Is3dSorted() && |
| 347 (layer->parent()->sorting_context_id() == layer->sorting_context_id()); |
347 } | 348 } |
348 | 349 |
349 template <typename LayerType> | 350 template <typename LayerType> |
350 static bool IsRootLayerOfNewRenderingContext(LayerType* layer) { | 351 static bool IsRootLayerOfNewRenderingContext(LayerType* layer) { |
351 if (layer->parent()) | 352 if (layer->parent()) |
352 return !layer->parent()->Is3dSorted() && layer->Is3dSorted(); | 353 return !layer->parent()->Is3dSorted() && layer->Is3dSorted(); |
353 | 354 |
354 return layer->Is3dSorted(); | 355 return layer->Is3dSorted(); |
355 } | 356 } |
356 | 357 |
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 inputs->current_render_surface_layer_list_id); | 2559 inputs->current_render_surface_layer_list_id); |
2559 | 2560 |
2560 // The dummy layer list should not have been used. | 2561 // The dummy layer list should not have been used. |
2561 DCHECK_EQ(0u, dummy_layer_list.size()); | 2562 DCHECK_EQ(0u, dummy_layer_list.size()); |
2562 // A root layer render_surface should always exist after | 2563 // A root layer render_surface should always exist after |
2563 // CalculateDrawProperties. | 2564 // CalculateDrawProperties. |
2564 DCHECK(inputs->root_layer->render_surface()); | 2565 DCHECK(inputs->root_layer->render_surface()); |
2565 } | 2566 } |
2566 | 2567 |
2567 } // namespace cc | 2568 } // namespace cc |
OLD | NEW |