| Index: cc/trees/layer_tree.cc
|
| diff --git a/cc/trees/layer_tree.cc b/cc/trees/layer_tree.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..237018ee24dd211fbdad0e09a6a9d50109fdd117
|
| --- /dev/null
|
| +++ b/cc/trees/layer_tree.cc
|
| @@ -0,0 +1,40 @@
|
| +// 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.
|
| +
|
| +#include "cc/layers/layer.h"
|
| +#include "cc/proto/layer_tree.pb.h"
|
| +#include "cc/trees/layer_tree.h"
|
| +
|
| +namespace cc {
|
| +
|
| +LayerTree::LayerTree() {}
|
| +
|
| +LayerTree::~LayerTree() {}
|
| +
|
| +void LayerTree::AddLayerShouldPushProperties(Layer* layer) {
|
| + layers_that_should_push_properties_.insert(layer);
|
| +}
|
| +
|
| +void LayerTree::RemoveLayerShouldPushProperties(Layer* layer) {
|
| + layers_that_should_push_properties_.erase(layer);
|
| +}
|
| +
|
| +LayerSet& LayerTree::layers_that_should_push_properties() {
|
| + return layers_that_should_push_properties_;
|
| +}
|
| +
|
| +void LayerTree::ToProtobuf(proto::LayerTree* proto) {
|
| + for (auto layer : layers_that_should_push_properties_) {
|
| + proto->add_layers_that_should_push_properties(layer->id());
|
| + }
|
| +}
|
| +
|
| +void LayerTree::FromProtobuf(const proto::LayerTree& proto,
|
| + LayerIdMap* layer_id_map) {
|
| + for (auto layer_id : proto.layers_that_should_push_properties()) {
|
| + AddLayerShouldPushProperties((*layer_id_map)[layer_id]);
|
| + }
|
| +}
|
| +
|
| +} // namespace cc
|
|
|