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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 gfx::Rect tab_contents_bounds; | 214 gfx::Rect tab_contents_bounds; |
215 chrome::GetActiveWebContents(browser())->GetContainerBounds( | 215 chrome::GetActiveWebContents(browser())->GetContainerBounds( |
216 &tab_contents_bounds); | 216 &tab_contents_bounds); |
217 | 217 |
218 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), | 218 gfx::Rect snapshot_bounds(tab_contents_bounds.x() - root_bounds.x(), |
219 tab_contents_bounds.y() - root_bounds.y(), | 219 tab_contents_bounds.y() - root_bounds.y(), |
220 tab_contents_bounds.width(), | 220 tab_contents_bounds.width(), |
221 tab_contents_bounds.height()); | 221 tab_contents_bounds.height()); |
222 | 222 |
223 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); | 223 gfx::NativeWindow native_window = browser()->window()->GetNativeWindow(); |
224 if (!browser::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { | 224 if (!chrome::GrabWindowSnapshot(native_window, &png, snapshot_bounds)) { |
225 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; | 225 LOG(ERROR) << "browser::GrabWindowSnapShot() failed"; |
226 return false; | 226 return false; |
227 } | 227 } |
228 | 228 |
229 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), | 229 if (!gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&*png.begin()), |
230 png.size(), bitmap)) { | 230 png.size(), bitmap)) { |
231 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; | 231 LOG(ERROR) << "Decode PNG to a SkBitmap failed"; |
232 return false; | 232 return false; |
233 } | 233 } |
234 return true; | 234 return true; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { | 554 IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasManyImagesSW) { |
555 RunCanvasBenchTest("many_images", kNone); | 555 RunCanvasBenchTest("many_images", kNone); |
556 } | 556 } |
557 | 557 |
558 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { | 558 IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { |
559 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); | 559 RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); |
560 } | 560 } |
561 | 561 |
562 } // namespace | 562 } // namespace |
OLD | NEW |