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

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

Issue 1783613004: CC Animation: Erase cc::LayerSettings everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eraseandroid
Patch Set: Rebase. Created 4 years, 9 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 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 "cc/layers/empty_content_layer_client.h" 8 #include "cc/layers/empty_content_layer_client.h"
9 #include "cc/layers/heads_up_display_layer.h" 9 #include "cc/layers/heads_up_display_layer.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
11 #include "cc/layers/layer_settings.h"
12 #include "cc/layers/picture_layer.h" 11 #include "cc/layers/picture_layer.h"
13 #include "cc/proto/layer.pb.h" 12 #include "cc/proto/layer.pb.h"
14 #include "cc/trees/layer_tree_host_common.h" 13 #include "cc/trees/layer_tree_host_common.h"
15 #include "cc/trees/layer_tree_settings.h" 14 #include "cc/trees/layer_tree_settings.h"
16 15
17 namespace cc { 16 namespace cc {
18 17
19 LayerProtoConverter::LayerProtoConverter() {} 18 LayerProtoConverter::LayerProtoConverter() {}
20 19
21 LayerProtoConverter::~LayerProtoConverter() {} 20 LayerProtoConverter::~LayerProtoConverter() {}
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id()); 105 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id());
107 if (iter != layer_id_map.end()) 106 if (iter != layer_id_map.end())
108 return iter->second; 107 return iter->second;
109 DCHECK(proto.has_type()); 108 DCHECK(proto.has_type());
110 switch (proto.type()) { 109 switch (proto.type()) {
111 // Fall through and build a base layer. This won't have any special layer 110 // Fall through and build a base layer. This won't have any special layer
112 // properties but still maintains the layer hierarchy if we run into a 111 // properties but still maintains the layer hierarchy if we run into a
113 // layer type we don't support. 112 // layer type we don't support.
114 case proto::LayerNode::UNKNOWN: 113 case proto::LayerNode::UNKNOWN:
115 case proto::LayerNode::LAYER: 114 case proto::LayerNode::LAYER:
116 return Layer::Create(LayerSettings()).get(); 115 return Layer::Create().get();
117 case proto::LayerNode::PICTURE_LAYER: 116 case proto::LayerNode::PICTURE_LAYER:
118 return PictureLayer::Create(LayerSettings(), 117 return PictureLayer::Create(EmptyContentLayerClient::GetInstance());
119 EmptyContentLayerClient::GetInstance());
120 case proto::LayerNode::HEADS_UP_DISPLAY_LAYER: 118 case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
121 return HeadsUpDisplayLayer::Create(LayerSettings()); 119 return HeadsUpDisplayLayer::Create();
122 } 120 }
123 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function 121 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function
124 // should not return null. 122 // should not return null.
125 NOTREACHED(); 123 NOTREACHED();
126 return nullptr; 124 return nullptr;
127 } 125 }
128 126
129 } // namespace cc 127 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698