| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } else { | 188 } else { |
| 189 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 189 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 190 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); | 190 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); |
| 191 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); | 191 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 void Wait(int ms) { | 195 void Wait(int ms) { |
| 196 MessageLoop::current()->PostDelayedTask( | 196 MessageLoop::current()->PostDelayedTask( |
| 197 FROM_HERE, | 197 FROM_HERE, |
| 198 MessageLoop::QuitClosure(), | 198 MessageLoop::QuitNowClosure(), |
| 199 base::TimeDelta::FromMilliseconds(ms)); | 199 base::TimeDelta::FromMilliseconds(ms)); |
| 200 ui_test_utils::RunMessageLoop(); | 200 ui_test_utils::RunMessageLoop(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 // Take snapshot of the current tab, encode it as PNG, and save to a SkBitmap. | 203 // Take snapshot of the current tab, encode it as PNG, and save to a SkBitmap. |
| 204 bool TabSnapShotToImage(SkBitmap* bitmap) { | 204 bool TabSnapShotToImage(SkBitmap* bitmap) { |
| 205 CHECK(bitmap); | 205 CHECK(bitmap); |
| 206 std::vector<unsigned char> png; | 206 std::vector<unsigned char> png; |
| 207 | 207 |
| 208 gfx::Rect root_bounds = browser()->window()->GetBounds(); | 208 gfx::Rect root_bounds = browser()->window()->GetBounds(); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 532 |
| 533 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { | 533 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { |
| 534 RunCanvasBenchTest("many_images", kNone); | 534 RunCanvasBenchTest("many_images", kNone); |
| 535 } | 535 } |
| 536 | 536 |
| 537 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 537 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
| 538 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); | 538 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace | 541 } // namespace |
| OLD | NEW |