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

Unified Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 2183403002: cc: Move data to LayerTree from LayerTreeHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@layer_tree_change
Patch Set: remove unused test file. Created 4 years, 4 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/layers/scrollbar_layer_unittest.cc
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index d44865c90caecfa96891e3f7e63b8075b6001272..d6f5a262cb6f529990b0763d9c0364ace210948c 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -121,6 +121,7 @@ class ScrollbarLayerTest : public testing::Test {
layer_tree_host_.reset(
new FakeResourceTrackingLayerTreeHost(&fake_client_, &params));
+ layer_tree_ = layer_tree_host_->GetLayerTree();
layer_tree_host_->SetVisible(true);
fake_client_.SetLayerTreeHost(layer_tree_host_.get());
// Force output surface creation for renderer capabilities.
@@ -160,6 +161,7 @@ class ScrollbarLayerTest : public testing::Test {
TestTaskGraphRunner task_graph_runner_;
LayerTreeSettings layer_tree_settings_;
std::unique_ptr<FakeResourceTrackingLayerTreeHost> layer_tree_host_;
+ LayerTree* layer_tree_;
int scrollbar_layer_id_;
};
@@ -221,7 +223,7 @@ TEST_F(ScrollbarLayerTest, ScrollOffsetSynchronization) {
scroll_layer->SetBounds(gfx::Size(100, 200));
content_layer->SetBounds(gfx::Size(100, 200));
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
layer_tree_root->AddChild(scroll_layer);
scroll_layer->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
@@ -229,7 +231,6 @@ TEST_F(ScrollbarLayerTest, ScrollOffsetSynchronization) {
layer_tree_root->SavePaintProperties();
content_layer->SavePaintProperties();
-
layer_tree_host_->UpdateLayers();
LayerImpl* layer_impl_tree_root =
layer_tree_host_->CommitAndCreateLayerImplTree();
@@ -290,7 +291,7 @@ TEST_F(ScrollbarLayerTest, UpdatePropertiesOfScrollBarWhenThumbRemoved) {
root_layer->SetBounds(gfx::Size(100, 50));
content_layer->SetBounds(gfx::Size(100, 50));
- layer_tree_host_->SetRootLayer(root_clip_layer);
+ layer_tree_->SetRootLayer(root_clip_layer);
root_clip_layer->AddChild(root_layer);
root_layer->AddChild(content_layer);
root_layer->AddChild(scrollbar_layer);
@@ -329,7 +330,7 @@ TEST_F(ScrollbarLayerTest, ThumbRect) {
root_layer->SetBounds(gfx::Size(100, 50));
content_layer->SetBounds(gfx::Size(100, 50));
- layer_tree_host_->SetRootLayer(root_clip_layer);
+ layer_tree_->SetRootLayer(root_clip_layer);
root_clip_layer->AddChild(root_layer);
root_layer->AddChild(content_layer);
root_layer->AddChild(scrollbar_layer);
@@ -474,7 +475,7 @@ TEST_F(ScrollbarLayerTest, LayerDrivenSolidColorDrawQuads) {
scroll_layer->AddChild(child1);
scroll_layer->InsertChild(child2, 1);
layer_tree_root->AddChild(scroll_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
// Choose layer bounds to give max_scroll_offset = (8, 8).
layer_tree_root->SetBounds(gfx::Size(2, 2));
@@ -527,7 +528,7 @@ TEST_F(ScrollbarLayerTest, ScrollbarLayerOpacity) {
scroll_layer->AddChild(child1);
scroll_layer->InsertChild(scrollbar_layer, 1);
layer_tree_root->AddChild(scroll_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
// Choose layer bounds to give max_scroll_offset = (8, 8).
layer_tree_root->SetBounds(gfx::Size(2, 2));
@@ -536,18 +537,18 @@ TEST_F(ScrollbarLayerTest, ScrollbarLayerOpacity) {
// Building property trees twice shouldn't change the size of
// PropertyTrees::always_use_active_tree_opacity_effect_ids.
layer_tree_host_->BuildPropertyTreesForTesting();
- EXPECT_EQ(layer_tree_host_->property_trees()
+ EXPECT_EQ(layer_tree_->property_trees()
->always_use_active_tree_opacity_effect_ids.size(),
1u);
- layer_tree_host_->property_trees()->needs_rebuild = true;
+ layer_tree_->property_trees()->needs_rebuild = true;
layer_tree_host_->BuildPropertyTreesForTesting();
- EXPECT_EQ(layer_tree_host_->property_trees()
+ EXPECT_EQ(layer_tree_->property_trees()
->always_use_active_tree_opacity_effect_ids.size(),
1u);
// A solid color scrollbar layer's opacity is initialized to 0 on main thread
layer_tree_host_->UpdateLayers();
- EffectNode* node = layer_tree_host_->property_trees()->effect_tree.Node(
+ EffectNode* node = layer_tree_->property_trees()->effect_tree.Node(
scrollbar_layer->effect_tree_index());
EXPECT_EQ(node->opacity, 0.f);
@@ -609,7 +610,7 @@ TEST_F(ScrollbarLayerTest, ScrollbarLayerPushProperties) {
scroll_layer->AddChild(child1);
scroll_layer->InsertChild(scrollbar_layer, 1);
layer_tree_root->AddChild(scroll_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
layer_tree_root->SetBounds(gfx::Size(2, 2));
scroll_layer->SetBounds(gfx::Size(10, 10));
@@ -746,7 +747,7 @@ class ScrollbarLayerTestWithFixedScrollbarBounds : public LayerTreeTest {
void BeginTest() override {
scroll_layer_ = Layer::Create();
- layer_tree_host()->root_layer()->AddChild(scroll_layer_);
+ layer_tree()->root_layer()->AddChild(scroll_layer_);
std::unique_ptr<Scrollbar> scrollbar(new FakeScrollbar);
scrollbar_layer_ = PaintedScrollbarLayer::Create(std::move(scrollbar),
@@ -755,7 +756,7 @@ class ScrollbarLayerTestWithFixedScrollbarBounds : public LayerTreeTest {
scrollbar_layer_->SetLayerTreeHost(layer_tree_host());
scrollbar_layer_->SetBounds(bounds_);
scrollbar_layer_->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
+ layer_tree()->root_layer()->AddChild(scrollbar_layer_);
PostSetNeedsCommitToMainThread();
}
@@ -817,7 +818,7 @@ class ScrollbarLayerTestResourceCreationAndRelease : public ScrollbarLayerTest {
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
scrollbar_layer->SetIsDrawable(true);
scrollbar_layer->SetBounds(gfx::Size(100, 100));
@@ -873,7 +874,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
scrollbar_layer->SetIsDrawable(true);
scrollbar_layer->SetBounds(gfx::Size(100, 15));
@@ -1015,7 +1016,7 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest {
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
scrollbar_layer->SetIsDrawable(true);
scrollbar_layer->SetBounds(gfx::Size(100, 15));
@@ -1028,7 +1029,7 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest {
testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
- layer_tree_host_->SetDeviceScaleFactor(test_scale);
+ layer_tree_->SetDeviceScaleFactor(test_scale);
scrollbar_layer->SavePaintProperties();
scrollbar_layer->Update();
@@ -1085,7 +1086,7 @@ class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest {
layer_tree_root->AddChild(scrollbar_layer);
- layer_tree_host_->SetRootLayer(layer_tree_root);
+ layer_tree_->SetRootLayer(layer_tree_root);
scrollbar_layer->SetBounds(scrollbar_rect.size());
scrollbar_layer->SetPosition(gfx::PointF(scrollbar_rect.origin()));
@@ -1093,7 +1094,7 @@ class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest {
scrollbar_layer->fake_scrollbar()->set_track_rect(scrollbar_rect);
scrollbar_layer->set_visible_layer_rect(scrollbar_rect);
- layer_tree_host_->SetDeviceScaleFactor(test_scale);
+ layer_tree_->SetDeviceScaleFactor(test_scale);
gfx::Rect screen_space_clip_rect;
scrollbar_layer->SavePaintProperties();

Powered by Google App Engine
This is Rietveld 408576698