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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 2080223010: cc: Clean up root_layer code in LTI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase++ 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
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/layer_utils_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 } 1726 }
1727 1727
1728 TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) { 1728 TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) {
1729 scoped_refptr<Layer> test_layer = Layer::Create(); 1729 scoped_refptr<Layer> test_layer = Layer::Create();
1730 std::unique_ptr<LayerImpl> impl_layer = 1730 std::unique_ptr<LayerImpl> impl_layer =
1731 LayerImpl::Create(host_impl_.active_tree(), 1); 1731 LayerImpl::Create(host_impl_.active_tree(), 1);
1732 1732
1733 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, 1733 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
1734 layer_tree_host_->SetRootLayer(test_layer)); 1734 layer_tree_host_->SetRootLayer(test_layer));
1735 1735
1736 host_impl_.active_tree()->SetRootLayer(std::move(impl_layer)); 1736 host_impl_.active_tree()->SetRootLayerForTesting(std::move(impl_layer));
1737 host_impl_.active_tree()->BuildLayerListForTesting(); 1737 host_impl_.active_tree()->BuildLayerListForTesting();
1738 LayerImpl* impl_layer_ptr = host_impl_.active_tree()->LayerById(1); 1738 LayerImpl* impl_layer_ptr = host_impl_.active_tree()->LayerById(1);
1739 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5)); 1739 test_layer->SetNeedsDisplayRect(gfx::Rect(5, 5));
1740 test_layer->PushPropertiesTo(impl_layer_ptr); 1740 test_layer->PushPropertiesTo(impl_layer_ptr);
1741 EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 5.f, 5.f), 1741 EXPECT_FLOAT_RECT_EQ(gfx::RectF(0.f, 0.f, 5.f, 5.f),
1742 impl_layer_ptr->update_rect()); 1742 impl_layer_ptr->update_rect());
1743 1743
1744 // The LayerImpl's update_rect() should be accumulated here, since we did not 1744 // The LayerImpl's update_rect() should be accumulated here, since we did not
1745 // do anything to clear it. 1745 // do anything to clear it.
1746 test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5)); 1746 test_layer->SetNeedsDisplayRect(gfx::Rect(10, 10, 5, 5));
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); 2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties());
2517 2517
2518 test_layer->PushPropertiesTo(impl_layer.get()); 2518 test_layer->PushPropertiesTo(impl_layer.get());
2519 2519
2520 EXPECT_EQ(2lu, impl_layer->element_id()); 2520 EXPECT_EQ(2lu, impl_layer->element_id());
2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); 2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties());
2522 } 2522 }
2523 2523
2524 } // namespace 2524 } // namespace
2525 } // namespace cc 2525 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/layer_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698