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

Side by Side Diff: cc/trees/layer_tree.cc

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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698