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

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

Issue 1918593002: cc : Stop pushing properties not used by LayerImpl to LayerImpl (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « cc/test/layer_tree_host_common_test.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/draw_property_utils.h" 5 #include "cc/trees/draw_property_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 29 matching lines...) Expand all
40 return layer->layer_tree_host()->LayerById(node->owner_id); 40 return layer->layer_tree_host()->LayerById(node->owner_id);
41 } 41 }
42 42
43 static LayerImpl* EffectNodeOwner(LayerImpl* layer) { 43 static LayerImpl* EffectNodeOwner(LayerImpl* layer) {
44 EffectNode* node = 44 EffectNode* node =
45 layer->layer_tree_impl()->property_trees()->effect_tree.Node( 45 layer->layer_tree_impl()->property_trees()->effect_tree.Node(
46 layer->effect_tree_index()); 46 layer->effect_tree_index());
47 return layer->layer_tree_impl()->LayerById(node->owner_id); 47 return layer->layer_tree_impl()->LayerById(node->owner_id);
48 } 48 }
49 49
50 static void inline ValidateIsNotRootForIsolatedGroup(Layer* layer) {
51 DCHECK(!layer->is_root_for_isolated_group()) << "layer: " << layer->id();
52 }
53
54 static void inline ValidateIsNotRootForIsolatedGroup(LayerImpl* layer) {}
55
50 template <typename LayerType> 56 template <typename LayerType>
51 static void ValidateRenderSurfaceForLayer(LayerType* layer) { 57 static void ValidateRenderSurfaceForLayer(LayerType* layer) {
52 // This test verifies that there are no cases where a LayerImpl needs 58 // This test verifies that there are no cases where a LayerImpl needs
53 // a render surface, but doesn't have one. 59 // a render surface, but doesn't have one.
54 if (layer->has_render_surface()) 60 if (layer->has_render_surface())
55 return; 61 return;
56 62
57 DCHECK(layer->filters().IsEmpty()) << "layer: " << layer->id(); 63 DCHECK(layer->filters().IsEmpty()) << "layer: " << layer->id();
58 DCHECK(layer->background_filters().IsEmpty()) << "layer: " << layer->id(); 64 DCHECK(layer->background_filters().IsEmpty()) << "layer: " << layer->id();
59 DCHECK(!IsRootLayer(layer)) << "layer: " << layer->id(); 65 DCHECK(!IsRootLayer(layer)) << "layer: " << layer->id();
60 if (EffectNodeOwner(layer)->replica_layer() == layer) 66 if (EffectNodeOwner(layer)->replica_layer() == layer)
61 return; 67 return;
62 DCHECK(!layer->mask_layer()) << "layer: " << layer->id(); 68 DCHECK(!layer->mask_layer()) << "layer: " << layer->id();
63 DCHECK(!layer->replica_layer()) << "layer: " << layer->id(); 69 DCHECK(!layer->replica_layer()) << "layer: " << layer->id();
64 DCHECK(!layer->is_root_for_isolated_group()) << "layer: " << layer->id();
65 DCHECK(!layer->HasCopyRequest()) << "layer: " << layer->id(); 70 DCHECK(!layer->HasCopyRequest()) << "layer: " << layer->id();
71 ValidateIsNotRootForIsolatedGroup(layer);
66 } 72 }
67 73
68 static void ValidateRenderSurfacesRecursive(Layer* layer) { 74 static void ValidateRenderSurfacesRecursive(Layer* layer) {
69 ValidateRenderSurfaceForLayer(layer); 75 ValidateRenderSurfaceForLayer(layer);
70 for (size_t i = 0; i < layer->children().size(); ++i) 76 for (size_t i = 0; i < layer->children().size(); ++i)
71 ValidateRenderSurfacesRecursive(layer->child_at(i)); 77 ValidateRenderSurfacesRecursive(layer->child_at(i));
72 } 78 }
73 #endif 79 #endif
74 80
75 template <typename LayerType> 81 template <typename LayerType>
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1129 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1124 const Layer* overscroll_elasticity_layer, 1130 const Layer* overscroll_elasticity_layer,
1125 const gfx::Vector2dF& elastic_overscroll) { 1131 const gfx::Vector2dF& elastic_overscroll) {
1126 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1132 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1127 elastic_overscroll); 1133 elastic_overscroll);
1128 } 1134 }
1129 1135
1130 } // namespace draw_property_utils 1136 } // namespace draw_property_utils
1131 1137
1132 } // namespace cc 1138 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_host_common_test.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698