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

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

Issue 1411663002: cc: Split Proxy to eliminate unnecessary dependencies on the impl side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update perf tests. Created 5 years, 2 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_common_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/damage_tracker.h" 5 #include "cc/trees/damage_tracker.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/output/filter_operation.h" 9 #include "cc/output/filter_operation.h"
10 #include "cc/output/filter_operations.h" 10 #include "cc/output/filter_operations.h"
11 #include "cc/test/fake_impl_proxy.h" 11 #include "cc/test/fake_impl_task_runner_provider.h"
12 #include "cc/test/fake_layer_tree_host_impl.h" 12 #include "cc/test/fake_layer_tree_host_impl.h"
13 #include "cc/test/geometry_test_utils.h" 13 #include "cc/test/geometry_test_utils.h"
14 #include "cc/test/test_shared_bitmap_manager.h" 14 #include "cc/test/test_shared_bitmap_manager.h"
15 #include "cc/test/test_task_graph_runner.h" 15 #include "cc/test/test_task_graph_runner.h"
16 #include "cc/trees/layer_tree_host_common.h" 16 #include "cc/trees/layer_tree_host_common.h"
17 #include "cc/trees/layer_tree_impl.h" 17 #include "cc/trees/layer_tree_impl.h"
18 #include "cc/trees/single_thread_proxy.h" 18 #include "cc/trees/single_thread_proxy.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 #include "third_party/skia/include/effects/SkBlurImageFilter.h" 20 #include "third_party/skia/include/effects/SkBlurImageFilter.h"
21 #include "ui/gfx/geometry/quad_f.h" 21 #include "ui/gfx/geometry/quad_f.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 render_surface_layer_list[index]->mask_layer(), 72 render_surface_layer_list[index]->mask_layer(),
73 render_surface_layer_list[index]->filters()); 73 render_surface_layer_list[index]->filters());
74 } 74 }
75 75
76 root->ResetAllChangeTrackingForSubtree(); 76 root->ResetAllChangeTrackingForSubtree();
77 } 77 }
78 78
79 class DamageTrackerTest : public testing::Test { 79 class DamageTrackerTest : public testing::Test {
80 public: 80 public:
81 DamageTrackerTest() 81 DamageTrackerTest()
82 : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_) {} 82 : host_impl_(&task_runner_provider_,
83 &shared_bitmap_manager_,
84 &task_graph_runner_) {}
83 85
84 scoped_ptr<LayerImpl> CreateTestTreeWithOneSurface() { 86 scoped_ptr<LayerImpl> CreateTestTreeWithOneSurface() {
85 scoped_ptr<LayerImpl> root = 87 scoped_ptr<LayerImpl> root =
86 LayerImpl::Create(host_impl_.active_tree(), 1); 88 LayerImpl::Create(host_impl_.active_tree(), 1);
87 scoped_ptr<LayerImpl> child = 89 scoped_ptr<LayerImpl> child =
88 LayerImpl::Create(host_impl_.active_tree(), 2); 90 LayerImpl::Create(host_impl_.active_tree(), 2);
89 91
90 root->SetPosition(gfx::PointF()); 92 root->SetPosition(gfx::PointF());
91 root->SetBounds(gfx::Size(500, 500)); 93 root->SetBounds(gfx::Size(500, 500));
92 root->SetDrawsContent(true); 94 root->SetDrawsContent(true);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 scoped_ptr<LayerImpl> root = CreateTestTreeWithTwoSurfaces(); 167 scoped_ptr<LayerImpl> root = CreateTestTreeWithTwoSurfaces();
166 168
167 // Setup includes going past the first frame which always damages 169 // Setup includes going past the first frame which always damages
168 // everything, so that we can actually perform specific tests. 170 // everything, so that we can actually perform specific tests.
169 EmulateDrawingOneFrame(root.get()); 171 EmulateDrawingOneFrame(root.get());
170 172
171 return root.Pass(); 173 return root.Pass();
172 } 174 }
173 175
174 protected: 176 protected:
175 FakeImplProxy proxy_; 177 FakeImplTaskRunnerProvider task_runner_provider_;
176 TestSharedBitmapManager shared_bitmap_manager_; 178 TestSharedBitmapManager shared_bitmap_manager_;
177 TestTaskGraphRunner task_graph_runner_; 179 TestTaskGraphRunner task_graph_runner_;
178 FakeLayerTreeHostImpl host_impl_; 180 FakeLayerTreeHostImpl host_impl_;
179 }; 181 };
180 182
181 TEST_F(DamageTrackerTest, SanityCheckTestTreeWithOneSurface) { 183 TEST_F(DamageTrackerTest, SanityCheckTestTreeWithOneSurface) {
182 // Sanity check that the simple test tree will actually produce the expected 184 // Sanity check that the simple test tree will actually produce the expected
183 // render surfaces and layer lists. 185 // render surfaces and layer lists.
184 186
185 scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface(); 187 scoped_ptr<LayerImpl> root = CreateAndSetUpTestTreeWithOneSurface();
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 gfx::Rect root_damage_rect = 1466 gfx::Rect root_damage_rect =
1465 root->render_surface()->damage_tracker()->current_damage_rect(); 1467 root->render_surface()->damage_tracker()->current_damage_rect();
1466 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1468 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1467 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1469 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1468 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1470 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1469 } 1471 }
1470 } 1472 }
1471 1473
1472 } // namespace 1474 } // namespace
1473 } // namespace cc 1475 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698