OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 EndTest(); | 102 EndTest(); |
103 } | 103 } |
104 | 104 |
105 void DoCalcDrawPropertiesImpl(bool can_render_to_separate_surface, | 105 void DoCalcDrawPropertiesImpl(bool can_render_to_separate_surface, |
106 int max_texture_size, | 106 int max_texture_size, |
107 LayerTreeImpl* active_tree, | 107 LayerTreeImpl* active_tree, |
108 LayerTreeHostImpl* host_impl) { | 108 LayerTreeHostImpl* host_impl) { |
109 LayerImplList update_list; | 109 LayerImplList update_list; |
110 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( | 110 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( |
111 active_tree->root_layer(), active_tree->DrawViewportSize(), | 111 active_tree->root_layer_for_testing(), active_tree->DrawViewportSize(), |
112 host_impl->DrawTransform(), active_tree->device_scale_factor(), | 112 host_impl->DrawTransform(), active_tree->device_scale_factor(), |
113 active_tree->current_page_scale_factor(), | 113 active_tree->current_page_scale_factor(), |
114 active_tree->InnerViewportContainerLayer(), | 114 active_tree->InnerViewportContainerLayer(), |
115 active_tree->InnerViewportScrollLayer(), | 115 active_tree->InnerViewportScrollLayer(), |
116 active_tree->OuterViewportScrollLayer(), | 116 active_tree->OuterViewportScrollLayer(), |
117 active_tree->elastic_overscroll()->Current(active_tree->IsActiveTree()), | 117 active_tree->elastic_overscroll()->Current(active_tree->IsActiveTree()), |
118 active_tree->OverscrollElasticityLayer(), max_texture_size, | 118 active_tree->OverscrollElasticityLayer(), max_texture_size, |
119 can_render_to_separate_surface, | 119 can_render_to_separate_surface, |
120 host_impl->settings().layer_transforms_should_scale_layer_contents, | 120 host_impl->settings().layer_transforms_should_scale_layer_contents, |
121 false, // do not verify_clip_tree_calculation for perf tests | 121 false, // do not verify_clip_tree_calculation for perf tests |
(...skipping 18 matching lines...) Expand all Loading... |
140 // First build the tree and then we'll start running tests on layersorter | 140 // First build the tree and then we'll start running tests on layersorter |
141 // itself | 141 // itself |
142 bool can_render_to_separate_surface = true; | 142 bool can_render_to_separate_surface = true; |
143 int max_texture_size = 8096; | 143 int max_texture_size = 8096; |
144 DoCalcDrawPropertiesImpl(can_render_to_separate_surface, | 144 DoCalcDrawPropertiesImpl(can_render_to_separate_surface, |
145 max_texture_size, | 145 max_texture_size, |
146 active_tree, | 146 active_tree, |
147 host_impl); | 147 host_impl); |
148 | 148 |
149 LayerImplList base_list; | 149 LayerImplList base_list; |
150 BuildLayerImplList(active_tree->root_layer(), &base_list); | 150 BuildLayerImplList(active_tree->root_layer_for_testing(), &base_list); |
151 | 151 |
152 int polygon_counter = 0; | 152 int polygon_counter = 0; |
153 std::vector<std::unique_ptr<DrawPolygon>> polygon_list; | 153 std::vector<std::unique_ptr<DrawPolygon>> polygon_list; |
154 for (LayerImplList::iterator it = base_list.begin(); it != base_list.end(); | 154 for (LayerImplList::iterator it = base_list.begin(); it != base_list.end(); |
155 ++it) { | 155 ++it) { |
156 DrawPolygon* draw_polygon = new DrawPolygon( | 156 DrawPolygon* draw_polygon = new DrawPolygon( |
157 NULL, gfx::RectF(gfx::SizeF((*it)->bounds())), | 157 NULL, gfx::RectF(gfx::SizeF((*it)->bounds())), |
158 (*it)->draw_properties().target_space_transform, polygon_counter++); | 158 (*it)->draw_properties().target_space_transform, polygon_counter++); |
159 polygon_list.push_back(std::unique_ptr<DrawPolygon>(draw_polygon)); | 159 polygon_list.push_back(std::unique_ptr<DrawPolygon>(draw_polygon)); |
160 } | 160 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 TEST_F(BspTreePerfTest, BspTreeCubes_4) { | 247 TEST_F(BspTreePerfTest, BspTreeCubes_4) { |
248 SetTestName("bsp_tree_cubes_4"); | 248 SetTestName("bsp_tree_cubes_4"); |
249 SetNumberOfDuplicates(4); | 249 SetNumberOfDuplicates(4); |
250 ReadTestFile("layer_sort_cubes"); | 250 ReadTestFile("layer_sort_cubes"); |
251 RunSortLayers(); | 251 RunSortLayers(); |
252 } | 252 } |
253 | 253 |
254 } // namespace | 254 } // namespace |
255 } // namespace cc | 255 } // namespace cc |
OLD | NEW |