OLD | NEW |
---|---|
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/layer.h" | 9 #include "cc/layers/layer.h" |
9 #include "cc/layers/layer_settings.h" | 10 #include "cc/layers/layer_settings.h" |
11 #include "cc/layers/picture_layer.h" | |
10 #include "cc/proto/layer.pb.h" | 12 #include "cc/proto/layer.pb.h" |
11 #include "cc/trees/layer_tree_host_common.h" | 13 #include "cc/trees/layer_tree_host_common.h" |
12 #include "cc/trees/layer_tree_settings.h" | 14 #include "cc/trees/layer_tree_settings.h" |
13 | 15 |
14 namespace cc { | 16 namespace cc { |
15 | 17 |
16 LayerProtoConverter::LayerProtoConverter() {} | 18 LayerProtoConverter::LayerProtoConverter() {} |
17 | 19 |
18 LayerProtoConverter::~LayerProtoConverter() {} | 20 LayerProtoConverter::~LayerProtoConverter() {} |
19 | 21 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 const proto::LayerNode& proto, | 100 const proto::LayerNode& proto, |
99 const Layer::LayerIdMap& layer_id_map) { | 101 const Layer::LayerIdMap& layer_id_map) { |
100 DCHECK(proto.has_id()); | 102 DCHECK(proto.has_id()); |
101 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id()); | 103 Layer::LayerIdMap::const_iterator iter = layer_id_map.find(proto.id()); |
102 if (iter != layer_id_map.end()) | 104 if (iter != layer_id_map.end()) |
103 return iter->second; | 105 return iter->second; |
104 DCHECK(proto.has_type()); | 106 DCHECK(proto.has_type()); |
105 switch (proto.type()) { | 107 switch (proto.type()) { |
106 case proto::Base: | 108 case proto::Base: |
107 return Layer::Create(LayerSettings()).get(); | 109 return Layer::Create(LayerSettings()).get(); |
110 case proto::Picture: | |
vmpstr
2015/12/16 04:21:08
I think this should be PictureLayer (and maybe bas
David Trainor- moved to gerrit
2015/12/16 19:10:58
Done.
| |
111 return PictureLayer::Create(LayerSettings(), | |
112 EmptyContentLayerClient::GetInstance()); | |
108 } | 113 } |
109 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function | 114 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function |
110 // should not return null. | 115 // should not return null. |
111 NOTREACHED(); | 116 NOTREACHED(); |
112 return nullptr; | 117 return nullptr; |
113 } | 118 } |
114 | 119 |
115 } // namespace cc | 120 } // namespace cc |
OLD | NEW |