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

Side by Side Diff: cc/trees/layer_tree_host_common.cc

Issue 946813003: Check context id when deciding if a layer is in existing sorting context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unit test Created 5 years, 10 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | cc/trees/layer_tree_host_common_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698