| 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..833fcc4afcd45c512f7d5fef771cd574ed3fa807
|
| --- /dev/null
|
| +++ b/cc/trees/layer_tree.h
|
| @@ -0,0 +1,65 @@
|
| +// 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;
|
| +
|
| + void AddLayerShouldPushProperties(Layer* layer);
|
| + void RemoveLayerShouldPushProperties(Layer* layer);
|
| + std::unordered_set<Layer*>& LayersThatShouldPushProperties();
|
| +
|
| + 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_; }
|
| + bool& get_in_paint_layer_contents() { return in_paint_layer_contents_; }
|
| + void set_in_paint_layer_contents(bool value);
|
| +
|
| + 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_
|
|
|