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

Side by Side Diff: cc/layers/layer_proto_factory.h

Issue 1398443008: Add support for (de)serializing cc::Layer hierarchy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@review-1394353002
Patch Set: Fixed CC_EXPORT Created 5 years, 2 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698