| 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 if (use_gpu_) { | 188 if (use_gpu_) { |
| 189 command_line->AppendSwitch(switches::kForceCompositingMode); | 189 command_line->AppendSwitch(switches::kForceCompositingMode); |
| 190 } else { | 190 } else { |
| 191 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); | 191 command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
| 192 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); | 192 command_line->AppendSwitch(switches::kDisableExperimentalWebGL); |
| 193 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); | 193 command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 void Wait(int ms) { | 197 void Wait(int ms) { |
| 198 MessageLoop::RunLoop run_loop; |
| 198 MessageLoop::current()->PostDelayedTask( | 199 MessageLoop::current()->PostDelayedTask( |
| 199 FROM_HERE, | 200 FROM_HERE, run_loop.StopClosure(), |
| 200 MessageLoop::QuitClosure(), | |
| 201 base::TimeDelta::FromMilliseconds(ms)); | 201 base::TimeDelta::FromMilliseconds(ms)); |
| 202 ui_test_utils::RunMessageLoop(); | 202 ui_test_utils::RunRunLoop(run_loop.AsWeakPtr()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 // Take snapshot of the current tab, encode it as PNG, and save to a SkBitmap. | 205 // Take snapshot of the current tab, encode it as PNG, and save to a SkBitmap. |
| 206 bool TabSnapShotToImage(SkBitmap* bitmap) { | 206 bool TabSnapShotToImage(SkBitmap* bitmap) { |
| 207 CHECK(bitmap); | 207 CHECK(bitmap); |
| 208 std::vector<unsigned char> png; | 208 std::vector<unsigned char> png; |
| 209 | 209 |
| 210 gfx::Rect root_bounds = browser()->window()->GetBounds(); | 210 gfx::Rect root_bounds = browser()->window()->GetBounds(); |
| 211 gfx::Rect tab_contents_bounds; | 211 gfx::Rect tab_contents_bounds; |
| 212 browser()->GetActiveWebContents()->GetContainerBounds( | 212 browser()->GetActiveWebContents()->GetContainerBounds( |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 558 |
| 559 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { | 559 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { |
| 560 RunCanvasBenchTest("many_images", kNone); | 560 RunCanvasBenchTest("many_images", kNone); |
| 561 } | 561 } |
| 562 | 562 |
| 563 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 563 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
| 564 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); | 564 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); |
| 565 } | 565 } |
| 566 | 566 |
| 567 } // namespace | 567 } // namespace |
| OLD | NEW |