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

Unified Diff: cc/trees/layer_tree_host_unittest_serialization.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: Remove external access to layer_id_map_ in LayerTree. 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_host_unittest_serialization.cc
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc
index becf0f304aaa27ea916c5bb3a03c9c5d14fdbc0e..df11dfe69cc497dcc883734fa5bbdde41b749c02 100644
--- a/cc/trees/layer_tree_host_unittest_serialization.cc
+++ b/cc/trees/layer_tree_host_unittest_serialization.cc
@@ -81,8 +81,9 @@ class LayerTreeHostSerializationTest : public testing::Test {
void TearDown() override {
// Need to reset |in_paint_layer_contents_| to tear down.
- layer_tree_host_src_->in_paint_layer_contents_ = false;
- layer_tree_host_dst_->in_paint_layer_contents_ = false;
+
+ layer_tree_host_src_->GetLayerTree()->set_in_paint_layer_contents(false);
+ layer_tree_host_dst_->GetLayerTree()->set_in_paint_layer_contents(false);
// Need to reset LayerTreeHost pointers before tear down.
layer_tree_host_src_ = nullptr;
@@ -99,9 +100,11 @@ class LayerTreeHostSerializationTest : public testing::Test {
void VerifySerializationAndDeserialization() {
proto::LayerTreeHost proto;
+ LayerTree* layer_tree_src = layer_tree_host_src_->GetLayerTree();
+ LayerTree* layer_tree_dst = layer_tree_host_dst_->GetLayerTree();
std::unordered_set<Layer*> layers_that_should_push_properties_src =
- layer_tree_host_src_->LayersThatShouldPushProperties();
+ layer_tree_src->LayersThatShouldPushProperties();
std::vector<std::unique_ptr<SwapPromise>> swap_promises;
layer_tree_host_src_->ToProtobufForCommit(&proto, &swap_promises);
layer_tree_host_dst_->FromProtobufForCommit(proto);
@@ -149,8 +152,8 @@ class LayerTreeHostSerializationTest : public testing::Test {
layer_tree_host_dst_->background_color_);
EXPECT_EQ(layer_tree_host_src_->has_transparent_background_,
layer_tree_host_dst_->has_transparent_background_);
- EXPECT_EQ(layer_tree_host_src_->in_paint_layer_contents_,
- layer_tree_host_dst_->in_paint_layer_contents_);
+ EXPECT_EQ(layer_tree_src->in_paint_layer_contents(),
+ layer_tree_dst->in_paint_layer_contents());
EXPECT_EQ(layer_tree_host_src_->id_, layer_tree_host_dst_->id_);
EXPECT_EQ(layer_tree_host_src_->next_commit_forces_redraw_,
layer_tree_host_dst_->next_commit_forces_redraw_);
@@ -281,8 +284,9 @@ class LayerTreeHostSerializationTest : public testing::Test {
// Set in_paint_layer_contents_ only after all calls to AddChild() have
// finished to ensure it's allowed to do so at that time.
- layer_tree_host_src_->in_paint_layer_contents_ =
- !layer_tree_host_src_->in_paint_layer_contents_;
+ LayerTree* layer_tree_src = layer_tree_host_src_->GetLayerTree();
+ layer_tree_src->set_in_paint_layer_contents(
+ layer_tree_src->in_paint_layer_contents());
LayerSelectionBound sel_bound;
sel_bound.edge_top = gfx::Point(14, 3);

Powered by Google App Engine
This is Rietveld 408576698