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

Side by Side Diff: cc/layers/layer_proto_converter.cc

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on another LTH refactor CL. Created 4 years, 4 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/layers/layer_list_iterator_unittest.cc ('k') | cc/test/fake_layer_tree_host.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/layers/layer_proto_converter.h" 5 #include "cc/layers/layer_proto_converter.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "cc/layers/empty_content_layer_client.h" 9 #include "cc/layers/empty_content_layer_client.h"
10 #include "cc/layers/heads_up_display_layer.h" 10 #include "cc/layers/heads_up_display_layer.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 DCHECK(iter != layer_id_map.end()); 78 DCHECK(iter != layer_id_map.end());
79 79
80 iter->second->FromLayerPropertiesProto(layer_properties); 80 iter->second->FromLayerPropertiesProto(layer_properties);
81 } 81 }
82 } 82 }
83 83
84 // static 84 // static
85 void LayerProtoConverter::RecursivelyFindAllLayers(Layer* root_layer, 85 void LayerProtoConverter::RecursivelyFindAllLayers(Layer* root_layer,
86 LayerIdMap* layer_id_map) { 86 LayerIdMap* layer_id_map) {
87 LayerTreeHostCommon::CallFunctionForEveryLayer( 87 LayerTreeHostCommon::CallFunctionForEveryLayer(
88 root_layer->layer_tree_host(), 88 root_layer->GetLayerTree(),
89 [layer_id_map](Layer* layer) { (*layer_id_map)[layer->id()] = layer; }); 89 [layer_id_map](Layer* layer) { (*layer_id_map)[layer->id()] = layer; });
90 } 90 }
91 91
92 // static 92 // static
93 scoped_refptr<Layer> LayerProtoConverter::FindOrAllocateAndConstruct( 93 scoped_refptr<Layer> LayerProtoConverter::FindOrAllocateAndConstruct(
94 const proto::LayerNode& proto, 94 const proto::LayerNode& proto,
95 const Layer::LayerIdMap& layer_id_map) { 95 const Layer::LayerIdMap& layer_id_map) {
96 DCHECK(proto.has_id()); 96 DCHECK(proto.has_id());
97 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id()); 97 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id());
98 if (iter != layer_id_map.end()) 98 if (iter != layer_id_map.end())
(...skipping 19 matching lines...) Expand all
118 return SolidColorScrollbarLayer::Create(ScrollbarOrientation::HORIZONTAL, 118 return SolidColorScrollbarLayer::Create(ScrollbarOrientation::HORIZONTAL,
119 -1, -1, false, Layer::INVALID_ID); 119 -1, -1, false, Layer::INVALID_ID);
120 } 120 }
121 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function 121 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function
122 // should not return null. 122 // should not return null.
123 NOTREACHED(); 123 NOTREACHED();
124 return nullptr; 124 return nullptr;
125 } 125 }
126 126
127 } // namespace cc 127 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/test/fake_layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698