Index: cc/trees/layer_tree.h |
diff --git a/cc/trees/layer_tree.h b/cc/trees/layer_tree.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4f2c19684c81a8c7bba9053312bc741f9eeb9f20 |
--- /dev/null |
+++ b/cc/trees/layer_tree.h |
@@ -0,0 +1,67 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_TREES_LAYER_TREE_H_ |
+#define CC_TREES_LAYER_TREE_H_ |
+ |
+#include <unordered_map> |
+#include <unordered_set> |
+ |
+#include "base/macros.h" |
+#include "cc/base/cc_export.h" |
+ |
+namespace cc { |
+ |
+namespace proto { |
+class LayerTree; |
+class LayerUpdate; |
+} |
+ |
+class AnimationHost; |
+class Layer; |
+ |
+using LayerSet = std::unordered_set<Layer*>; |
+using LayerIdMap = std::unordered_map<int, Layer*>; |
+ |
+class CC_EXPORT LayerTree { |
+ public: |
+ explicit LayerTree(std::unique_ptr<AnimationHost> animation_host); |
+ ~LayerTree(); |
+ |
+ void RegisterLayer(Layer* layer); |
+ void UnregisterLayer(Layer* layer); |
+ Layer* LayerById(int id) const; |
+ bool UpdateLayers(const LayerList& update_layer_list, |
+ bool* content_is_suitable_for_gpu); |
+ |
+ void AddLayerShouldPushProperties(Layer* layer); |
+ void RemoveLayerShouldPushProperties(Layer* layer); |
+ std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
+ bool LayerNeedsPushPropertiesForTesting(Layer* layer) const; |
+ |
+ void ToProtobuf(proto::LayerTree* proto); |
+ void FromProtobuf(const proto::LayerTree& proto); |
+ |
+ AnimationHost* animation_host() const { return animation_host_.get(); } |
+ |
+ bool in_paint_layer_contents() const { return in_paint_layer_contents_; } |
+ void set_in_paint_layer_contents(bool value); |
Khushal
2016/07/20 21:29:48
Do we still need a setter for this? It should be s
|
+ |
+ private: |
+ // Set of layers that need to push properties. |
+ LayerSet layers_that_should_push_properties_; |
+ |
+ // Layer id to Layer map. |
+ LayerIdMap layer_id_map_; |
+ |
+ bool in_paint_layer_contents_; |
+ |
+ std::unique_ptr<AnimationHost> animation_host_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LayerTree); |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_TREES_LAYER_TREE_H_ |