OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/gpu/compositor_util.h" | 9 #include "content/browser/gpu/compositor_util.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
11 #include "content/browser/renderer_host/dip_util.h" | 11 #include "content/browser/renderer_host/dip_util.h" |
12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 12 #include "content/browser/renderer_host/render_widget_host_impl.h" |
13 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" | 13 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" |
14 #include "content/port/browser/render_widget_host_view_port.h" | 14 #include "content/port/browser/render_widget_host_view_port.h" |
15 #include "content/public/browser/gpu_data_manager.h" | 15 #include "content/public/browser/gpu_data_manager.h" |
16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/common/content_paths.h" | 18 #include "content/public/common/content_paths.h" |
19 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
20 #include "content/public/common/url_constants.h" | 20 #include "content/public/common/url_constants.h" |
21 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
22 #include "content/shell/browser/shell.h" | 22 #include "content/shell/browser/shell.h" |
23 #include "content/test/content_browser_test.h" | 23 #include "content/test/content_browser_test.h" |
24 #include "content/test/content_browser_test_utils.h" | 24 #include "content/test/content_browser_test_utils.h" |
25 #include "media/base/video_frame.h" | 25 #include "media/base/video_frame.h" |
26 #include "media/filters/skcanvas_video_renderer.h" | 26 #include "media/filters/skcanvas_video_renderer.h" |
27 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
28 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
| 29 #include "third_party/skia/include/core/SkBitmapDevice.h" |
29 #include "third_party/skia/include/core/SkCanvas.h" | 30 #include "third_party/skia/include/core/SkCanvas.h" |
30 #include "ui/base/ui_base_switches.h" | 31 #include "ui/base/ui_base_switches.h" |
31 #include "ui/gfx/size_conversions.h" | 32 #include "ui/gfx/size_conversions.h" |
32 #include "ui/gfx/switches.h" | 33 #include "ui/gfx/switches.h" |
33 #include "ui/gl/gl_switches.h" | 34 #include "ui/gl/gl_switches.h" |
34 | 35 |
35 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
36 #include "ui/gl/io_surface_support_mac.h" | 37 #include "ui/gl/io_surface_support_mac.h" |
37 #endif | 38 #endif |
38 | 39 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 bool result) { | 575 bool result) { |
575 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); | 576 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); |
576 if (!result) { | 577 if (!result) { |
577 quit_callback.Run(); | 578 quit_callback.Run(); |
578 return; | 579 return; |
579 } | 580 } |
580 | 581 |
581 media::SkCanvasVideoRenderer video_renderer; | 582 media::SkCanvasVideoRenderer video_renderer; |
582 | 583 |
583 SkBitmap bitmap; | 584 SkBitmap bitmap; |
584 bitmap.allocPixels(SkImageInfo::Make(video_frame->visible_rect().width(), | 585 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
585 video_frame->visible_rect().height(), | 586 video_frame->visible_rect().width(), |
586 kPMColor_SkColorType, | 587 video_frame->visible_rect().height(), |
587 kOpaque_SkAlphaType)); | 588 0, kOpaque_SkAlphaType); |
588 bitmap.allocPixels(); | 589 bitmap.allocPixels(); |
589 SkCanvas canvas(bitmap); | 590 |
| 591 SkBitmapDevice device(bitmap); |
| 592 SkCanvas canvas(&device); |
590 | 593 |
591 video_renderer.Paint(video_frame.get(), | 594 video_renderer.Paint(video_frame.get(), |
592 &canvas, | 595 &canvas, |
593 video_frame->visible_rect(), | 596 video_frame->visible_rect(), |
594 0xff); | 597 0xff); |
595 | 598 |
596 CopyFromCompositingSurfaceCallback(quit_callback, | 599 CopyFromCompositingSurfaceCallback(quit_callback, |
597 result, | 600 result, |
598 bitmap); | 601 bitmap); |
599 } | 602 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 947 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
945 testing::ValuesIn(kAllCompositingModes)); | 948 testing::ValuesIn(kAllCompositingModes)); |
946 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 949 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
947 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 950 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
948 testing::ValuesIn(kAllCompositingModes)); | 951 testing::ValuesIn(kAllCompositingModes)); |
949 | 952 |
950 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 953 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
951 | 954 |
952 } // namespace | 955 } // namespace |
953 } // namespace content | 956 } // namespace content |
OLD | NEW |