OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #include "cc/layers/layer.h" |
| 6 #include "cc/proto/layer_tree.pb.h" |
| 7 #include "cc/trees/layer_tree.h" |
| 8 |
| 9 namespace cc { |
| 10 |
| 11 LayerTree::LayerTree() {} |
| 12 |
| 13 LayerTree::~LayerTree() {} |
| 14 |
| 15 void LayerTree::AddLayerShouldPushProperties(Layer* layer) { |
| 16 layers_that_should_push_properties_.insert(layer); |
| 17 } |
| 18 |
| 19 void LayerTree::RemoveLayerShouldPushProperties(Layer* layer) { |
| 20 layers_that_should_push_properties_.erase(layer); |
| 21 } |
| 22 |
| 23 LayerSet& LayerTree::layers_that_should_push_properties() { |
| 24 return layers_that_should_push_properties_; |
| 25 } |
| 26 |
| 27 void LayerTree::ToProtobuf(proto::LayerTree* proto) { |
| 28 for (auto layer : layers_that_should_push_properties_) { |
| 29 proto->add_layers_that_should_push_properties(layer->id()); |
| 30 } |
| 31 } |
| 32 |
| 33 void LayerTree::FromProtobuf(const proto::LayerTree& proto, |
| 34 LayerIdMap* layer_id_map) { |
| 35 for (auto layer_id : proto.layers_that_should_push_properties()) { |
| 36 AddLayerShouldPushProperties((*layer_id_map)[layer_id]); |
| 37 } |
| 38 } |
| 39 |
| 40 } // namespace cc |
OLD | NEW |