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/empty_content_layer_client.h" |
| 9 #include "cc/layers/heads_up_display_layer.h" |
9 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
10 #include "cc/layers/layer_settings.h" | 11 #include "cc/layers/layer_settings.h" |
11 #include "cc/layers/picture_layer.h" | 12 #include "cc/layers/picture_layer.h" |
12 #include "cc/proto/layer.pb.h" | 13 #include "cc/proto/layer.pb.h" |
13 #include "cc/trees/layer_tree_host_common.h" | 14 #include "cc/trees/layer_tree_host_common.h" |
14 #include "cc/trees/layer_tree_settings.h" | 15 #include "cc/trees/layer_tree_settings.h" |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 | 18 |
18 LayerProtoConverter::LayerProtoConverter() {} | 19 LayerProtoConverter::LayerProtoConverter() {} |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 switch (proto.type()) { | 110 switch (proto.type()) { |
110 // Fall through and build a base layer. This won't have any special layer | 111 // Fall through and build a base layer. This won't have any special layer |
111 // properties but still maintains the layer hierarchy if we run into a | 112 // properties but still maintains the layer hierarchy if we run into a |
112 // layer type we don't support. | 113 // layer type we don't support. |
113 case proto::UNKNOWN: | 114 case proto::UNKNOWN: |
114 case proto::LAYER: | 115 case proto::LAYER: |
115 return Layer::Create(LayerSettings()).get(); | 116 return Layer::Create(LayerSettings()).get(); |
116 case proto::PICTURE_LAYER: | 117 case proto::PICTURE_LAYER: |
117 return PictureLayer::Create(LayerSettings(), | 118 return PictureLayer::Create(LayerSettings(), |
118 EmptyContentLayerClient::GetInstance()); | 119 EmptyContentLayerClient::GetInstance()); |
| 120 case proto::HEADS_UP_DISPLAY_LAYER: |
| 121 return HeadsUpDisplayLayer::Create(LayerSettings()); |
119 } | 122 } |
120 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function | 123 // TODO(nyquist): Add the rest of the necessary LayerTypes. This function |
121 // should not return null. | 124 // should not return null. |
122 NOTREACHED(); | 125 NOTREACHED(); |
123 return nullptr; | 126 return nullptr; |
124 } | 127 } |
125 | 128 |
126 } // namespace cc | 129 } // namespace cc |
OLD | NEW |