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

Unified Diff: cc/trees/layer_tree.h

Issue 2159513003: Setup LayerTree class, refactor 2 functions from LayerTreeHost to it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
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..0850afe681554f32aa445ce68931667d6e270327
--- /dev/null
+++ b/cc/trees/layer_tree.h
@@ -0,0 +1,46 @@
+// 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 Layer;
+
+using LayerSet = std::unordered_set<Layer*>;
+using LayerIdMap = std::unordered_map<int, Layer*>;
+
+class CC_EXPORT LayerTree {
Khushal 2016/07/18 16:59:33 I would suggest move Register/UnregisterLayer to t
xingliu 2016/07/19 22:47:38 Register/UnregisterLayer moved to LayerTree.
+ public:
+ LayerTree();
+ ~LayerTree();
+
+ void AddLayerShouldPushProperties(Layer* layer);
+ void RemoveLayerShouldPushProperties(Layer* layer);
+
+ void ToProtobuf(proto::LayerTree* proto);
+ void FromProtobuf(const proto::LayerTree& proto, LayerIdMap* layer_id_map);
Khushal 2016/07/18 16:59:32 The LayerIdMap would move to the LayerTree, wouldn
xingliu 2016/07/19 22:47:37 Done.
+ LayerSet& layers_that_should_push_properties();
Khushal 2016/07/18 16:59:33 You shouldn't have to expose this after you move t
xingliu 2016/07/19 22:47:37 Done.
+
+ private:
+ // Set of layers that need to push properties.
+ LayerSet layers_that_should_push_properties_;
+
+ DISALLOW_COPY_AND_ASSIGN(LayerTree);
+};
+
+} // namespace cc
+
+#endif // CC_TREES_LAYER_TREE_H_

Powered by Google App Engine
This is Rietveld 408576698