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

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: no-constructor 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 unified diff | Download patch
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_impl_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/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 3689 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 3700
3701 // CalcDrawProps skips a subtree when a layer's screen space transform is 3701 // CalcDrawProps skips a subtree when a layer's screen space transform is
3702 // uninvertible 3702 // uninvertible
3703 EXPECT_EQ(gfx::Rect(), grand_child->visible_layer_rect()); 3703 EXPECT_EQ(gfx::Rect(), grand_child->visible_layer_rect());
3704 } 3704 }
3705 3705
3706 TEST_F(LayerTreeHostCommonTest, OcclusionBySiblingOfTarget) { 3706 TEST_F(LayerTreeHostCommonTest, OcclusionBySiblingOfTarget) {
3707 FakeImplTaskRunnerProvider task_runner_provider; 3707 FakeImplTaskRunnerProvider task_runner_provider;
3708 TestSharedBitmapManager shared_bitmap_manager; 3708 TestSharedBitmapManager shared_bitmap_manager;
3709 TestTaskGraphRunner task_graph_runner; 3709 TestTaskGraphRunner task_graph_runner;
3710 std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); 3710 std::unique_ptr<OutputSurface> output_surface =
3711 FakeOutputSurface::CreateDelegating3d();
3711 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, 3712 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
3712 &task_graph_runner); 3713 &task_graph_runner);
3713 3714
3714 std::unique_ptr<LayerImpl> root = 3715 std::unique_ptr<LayerImpl> root =
3715 LayerImpl::Create(host_impl.active_tree(), 1); 3716 LayerImpl::Create(host_impl.active_tree(), 1);
3716 std::unique_ptr<LayerImpl> child = 3717 std::unique_ptr<LayerImpl> child =
3717 LayerImpl::Create(host_impl.active_tree(), 2); 3718 LayerImpl::Create(host_impl.active_tree(), 2);
3718 std::unique_ptr<TextureLayerImpl> surface = 3719 std::unique_ptr<TextureLayerImpl> surface =
3719 TextureLayerImpl::Create(host_impl.active_tree(), 3); 3720 TextureLayerImpl::Create(host_impl.active_tree(), 3);
3720 std::unique_ptr<TextureLayerImpl> surface_child = 3721 std::unique_ptr<TextureLayerImpl> surface_child =
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
3788 actual_occlusion = 3789 actual_occlusion =
3789 surface_child_mask_ptr->draw_properties().occlusion_in_content_space; 3790 surface_child_mask_ptr->draw_properties().occlusion_in_content_space;
3790 EXPECT_TRUE(expected_occlusion.IsEqual(actual_occlusion)); 3791 EXPECT_TRUE(expected_occlusion.IsEqual(actual_occlusion));
3791 } 3792 }
3792 3793
3793 TEST_F(LayerTreeHostCommonTest, 3794 TEST_F(LayerTreeHostCommonTest,
3794 OcclusionForLayerWithUninvertibleDrawTransform) { 3795 OcclusionForLayerWithUninvertibleDrawTransform) {
3795 FakeImplTaskRunnerProvider task_runner_provider; 3796 FakeImplTaskRunnerProvider task_runner_provider;
3796 TestSharedBitmapManager shared_bitmap_manager; 3797 TestSharedBitmapManager shared_bitmap_manager;
3797 TestTaskGraphRunner task_graph_runner; 3798 TestTaskGraphRunner task_graph_runner;
3798 std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); 3799 std::unique_ptr<OutputSurface> output_surface =
3800 FakeOutputSurface::CreateDelegating3d();
3799 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, 3801 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
3800 &task_graph_runner); 3802 &task_graph_runner);
3801 3803
3802 std::unique_ptr<LayerImpl> root = 3804 std::unique_ptr<LayerImpl> root =
3803 LayerImpl::Create(host_impl.active_tree(), 1); 3805 LayerImpl::Create(host_impl.active_tree(), 1);
3804 std::unique_ptr<LayerImpl> child = 3806 std::unique_ptr<LayerImpl> child =
3805 LayerImpl::Create(host_impl.active_tree(), 2); 3807 LayerImpl::Create(host_impl.active_tree(), 2);
3806 std::unique_ptr<LayerImpl> grand_child = 3808 std::unique_ptr<LayerImpl> grand_child =
3807 LayerImpl::Create(host_impl.active_tree(), 3); 3809 LayerImpl::Create(host_impl.active_tree(), 3);
3808 std::unique_ptr<LayerImpl> occluding_child = 3810 std::unique_ptr<LayerImpl> occluding_child =
(...skipping 6759 matching lines...) Expand 10 before | Expand all | Expand 10 after
10568 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 10570 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
10569 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 10571 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
10570 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 10572 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
10571 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 10573 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
10572 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 10574 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
10573 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 10575 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
10574 } 10576 }
10575 10577
10576 } // namespace 10578 } // namespace
10577 } // namespace cc 10579 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698