OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_LAYERS_LAYER_PROTO_FACTORY_H_ |
| 6 #define CC_LAYERS_LAYER_PROTO_FACTORY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/layers/layer.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 namespace proto { |
| 15 class LayerNode; |
| 16 } |
| 17 |
| 18 // A helper class for finding or constructing layers during deserialization. |
| 19 class CC_EXPORT LayerProtoFactory { |
| 20 public: |
| 21 // Returns the Layer with proto.id() as the Layer id, if it exists in |
| 22 // |layer_id_map|. Otherwise, a new Layer is constructed of the type given |
| 23 // from proto.type(). |
| 24 static scoped_refptr<Layer> FindOrAllocateAndConstruct( |
| 25 const proto::LayerNode& proto, |
| 26 const Layer::LayerIdMap& layer_id_map); |
| 27 |
| 28 private: |
| 29 LayerProtoFactory() {} |
| 30 virtual ~LayerProtoFactory() {} |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(LayerProtoFactory); |
| 33 }; |
| 34 |
| 35 } // namespace cc |
| 36 |
| 37 #endif // CC_LAYERS_LAYER_PROTO_FACTORY_H_ |
OLD | NEW |