| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 gfx::Rect root_bounds = browser()->window()->GetBounds(); | 208 gfx::Rect root_bounds = browser()->window()->GetBounds(); |
| 209 gfx::Rect tab_contents_bounds; | 209 gfx::Rect tab_contents_bounds; |
| 210 browser()->GetSelectedWebContents()->GetContainerBounds( | 210 browser()->GetSelectedWebContents()->GetContainerBounds( |
| 211 &tab_contents_bounds); | 211 &tab_contents_bounds); |
| 212 | 212 |
| 213 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), | 213 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), |
| 214 tab_contents_bounds.y() - root_bounds.y(), | 214 tab_contents_bounds.y() - root_bounds.y(), |
| 215 tab_contents_bounds.width(), | 215 tab_contents_bounds.width(), |
| 216 tab_contents_bounds.height()); | 216 tab_contents_bounds.height()); |
| 217 | 217 |
| 218 gfx::NativeWindow native_window = browser()->window()->GetNativeHandle(); | 218 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); |
| 219 if (!browser::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { | 219 if (!browser::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { |
| 220 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; | 220 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; |
| 221 return false; | 221 return false; |
| 222 } | 222 } |
| 223 | 223 |
| 224 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), | 224 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), |
| 225 png.size(), bitmap)) { | 225 png.size(), bitmap)) { |
| 226 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; | 226 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; |
| 227 return false; | 227 return false; |
| 228 } | 228 } |
| (...skipping 303 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 |