diff options
Diffstat (limited to 'chromium/cc/layers/picture_layer_unittest.cc')
-rw-r--r-- | chromium/cc/layers/picture_layer_unittest.cc | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/chromium/cc/layers/picture_layer_unittest.cc b/chromium/cc/layers/picture_layer_unittest.cc index 40772076c72..9f8feabe10d 100644 --- a/chromium/cc/layers/picture_layer_unittest.cc +++ b/chromium/cc/layers/picture_layer_unittest.cc @@ -19,6 +19,8 @@ #include "cc/test/fake_picture_layer_impl.h" #include "cc/test/fake_proxy.h" #include "cc/test/fake_recording_source.h" +#include "cc/test/layer_test_common.h" +#include "cc/test/property_tree_test_utils.h" #include "cc/test/skia_common.h" #include "cc/test/stub_layer_tree_host_single_thread_client.h" #include "cc/test/test_task_graph_runner.h" @@ -105,9 +107,8 @@ TEST(PictureLayerTest, InvalidateRasterAfterUpdate) { host_impl.CreatePendingTree(); host_impl.pending_tree()->SetRootLayerForTesting( FakePictureLayerImpl::Create(host_impl.pending_tree(), 1)); - host_impl.pending_tree()->BuildLayerListForTesting(); FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl.pending_tree()->root_layer_for_testing()); + host_impl.pending_tree()->root_layer()); layer->PushPropertiesTo(layer_impl); EXPECT_EQ(invalidation_bounds, @@ -146,9 +147,8 @@ TEST(PictureLayerTest, InvalidateRasterWithoutUpdate) { host_impl.CreatePendingTree(); host_impl.pending_tree()->SetRootLayerForTesting( FakePictureLayerImpl::Create(host_impl.pending_tree(), 1)); - host_impl.pending_tree()->BuildLayerListForTesting(); FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl.pending_tree()->root_layer_for_testing()); + host_impl.pending_tree()->root_layer()); layer->PushPropertiesTo(layer_impl); EXPECT_EQ(gfx::Rect(), layer_impl->GetPendingInvalidation()->bounds()); @@ -183,19 +183,18 @@ TEST(PictureLayerTest, ClearVisibleRectWhenNoTiling) { std::unique_ptr<LayerTreeFrameSink> layer_tree_frame_sink( FakeLayerTreeFrameSink::Create3d()); - LayerTreeSettings layer_tree_settings = LayerTreeSettings(); FakeLayerTreeHostImpl host_impl( - layer_tree_settings, &impl_task_runner_provider, &task_graph_runner); + LayerListSettings(), &impl_task_runner_provider, &task_graph_runner); host_impl.SetVisible(true); EXPECT_TRUE(host_impl.InitializeFrameSink(layer_tree_frame_sink.get())); host_impl.CreatePendingTree(); host_impl.pending_tree()->SetRootLayerForTesting( FakePictureLayerImpl::Create(host_impl.pending_tree(), 1)); - host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting(); - FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl.pending_tree()->root_layer_for_testing()); + host_impl.pending_tree()->root_layer()); + SetupRootProperties(layer_impl); + UpdateDrawProperties(host_impl.pending_tree()); layer->PushPropertiesTo(layer_impl); @@ -206,29 +205,26 @@ TEST(PictureLayerTest, ClearVisibleRectWhenNoTiling) { // By updating the draw proprties on the active tree, we will set the viewport // rect for tile priorities to something non-empty. - host_impl.active_tree()->BuildPropertyTreesForTesting(); - host_impl.active_tree()->UpdateDrawProperties(); + UpdateDrawProperties(host_impl.active_tree()); layer->SetBounds(gfx::Size(11, 11)); host_impl.CreatePendingTree(); layer_impl = static_cast<FakePictureLayerImpl*>( - host_impl.pending_tree()->root_layer_for_testing()); + host_impl.pending_tree()->root_layer()); // We should now have invalid contents and should therefore clear the // recording source. layer->PushPropertiesTo(layer_impl); - host_impl.pending_tree()->BuildPropertyTreesForTesting(); + UpdateDrawProperties(host_impl.pending_tree()); host_impl.ActivateSyncTree(); std::unique_ptr<viz::RenderPass> render_pass = viz::RenderPass::Create(); AppendQuadsData data; - host_impl.active_tree()->root_layer_for_testing()->WillDraw( - DRAW_MODE_SOFTWARE, nullptr); - host_impl.active_tree()->root_layer_for_testing()->AppendQuads( - render_pass.get(), &data); - host_impl.active_tree()->root_layer_for_testing()->DidDraw(nullptr); + host_impl.active_tree()->root_layer()->WillDraw(DRAW_MODE_SOFTWARE, nullptr); + host_impl.active_tree()->root_layer()->AppendQuads(render_pass.get(), &data); + host_impl.active_tree()->root_layer()->DidDraw(nullptr); } TEST(PictureLayerTest, HasSlowPaths) { |