| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/barrier_closure.h" | 8 #include "base/barrier_closure.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "cc/paint/skia_paint_canvas.h" |
| 17 #include "content/browser/gpu/compositor_util.h" | 18 #include "content/browser/gpu/compositor_util.h" |
| 18 #include "content/browser/gpu/gpu_data_manager_impl.h" | 19 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 19 #include "content/browser/renderer_host/dip_util.h" | 20 #include "content/browser/renderer_host/dip_util.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 21 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 21 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 22 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" |
| 23 #include "content/public/browser/gpu_data_manager.h" | 24 #include "content/public/browser/gpu_data_manager.h" |
| 24 #include "content/public/browser/render_view_host.h" | 25 #include "content/public/browser/render_view_host.h" |
| 25 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 26 #include "content/public/common/content_paths.h" | 27 #include "content/public/common/content_paths.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 quit_callback.Run(); | 492 quit_callback.Run(); |
| 492 return; | 493 return; |
| 493 } | 494 } |
| 494 | 495 |
| 495 media::SkCanvasVideoRenderer video_renderer; | 496 media::SkCanvasVideoRenderer video_renderer; |
| 496 | 497 |
| 497 SkBitmap bitmap; | 498 SkBitmap bitmap; |
| 498 bitmap.allocN32Pixels(video_frame->visible_rect().width(), | 499 bitmap.allocN32Pixels(video_frame->visible_rect().width(), |
| 499 video_frame->visible_rect().height()); | 500 video_frame->visible_rect().height()); |
| 500 // Don't clear the canvas because drawing a video frame by Src mode. | 501 // Don't clear the canvas because drawing a video frame by Src mode. |
| 501 cc::PaintCanvas canvas(bitmap); | 502 cc::SkiaPaintCanvas canvas(bitmap); |
| 502 video_renderer.Copy(video_frame, &canvas, media::Context3D()); | 503 video_renderer.Copy(video_frame, &canvas, media::Context3D()); |
| 503 | 504 |
| 504 ReadbackRequestCallbackTest(quit_callback, bitmap, READBACK_SUCCESS); | 505 ReadbackRequestCallbackTest(quit_callback, bitmap, READBACK_SUCCESS); |
| 505 } | 506 } |
| 506 | 507 |
| 507 void SetAllowableError(int amount) { allowable_error_ = amount; } | 508 void SetAllowableError(int amount) { allowable_error_ = amount; } |
| 508 void SetExcludeRect(gfx::Rect exclude) { exclude_rect_ = exclude; } | 509 void SetExcludeRect(gfx::Rect exclude) { exclude_rect_ = exclude; } |
| 509 | 510 |
| 510 GURL TestUrl() override { return GURL(test_url_); } | 511 GURL TestUrl() override { return GURL(test_url_); } |
| 511 | 512 |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 kTestCompositingModes); | 936 kTestCompositingModes); |
| 936 INSTANTIATE_TEST_CASE_P( | 937 INSTANTIATE_TEST_CASE_P( |
| 937 GLAndSoftwareCompositing, | 938 GLAndSoftwareCompositing, |
| 938 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 939 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
| 939 kTestCompositingModes); | 940 kTestCompositingModes); |
| 940 | 941 |
| 941 #endif // !defined(OS_ANDROID) | 942 #endif // !defined(OS_ANDROID) |
| 942 | 943 |
| 943 } // namespace | 944 } // namespace |
| 944 } // namespace content | 945 } // namespace content |
| OLD | NEW |