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/render_view_host.h" | 15 #include "content/public/browser/render_view_host.h" |
16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
17 #include "content/public/common/content_paths.h" | 17 #include "content/public/common/content_paths.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
20 #include "content/public/test/browser_test_utils.h" | 20 #include "content/public/test/browser_test_utils.h" |
21 #include "content/shell/browser/shell.h" | 21 #include "content/shell/browser/shell.h" |
22 #include "content/test/content_browser_test.h" | 22 #include "content/test/content_browser_test.h" |
23 #include "content/test/content_browser_test_utils.h" | 23 #include "content/test/content_browser_test_utils.h" |
24 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
25 #include "media/filters/skcanvas_video_renderer.h" | 25 #include "media/filters/skcanvas_video_renderer.h" |
26 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
27 #include "third_party/skia/include/core/SkBitmap.h" | 27 #include "third_party/skia/include/core/SkBitmap.h" |
| 28 #include "third_party/skia/include/core/SkBitmapDevice.h" |
28 #include "third_party/skia/include/core/SkCanvas.h" | 29 #include "third_party/skia/include/core/SkCanvas.h" |
29 #include "third_party/skia/include/core/SkDevice.h" | |
30 #include "ui/base/ui_base_switches.h" | 30 #include "ui/base/ui_base_switches.h" |
31 #include "ui/gfx/size_conversions.h" | 31 #include "ui/gfx/size_conversions.h" |
32 #include "ui/gl/gl_switches.h" | 32 #include "ui/gl/gl_switches.h" |
33 | 33 |
34 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
35 #include "ui/gl/io_surface_support_mac.h" | 35 #include "ui/gl/io_surface_support_mac.h" |
36 #endif | 36 #endif |
37 | 37 |
38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
39 #include "ui/base/win/dpi.h" | 39 #include "ui/base/win/dpi.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 561 |
562 media::SkCanvasVideoRenderer video_renderer; | 562 media::SkCanvasVideoRenderer video_renderer; |
563 | 563 |
564 SkBitmap bitmap; | 564 SkBitmap bitmap; |
565 bitmap.setConfig(SkBitmap::kARGB_8888_Config, | 565 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
566 video_frame->visible_rect().width(), | 566 video_frame->visible_rect().width(), |
567 video_frame->visible_rect().height()); | 567 video_frame->visible_rect().height()); |
568 bitmap.allocPixels(); | 568 bitmap.allocPixels(); |
569 bitmap.setIsOpaque(true); | 569 bitmap.setIsOpaque(true); |
570 | 570 |
571 SkDevice device(bitmap); | 571 SkBitmapDevice device(bitmap); |
572 SkCanvas canvas(&device); | 572 SkCanvas canvas(&device); |
573 | 573 |
574 video_renderer.Paint(video_frame.get(), | 574 video_renderer.Paint(video_frame.get(), |
575 &canvas, | 575 &canvas, |
576 video_frame->visible_rect(), | 576 video_frame->visible_rect(), |
577 0xff); | 577 0xff); |
578 | 578 |
579 CopyFromCompositingSurfaceCallback(quit_callback, | 579 CopyFromCompositingSurfaceCallback(quit_callback, |
580 result, | 580 result, |
581 bitmap); | 581 bitmap); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 copy_rect, | 935 copy_rect, |
936 output_size, | 936 output_size, |
937 expected_bitmap_size, | 937 expected_bitmap_size, |
938 video_frame); | 938 video_frame); |
939 } | 939 } |
940 | 940 |
941 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 941 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
942 | 942 |
943 } // namespace | 943 } // namespace |
944 } // namespace content | 944 } // namespace content |
OLD | NEW |