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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 gfx::Rect tab_contents_bounds; | 223 gfx::Rect tab_contents_bounds; |
224 chrome::GetActiveWebContents(browser())->GetContainerBounds( | 224 chrome::GetActiveWebContents(browser())->GetContainerBounds( |
225 &tab_contents_bounds); | 225 &tab_contents_bounds); |
226 | 226 |
227 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), | 227 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), |
228 tab_contents_bounds.y() - root_bounds.y(), | 228 tab_contents_bounds.y() - root_bounds.y(), |
229 tab_contents_bounds.width(), | 229 tab_contents_bounds.width(), |
230 tab_contents_bounds.height()); | 230 tab_contents_bounds.height()); |
231 | 231 |
232 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); | 232 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); |
233 if (!chrome::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { | 233 if (!chrome::GrabWindowSnapshotForUser(native_window, &png, |
| 234 snapshot_bounds)) { |
234 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; | 235 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; |
235 return false; | 236 return false; |
236 } | 237 } |
237 | 238 |
238 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), | 239 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), |
239 png.size(), bitmap)) { | 240 png.size(), bitmap)) { |
240 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; | 241 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; |
241 return false; | 242 return false; |
242 } | 243 } |
243 return true; | 244 return true; |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 587 |
587 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 588 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
588 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); | 589 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); |
589 } | 590 } |
590 | 591 |
591 IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasManyImagesGPU) { | 592 IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasManyImagesGPU) { |
592 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); | 593 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); |
593 } | 594 } |
594 | 595 |
595 } // namespace | 596 } // namespace |
OLD | NEW |