| 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 "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <deque> |
| 7 #include <sstream> | 8 #include <sstream> |
| 8 | 9 |
| 9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 13 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 14 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 16 #include "cc/base/scoped_ptr_deque.h" | |
| 17 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
| 18 #include "cc/debug/lap_timer.h" | 18 #include "cc/debug/lap_timer.h" |
| 19 #include "cc/layers/layer.h" | 19 #include "cc/layers/layer.h" |
| 20 #include "cc/output/bsp_tree.h" | 20 #include "cc/output/bsp_tree.h" |
| 21 #include "cc/quads/draw_polygon.h" | 21 #include "cc/quads/draw_polygon.h" |
| 22 #include "cc/quads/draw_quad.h" | 22 #include "cc/quads/draw_quad.h" |
| 23 #include "cc/test/fake_content_layer_client.h" | 23 #include "cc/test/fake_content_layer_client.h" |
| 24 #include "cc/test/fake_layer_tree_host_client.h" | 24 #include "cc/test/fake_layer_tree_host_client.h" |
| 25 #include "cc/test/layer_tree_json_parser.h" | 25 #include "cc/test/layer_tree_json_parser.h" |
| 26 #include "cc/test/layer_tree_test.h" | 26 #include "cc/test/layer_tree_test.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 for (LayerImplList::iterator it = base_list.begin(); it != base_list.end(); | 158 for (LayerImplList::iterator it = base_list.begin(); it != base_list.end(); |
| 159 ++it) { | 159 ++it) { |
| 160 DrawPolygon* draw_polygon = | 160 DrawPolygon* draw_polygon = |
| 161 new DrawPolygon(NULL, gfx::RectF(gfx::SizeF((*it)->bounds())), | 161 new DrawPolygon(NULL, gfx::RectF(gfx::SizeF((*it)->bounds())), |
| 162 (*it)->draw_transform(), polygon_counter++); | 162 (*it)->draw_transform(), polygon_counter++); |
| 163 polygon_list.push_back(scoped_ptr<DrawPolygon>(draw_polygon)); | 163 polygon_list.push_back(scoped_ptr<DrawPolygon>(draw_polygon)); |
| 164 } | 164 } |
| 165 | 165 |
| 166 timer_.Reset(); | 166 timer_.Reset(); |
| 167 do { | 167 do { |
| 168 ScopedPtrDeque<DrawPolygon> test_list; | 168 std::deque<scoped_ptr<DrawPolygon>> test_list; |
| 169 for (int i = 0; i < num_duplicates_; i++) { | 169 for (int i = 0; i < num_duplicates_; i++) { |
| 170 for (size_t i = 0; i < polygon_list.size(); i++) { | 170 for (size_t i = 0; i < polygon_list.size(); i++) { |
| 171 test_list.push_back(polygon_list[i]->CreateCopy()); | 171 test_list.push_back(polygon_list[i]->CreateCopy()); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 BspTree bsp_tree(&test_list); | 174 BspTree bsp_tree(&test_list); |
| 175 timer_.NextLap(); | 175 timer_.NextLap(); |
| 176 } while (!timer_.HasTimeLimitExpired()); | 176 } while (!timer_.HasTimeLimitExpired()); |
| 177 | 177 |
| 178 EndTest(); | 178 EndTest(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 TEST_F(BspTreePerfTest, BspTreeCubes_4) { | 263 TEST_F(BspTreePerfTest, BspTreeCubes_4) { |
| 264 SetTestName("bsp_tree_cubes_4"); | 264 SetTestName("bsp_tree_cubes_4"); |
| 265 SetNumberOfDuplicates(4); | 265 SetNumberOfDuplicates(4); |
| 266 ReadTestFile("layer_sort_cubes"); | 266 ReadTestFile("layer_sort_cubes"); |
| 267 RunSortLayers(); | 267 RunSortLayers(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace | 270 } // namespace |
| 271 } // namespace cc | 271 } // namespace cc |
| OLD | NEW |