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

Unified Diff: cc/trees/layer_tree_host_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: Missed one test. 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/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 1ea85c3050cdb81a94603547380607c5454175ec..83cd5acc1bdeaefe35d6ef8dd8ebd3fadc9cad36 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -267,7 +267,7 @@ class LayerTreeHostTestReadyToActivateNonEmpty
root_layer->SetBounds(gfx::Size(1024, 1024));
root_layer->SetIsDrawable(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer->bounds());
}
@@ -338,7 +338,7 @@ class LayerTreeHostTestReadyToDrawNonEmpty
root_layer->SetBounds(gfx::Size(1024, 1024));
root_layer->SetIsDrawable(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer->bounds());
}
@@ -377,7 +377,7 @@ class LayerTreeHostTestReadyToDrawVisibility : public LayerTreeHostTest {
client_.set_bounds(root_layer->bounds());
root_layer->SetIsDrawable(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
LayerTreeHostTest::SetupTree();
}
@@ -615,7 +615,7 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -637,8 +637,8 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
}
void DidCommitAndDrawFrame() override {
- SetBeforeValues(layer_tree_host()->root_layer());
- VerifyBeforeValues(layer_tree_host()->root_layer());
+ SetBeforeValues(layer_tree()->root_layer());
+ VerifyBeforeValues(layer_tree()->root_layer());
++index_;
if (index_ == DONE) {
@@ -646,7 +646,7 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
return;
}
- SetAfterValues(layer_tree_host()->root_layer());
+ SetAfterValues(layer_tree()->root_layer());
}
void AfterTest() override {}
@@ -710,7 +710,7 @@ class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest {
root_ = Layer::Create();
child_ = Layer::Create();
root_->AddChild(child_);
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -830,7 +830,7 @@ class LayerTreeHostTestDamageWithReplica : public LayerTreeHostTest {
protected:
void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -845,7 +845,7 @@ class LayerTreeHostTestDamageWithReplica : public LayerTreeHostTest {
break;
case 1:
scoped_refptr<Layer> replica_layer = Layer::Create();
- layer_tree_host()->root_layer()->SetReplicaLayer(replica_layer.get());
+ layer_tree()->root_layer()->SetReplicaLayer(replica_layer.get());
break;
}
}
@@ -885,7 +885,7 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
// This is to force the child to create a transform and effect node.
child_->SetForceRenderSurfaceForTesting(true);
root_->AddChild(child_);
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -906,10 +906,10 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
case 2:
// We rebuild property trees for this case to test the code path of
// damage status synchronization when property trees are different.
- layer_tree_host()->property_trees()->needs_rebuild = true;
+ layer_tree()->property_trees()->needs_rebuild = true;
break;
default:
- EXPECT_FALSE(layer_tree_host()->property_trees()->needs_rebuild);
+ EXPECT_FALSE(layer_tree()->property_trees()->needs_rebuild);
}
}
@@ -983,7 +983,7 @@ class LayerTreeHostTestEffectTreeSync : public LayerTreeHostTest {
protected:
void SetupTree() override {
root_ = Layer::Create();
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
blur_filter_.Append(FilterOperation::CreateBlurFilter(0.5f));
brightness_filter_.Append(FilterOperation::CreateBrightnessFilter(0.25f));
sepia_filter_.Append(FilterOperation::CreateSepiaFilter(0.75f));
@@ -993,7 +993,7 @@ class LayerTreeHostTestEffectTreeSync : public LayerTreeHostTest {
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void DidCommit() override {
- EffectTree& effect_tree = layer_tree_host()->property_trees()->effect_tree;
+ EffectTree& effect_tree = layer_tree()->property_trees()->effect_tree;
EffectNode* node = effect_tree.Node(root_->effect_tree_index());
switch (layer_tree_host()->source_frame_number()) {
case 1:
@@ -1091,7 +1091,7 @@ class LayerTreeHostTestTransformTreeSync : public LayerTreeHostTest {
protected:
void SetupTree() override {
root_ = Layer::Create();
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -1099,7 +1099,7 @@ class LayerTreeHostTestTransformTreeSync : public LayerTreeHostTest {
void DidCommit() override {
TransformTree& transform_tree =
- layer_tree_host()->property_trees()->transform_tree;
+ layer_tree()->property_trees()->transform_tree;
TransformNode* node = transform_tree.Node(root_->transform_tree_index());
gfx::Transform rotate10;
rotate10.Rotate(10.f);
@@ -1183,7 +1183,7 @@ class LayerTreeHostTestTransformTreeDamageIsUpdated : public LayerTreeHostTest {
root_->AddChild(child_);
child_->AddChild(grand_child_);
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -1250,7 +1250,7 @@ class LayerTreeHostTestSwitchMaskLayer : public LayerTreeHostTest {
mask_layer->SetBounds(gfx::Size(10, 10));
child->SetMaskLayer(mask_layer.get());
root->AddChild(std::move(child));
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -1265,19 +1265,17 @@ class LayerTreeHostTestSwitchMaskLayer : public LayerTreeHostTest {
// Root and mask layer should have the same source frame number as they
// will be in the layer update list but the child is not as it has empty
// bounds.
- EXPECT_EQ(mask_layer->paint_properties().source_frame_number,
- layer_tree_host()
- ->root_layer()
- ->paint_properties()
- .source_frame_number);
+ EXPECT_EQ(
+ mask_layer->paint_properties().source_frame_number,
+ layer_tree()->root_layer()->paint_properties().source_frame_number);
EXPECT_NE(mask_layer->paint_properties().source_frame_number,
- layer_tree_host()
+ layer_tree()
->root_layer()
->child_at(0)
->paint_properties()
.source_frame_number);
- layer_tree_host()->root_layer()->RemoveAllChildren();
- layer_tree_host()->root_layer()->SetMaskLayer(mask_layer.get());
+ layer_tree()->root_layer()->RemoveAllChildren();
+ layer_tree()->root_layer()->SetMaskLayer(mask_layer.get());
break;
}
}
@@ -1356,8 +1354,8 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest {
root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
- layer_tree_host()->SetRootLayer(root_layer_);
- layer_tree_host()->SetViewportSize(bounds_);
+ layer_tree()->SetRootLayer(root_layer_);
+ layer_tree()->SetViewportSize(bounds_);
PostSetNeedsCommitToMainThread();
client_.set_bounds(root_layer_->bounds());
}
@@ -1420,8 +1418,8 @@ class LayerTreeHostTestGpuRasterDeviceSizeChanged : public LayerTreeHostTest {
transform.Translate(10000.0, 10000.0);
root_layer_->SetTransform(transform);
root_layer_->SetBounds(bounds_);
- layer_tree_host()->SetRootLayer(root_layer_);
- layer_tree_host()->SetViewportSize(bounds_);
+ layer_tree()->SetRootLayer(root_layer_);
+ layer_tree()->SetViewportSize(bounds_);
PostSetNeedsCommitToMainThread();
client_.set_bounds(root_layer_->bounds());
@@ -1465,7 +1463,7 @@ class LayerTreeHostTestGpuRasterDeviceSizeChanged : public LayerTreeHostTest {
void DidCommitAndDrawFrame() override {
// On the second commit, resize the viewport.
if (num_draws_ == 1) {
- layer_tree_host()->SetViewportSize(gfx::Size(400, 64));
+ layer_tree()->SetViewportSize(gfx::Size(400, 64));
}
}
@@ -1498,7 +1496,7 @@ class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
scaled_layer_->SetBounds(gfx::Size(1, 1));
root_layer_->AddChild(scaled_layer_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
}
@@ -1554,7 +1552,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
root_layer_->AddChild(scrollbar_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
}
@@ -1572,7 +1570,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
// Changing the device scale factor causes a commit. It also changes
// the content bounds of |scrollbar_|, which should not generate
// a second commit as a result.
- layer_tree_host()->SetDeviceScaleFactor(4.f);
+ layer_tree()->SetDeviceScaleFactor(4.f);
break;
default:
// No extra commits.
@@ -1606,7 +1604,7 @@ class LayerTreeHostTestDeviceScaleFactorChange : public LayerTreeHostTest {
child_layer_->SetBounds(gfx::Size(10, 10));
root_layer_->AddChild(child_layer_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
}
@@ -1615,7 +1613,7 @@ class LayerTreeHostTestDeviceScaleFactorChange : public LayerTreeHostTest {
void DidCommit() override {
if (layer_tree_host()->source_frame_number() == 1)
- layer_tree_host()->SetDeviceScaleFactor(4.f);
+ layer_tree()->SetDeviceScaleFactor(4.f);
}
void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
@@ -1667,8 +1665,8 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
- layer_tree_host()->SetRootLayer(root_layer_);
- layer_tree_host()->SetViewportSize(bounds_);
+ layer_tree()->SetRootLayer(root_layer_);
+ layer_tree()->SetViewportSize(bounds_);
PostSetNeedsCommitToMainThread();
client_.set_bounds(root_layer_->bounds());
}
@@ -1760,7 +1758,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(50, 50));
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
// The initially transparent layer has a larger child layer, which is
// not initially drawn because of the this (parent) layer.
@@ -1864,7 +1862,7 @@ class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest {
child_layer_->SetContentsOpaque(true);
root_layer_->AddChild(child_layer_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
}
@@ -1954,17 +1952,17 @@ class LayerTreeHostTestCommit : public LayerTreeHostTest {
LayerTreeHostTestCommit() {}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
- layer_tree_host()->set_background_color(SK_ColorGRAY);
- layer_tree_host()->SetEventListenerProperties(
- EventListenerClass::kMouseWheel, EventListenerProperties::kPassive);
- layer_tree_host()->SetEventListenerProperties(
+ layer_tree()->SetViewportSize(gfx::Size(20, 20));
+ layer_tree()->set_background_color(SK_ColorGRAY);
+ layer_tree()->SetEventListenerProperties(EventListenerClass::kMouseWheel,
+ EventListenerProperties::kPassive);
+ layer_tree()->SetEventListenerProperties(
EventListenerClass::kTouchStartOrMove,
EventListenerProperties::kBlocking);
- layer_tree_host()->SetEventListenerProperties(
+ layer_tree()->SetEventListenerProperties(
EventListenerClass::kTouchEndOrCancel,
EventListenerProperties::kBlockingAndPassive);
- layer_tree_host()->SetHaveScrollEventHandlers(true);
+ layer_tree()->SetHaveScrollEventHandlers(true);
PostSetNeedsCommitToMainThread();
}
@@ -2001,8 +1999,8 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
: frame_count_with_pending_tree_(0) {}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
- layer_tree_host()->set_background_color(SK_ColorGRAY);
+ layer_tree()->SetViewportSize(gfx::Size(20, 20));
+ layer_tree()->set_background_color(SK_ColorGRAY);
PostSetNeedsCommitToMainThread();
}
@@ -2055,8 +2053,8 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
- layer_tree_host()->set_background_color(SK_ColorGRAY);
+ layer_tree()->SetViewportSize(gfx::Size(20, 20));
+ layer_tree()->set_background_color(SK_ColorGRAY);
PostSetNeedsCommitToMainThread();
}
@@ -2106,7 +2104,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
void SetupTree() override {
LayerTreeHostTest::SetupTree();
- Layer* root_layer = layer_tree_host()->root_layer();
+ Layer* root_layer = layer_tree()->root_layer();
scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(&client_);
layer->set_always_update_resources(true);
@@ -2119,7 +2117,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
CreateVirtualViewportLayers(root_layer, scroll_layer_, root_layer->bounds(),
root_layer->bounds(), layer_tree_host());
- layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
+ layer_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
client_.set_bounds(root_layer->bounds());
}
@@ -2132,7 +2130,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
float) override {
gfx::ScrollOffset offset = scroll_layer_->scroll_offset();
scroll_layer_->SetScrollOffset(ScrollOffsetWithDelta(offset, scroll_delta));
- layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
+ layer_tree()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
}
void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
@@ -2160,8 +2158,8 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
- layer_tree_host()->StartPageScaleAnimation(gfx::Vector2d(), false,
- 1.25f, base::TimeDelta());
+ layer_tree()->StartPageScaleAnimation(gfx::Vector2d(), false, 1.25f,
+ base::TimeDelta());
break;
}
}
@@ -2212,9 +2210,9 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
root_layer_ = FakePictureLayer::Create(&client_);
child_layer_ = FakePictureLayer::Create(&client_);
- layer_tree_host()->SetViewportSize(gfx::Size(60, 60));
- layer_tree_host()->SetDeviceScaleFactor(1.5);
- EXPECT_EQ(gfx::Size(60, 60), layer_tree_host()->device_viewport_size());
+ layer_tree()->SetViewportSize(gfx::Size(60, 60));
+ layer_tree()->SetDeviceScaleFactor(1.5);
+ EXPECT_EQ(gfx::Size(60, 60), layer_tree()->device_viewport_size());
root_layer_->AddChild(child_layer_);
@@ -2226,7 +2224,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
child_layer_->SetBounds(gfx::Size(10, 10));
client_.set_bounds(gfx::Size(10, 10));
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
PostSetNeedsCommitToMainThread();
client_.set_bounds(root_layer_->bounds());
@@ -2310,14 +2308,14 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
: num_commit_complete_(0), num_draw_layers_(0) {}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
- layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
+ layer_tree()->SetViewportSize(gfx::Size(10, 10));
+ layer_tree()->root_layer()->SetBounds(gfx::Size(10, 10));
layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(10, 10));
layer_->SetPosition(gfx::PointF(0.f, 0.f));
layer_->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer_);
+ layer_tree()->root_layer()->AddChild(layer_);
PostSetNeedsCommitToMainThread();
client_.set_bounds(layer_->bounds());
@@ -2493,7 +2491,7 @@ class LayerTreeHostTestLCDChange : public LayerTreeHostTest {
root_layer->SetBounds(gfx::Size(10, 10));
root_layer->SetContentsOpaque(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
// The expectations are based on the assumption that the default
// LCD settings are:
@@ -2512,11 +2510,11 @@ class LayerTreeHostTestLCDChange : public LayerTreeHostTest {
break;
case 2:
// Change layer opacity that should trigger lcd change.
- layer_tree_host()->root_layer()->SetOpacity(.5f);
+ layer_tree()->root_layer()->SetOpacity(.5f);
break;
case 3:
// Change layer opacity that should not trigger lcd change.
- layer_tree_host()->root_layer()->SetOpacity(1.f);
+ layer_tree()->root_layer()->SetOpacity(1.f);
break;
case 4:
EndTest();
@@ -2741,7 +2739,7 @@ class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
scoped_refptr<Layer> layer = PictureLayer::Create(&client_);
layer->SetTransform(gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
layer->SetBounds(gfx::Size(10, 10));
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
client_.set_bounds(layer->bounds());
}
@@ -2828,7 +2826,7 @@ class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest {
root_layer_->AddChild(parent_layer_);
parent_layer_->AddChild(child_layer_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
@@ -3171,7 +3169,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
switch (num_commits_) {
case 1:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
// Layers added to the tree get committed.
++expected_push_properties_root_;
++expected_push_properties_child_;
@@ -3183,12 +3181,12 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
// No layers need commit.
break;
case 3:
- layer_tree_host()->SetRootLayer(other_root_);
+ layer_tree()->SetRootLayer(other_root_);
// Layers added to the tree get committed.
++expected_push_properties_other_root_;
break;
case 4:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
// Layers added to the tree get committed.
++expected_push_properties_root_;
++expected_push_properties_child_;
@@ -3219,11 +3217,11 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
++expected_push_properties_grandchild_;
break;
case 10:
- layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
+ layer_tree()->SetViewportSize(gfx::Size(20, 20));
// No layers need commit.
break;
case 11:
- layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.8f, 1.1f);
+ layer_tree()->SetPageScaleFactorAndLimits(1.f, 0.8f, 1.1f);
// No layers need commit.
break;
case 12:
@@ -3499,7 +3497,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
root_->AddChild(scrollbar_layer_);
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
@@ -3517,10 +3515,8 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
scrollbar_layer_->SetBounds(gfx::Size(30, 30));
- EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(scrollbar_layer_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ scrollbar_layer_.get()));
layer_tree_host()->SetNeedsCommit();
scrollbar_layer_->reset_push_properties_count();
@@ -3551,12 +3547,11 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
child_ = PushPropertiesCountingLayer::Create();
root_->AddChild(child_);
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
void DidCommitAndDrawFrame() override {
- LayerTree* layer_tree = layer_tree_host()->GetLayerTree();
switch (layer_tree_host()->source_frame_number()) {
case 0:
break;
@@ -3566,9 +3561,9 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
// is made during this, however, it needs to be pushed in the upcoming
// commit.
EXPECT_FALSE(
- layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_FALSE(
- layer_tree->LayerNeedsPushPropertiesForTesting(child_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
EXPECT_EQ(0, root_->NumDescendantsThatDrawContent());
root_->reset_push_properties_count();
child_->reset_push_properties_count();
@@ -3577,19 +3572,19 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
EXPECT_EQ(0u, root_->push_properties_count());
EXPECT_EQ(0u, child_->push_properties_count());
EXPECT_TRUE(
- layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_TRUE(
- layer_tree->LayerNeedsPushPropertiesForTesting(child_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
break;
}
case 2:
EXPECT_EQ(1u, root_->push_properties_count());
EXPECT_EQ(1u, child_->push_properties_count());
EXPECT_FALSE(
- layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_FALSE(
- layer_tree->LayerNeedsPushPropertiesForTesting(child_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
EndTest();
break;
}
@@ -3655,25 +3650,17 @@ class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush
switch (last_source_frame_number) {
case 0:
// All layers will need push properties as we set their layer tree host
- layer_tree_host()->SetRootLayer(root_);
- EXPECT_TRUE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_TRUE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
+ layer_tree()->SetRootLayer(root_);
EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild1_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild2_.get()));
- EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild3_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild1_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild2_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild3_.get()));
break;
case 1:
EndTest();
@@ -3691,108 +3678,74 @@ class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
break;
case 1:
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
- EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild1_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild2_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild3_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild1_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild2_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild3_.get()));
grandchild1_->RemoveFromParent();
grandchild1_->SetPosition(gfx::PointF(1.f, 1.f));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild2_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild3_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild2_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild3_.get()));
child_->AddChild(grandchild1_);
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
- EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild1_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild2_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild3_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild1_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild2_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild3_.get()));
grandchild2_->SetPosition(gfx::PointF(1.f, 1.f));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
- EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild1_.get()));
- EXPECT_TRUE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild2_.get()));
EXPECT_FALSE(
- layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(grandchild3_.get()));
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
+ EXPECT_FALSE(
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild1_.get()));
+ EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild2_.get()));
+ EXPECT_FALSE(layer_tree()->LayerNeedsPushPropertiesForTesting(
+ grandchild3_.get()));
// grandchild2_ will still need a push properties.
grandchild1_->RemoveFromParent();
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_FALSE(
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
+ EXPECT_FALSE(
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
// grandchild3_ does not need a push properties, so recursing should
// no longer be needed.
grandchild2_->RemoveFromParent();
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(root_.get()));
- EXPECT_FALSE(layer_tree_host()
- ->GetLayerTree()
- ->LayerNeedsPushPropertiesForTesting(child_.get()));
+ EXPECT_FALSE(
+ layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
+ EXPECT_FALSE(
+ layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
EndTest();
break;
}
@@ -3809,7 +3762,7 @@ class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree->SetRootLayer(root_);
grandchild1_->set_persist_needs_push_properties(true);
grandchild2_->set_persist_needs_push_properties(true);
break;
@@ -3858,7 +3811,7 @@ class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree->SetRootLayer(root_);
break;
case 1:
EXPECT_FALSE(
@@ -3927,7 +3880,7 @@ class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree->SetRootLayer(root_);
break;
case 1:
EXPECT_FALSE(
@@ -3992,7 +3945,7 @@ class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree->SetRootLayer(root_);
break;
case 1:
EXPECT_FALSE(
@@ -4159,7 +4112,7 @@ class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw {
VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
video_layer->SetBounds(gfx::Size(10, 10));
video_layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(video_layer);
+ layer_tree()->root_layer()->AddChild(video_layer);
invalidate_layer_ = video_layer;
}
@@ -4189,7 +4142,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
child_layer_->SetIsDrawable(true);
parent_layer_->AddChild(child_layer_);
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
}
@@ -4243,7 +4196,7 @@ class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetBounds(gfx::Size(10, 10));
- layer_tree_host()->SetRootLayer(root_layer_);
+ layer_tree()->SetRootLayer(root_layer_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer_->bounds());
}
@@ -4251,7 +4204,7 @@ class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
void BeginTest() override {
// The viewport is empty, but we still need to update layers on the main
// thread.
- layer_tree_host()->SetViewportSize(gfx::Size(0, 0));
+ layer_tree()->SetViewportSize(gfx::Size(0, 0));
PostSetNeedsCommitToMainThread();
}
@@ -4302,10 +4255,10 @@ class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest {
content_layer->SetBounds(gfx::Size(10, 10));
inner_viewport_scroll_layer->AddChild(content_layer);
- layer_tree_host()->SetRootLayer(root_layer_);
- layer_tree_host()->RegisterViewportLayers(
- overscroll_elasticity_layer, page_scale_layer,
- inner_viewport_scroll_layer, nullptr);
+ layer_tree()->SetRootLayer(root_layer_);
+ layer_tree()->RegisterViewportLayers(overscroll_elasticity_layer,
+ page_scale_layer,
+ inner_viewport_scroll_layer, nullptr);
LayerTreeHostTest::SetupTree();
client_.set_bounds(content_layer->bounds());
}
@@ -4397,7 +4350,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
void SetupTree() override {
root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- layer_tree_host()->SetRootLayer(root_);
+ layer_tree()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_->bounds());
}
@@ -4650,9 +4603,9 @@ class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest {
layer_ = SolidColorLayer::Create();
layer_->SetIsDrawable(true);
layer_->SetBounds(gfx::Size(10, 10));
- layer_tree_host()->SetRootLayer(layer_);
+ layer_tree()->SetRootLayer(layer_);
gfx::Size bounds(100, 100);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetViewportSize(bounds);
PostSetNeedsCommitToMainThread();
}
@@ -4745,9 +4698,9 @@ class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest {
layer_ = SolidColorLayer::Create();
layer_->SetIsDrawable(true);
layer_->SetBounds(gfx::Size(10, 10));
- layer_tree_host()->SetRootLayer(layer_);
+ layer_tree()->SetRootLayer(layer_);
gfx::Size bounds(100, 100);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetViewportSize(bounds);
PostSetNeedsCommitToMainThread();
}
@@ -5024,7 +4977,7 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
void SetupTree() override {
LayerTreeHostTest::SetupTree();
ui_resource_ = FakeScopedUIResource::Create(layer_tree_host());
- client_.set_bounds(layer_tree_host()->root_layer()->bounds());
+ client_.set_bounds(layer_tree()->root_layer()->bounds());
}
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
@@ -5080,7 +5033,7 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
layer_client_.set_bounds(layer_->bounds());
}
@@ -5134,7 +5087,7 @@ class LayerTreeHostTestEmptyLayerGpuRasterization : public LayerTreeHostTest {
layer_ = layer.get();
layer->SetBounds(gfx::Size());
layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
layer_client_.set_bounds(layer->bounds());
}
@@ -5190,7 +5143,7 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
layer_client_.set_bounds(layer_->bounds());
}
@@ -5260,7 +5213,7 @@ class LayerTreeHostTestGpuRasterizationReenabled : public LayerTreeHostTest {
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
layer_client_.set_bounds(layer_->bounds());
}
@@ -5343,7 +5296,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(layer);
+ layer_tree()->root_layer()->AddChild(layer);
layer_client_.set_bounds(layer_->bounds());
}
@@ -5679,7 +5632,7 @@ class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
: deltas_sent_to_client_(false) {}
void BeginTest() override {
- layer_tree_host()->SetRootLayer(nullptr);
+ layer_tree()->SetRootLayer(nullptr);
info_.page_scale_delta = 3.14f;
info_.top_controls_delta = 2.73f;
@@ -5687,7 +5640,7 @@ class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
}
void BeginMainFrame(const BeginFrameArgs& args) override {
- EXPECT_EQ(nullptr, layer_tree_host()->root_layer());
+ EXPECT_EQ(nullptr, layer_tree()->root_layer());
layer_tree_host()->ApplyScrollAndScale(&info_);
EndTest();
@@ -5745,10 +5698,10 @@ class LayerTreeHostTestCrispUpAfterPinchEnds : public LayerTreeHostTest {
// pinch.
pinch->AddChild(layer);
- layer_tree_host()->RegisterViewportLayers(NULL, page_scale_layer, pinch,
- nullptr);
- layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f);
- layer_tree_host()->SetRootLayer(root_clip);
+ layer_tree()->RegisterViewportLayers(NULL, page_scale_layer, pinch,
+ nullptr);
+ layer_tree()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f);
+ layer_tree()->SetRootLayer(root_clip);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_clip->bounds());
}
@@ -5946,7 +5899,7 @@ class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest {
layer->SetContentsOpaque(true);
root->AddChild(layer);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -5987,9 +5940,9 @@ class GpuRasterizationRasterizesBorderTiles : public LayerTreeHostTest {
client_.set_bounds(root->bounds());
root->SetContentsOpaque(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
- layer_tree_host()->SetViewportSize(viewport_size_);
+ layer_tree()->SetViewportSize(viewport_size_);
client_.set_bounds(root->bounds());
}
@@ -6047,10 +6000,10 @@ class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles
// pinch.
pinch->AddChild(layer);
- layer_tree_host()->RegisterViewportLayers(NULL, page_scale_layer, pinch,
- nullptr);
- layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f);
- layer_tree_host()->SetRootLayer(root_clip);
+ layer_tree()->RegisterViewportLayers(NULL, page_scale_layer, pinch,
+ nullptr);
+ layer_tree()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f);
+ layer_tree()->SetRootLayer(root_clip);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_clip->bounds());
}
@@ -6204,13 +6157,13 @@ class LayerTreeHostTestOneActivatePerPrepareTiles : public LayerTreeHostTest {
root_layer->SetBounds(gfx::Size(1500, 1500));
root_layer->SetIsDrawable(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer->bounds());
}
void BeginTest() override {
- layer_tree_host()->SetViewportSize(gfx::Size(16, 16));
+ layer_tree()->SetViewportSize(gfx::Size(16, 16));
PostSetNeedsCommitToMainThread();
}
@@ -6260,7 +6213,7 @@ class LayerTreeHostTestActivationCausesPrepareTiles : public LayerTreeHostTest {
root_layer->SetBounds(gfx::Size(150, 150));
root_layer->SetIsDrawable(true);
- layer_tree_host()->SetRootLayer(root_layer);
+ layer_tree()->SetRootLayer(root_layer);
LayerTreeHostTest::SetupTree();
client_.set_bounds(root_layer->bounds());
}
@@ -6338,7 +6291,7 @@ class LayerTreeHostTestUpdateCopyRequests : public LayerTreeHostTest {
root = Layer::Create();
child = Layer::Create();
root->AddChild(child);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -6433,7 +6386,7 @@ class LayerTreeTestMaskLayerForSurfaceWithClippedLayer : public LayerTreeTest {
mask_layer->SetBounds(mask_size);
mask_layer->SetIsMask(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -6518,7 +6471,7 @@ class LayerTreeTestMaskLayerWithScaling : public LayerTreeTest {
mask_layer->SetBounds(scaling_layer_size);
mask_layer->SetIsMask(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -6568,8 +6521,8 @@ class LayerTreeTestMaskLayerWithScaling : public LayerTreeTest {
switch (layer_tree_host()->source_frame_number()) {
case 1:
gfx::Size double_root_size(200, 200);
- layer_tree_host()->SetViewportSize(double_root_size);
- layer_tree_host()->SetDeviceScaleFactor(2.f);
+ layer_tree()->SetViewportSize(double_root_size);
+ layer_tree()->SetDeviceScaleFactor(2.f);
break;
}
}
@@ -6607,7 +6560,7 @@ class LayerTreeTestMaskLayerWithDifferentBounds : public LayerTreeTest {
mask_layer->SetBounds(mask_size);
mask_layer->SetIsMask(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -6656,8 +6609,8 @@ class LayerTreeTestMaskLayerWithDifferentBounds : public LayerTreeTest {
switch (layer_tree_host()->source_frame_number()) {
case 1:
gfx::Size double_root_size(200, 200);
- layer_tree_host()->SetViewportSize(double_root_size);
- layer_tree_host()->SetDeviceScaleFactor(2.f);
+ layer_tree()->SetViewportSize(double_root_size);
+ layer_tree()->SetDeviceScaleFactor(2.f);
break;
}
}
@@ -6699,7 +6652,7 @@ class LayerTreeTestReflectionMaskLayerWithDifferentBounds
mask_layer->SetBounds(mask_size);
mask_layer->SetIsMask(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -6749,8 +6702,8 @@ class LayerTreeTestReflectionMaskLayerWithDifferentBounds
switch (layer_tree_host()->source_frame_number()) {
case 1:
gfx::Size double_root_size(200, 200);
- layer_tree_host()->SetViewportSize(double_root_size);
- layer_tree_host()->SetDeviceScaleFactor(2.f);
+ layer_tree()->SetViewportSize(double_root_size);
+ layer_tree()->SetDeviceScaleFactor(2.f);
break;
}
}
@@ -6798,7 +6751,7 @@ class LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild
mask_layer->SetBounds(mask_size);
mask_layer->SetIsMask(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
client_.set_bounds(root->bounds());
}
@@ -6891,13 +6844,13 @@ class LayerTreeTestPageScaleFlags : public LayerTreeTest {
page_scale->AddChild(page_scale_child2);
page_scale_child1->AddChild(page_scale_grandchild);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
scoped_refptr<Layer> overscroll_elasticity_layer = nullptr;
scoped_refptr<Layer> inner_viewport_scroll_layer = nullptr;
scoped_refptr<Layer> outer_viewport_scroll_layer = nullptr;
- layer_tree_host()->RegisterViewportLayers(
+ layer_tree()->RegisterViewportLayers(
overscroll_elasticity_layer, page_scale, inner_viewport_scroll_layer,
outer_viewport_scroll_layer);
@@ -6956,8 +6909,8 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
protected:
void BeginTest() override {
- layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
- EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
+ layer_tree()->SetPaintedDeviceScaleFactor(2.0f);
+ EXPECT_EQ(1.0f, layer_tree()->device_scale_factor());
PostSetNeedsCommitToMainThread();
}
@@ -7017,9 +6970,9 @@ class GpuRasterizationSucceedsWithLargeImage : public LayerTreeHostTest {
client_.set_bounds(root->bounds());
root->SetContentsOpaque(true);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
- layer_tree_host()->SetViewportSize(viewport_size_);
+ layer_tree()->SetViewportSize(viewport_size_);
client_.set_bounds(root->bounds());
}

Powered by Google App Engine
This is Rietveld 408576698