| 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/barrier_closure.h" | 5 #include "base/barrier_closure.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/browser/gpu/compositor_util.h" | 10 #include "content/browser/gpu/compositor_util.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 return; | 469 return; |
| 470 } | 470 } |
| 471 | 471 |
| 472 media::SkCanvasVideoRenderer video_renderer; | 472 media::SkCanvasVideoRenderer video_renderer; |
| 473 | 473 |
| 474 SkBitmap bitmap; | 474 SkBitmap bitmap; |
| 475 bitmap.allocN32Pixels(video_frame->visible_rect().width(), | 475 bitmap.allocN32Pixels(video_frame->visible_rect().width(), |
| 476 video_frame->visible_rect().height()); | 476 video_frame->visible_rect().height()); |
| 477 // Don't clear the canvas because drawing a video frame by Src mode. | 477 // Don't clear the canvas because drawing a video frame by Src mode. |
| 478 SkCanvas canvas(bitmap); | 478 SkCanvas canvas(bitmap); |
| 479 video_renderer.Copy(video_frame, &canvas); | 479 video_renderer.Copy(video_frame, &canvas, media::Context3D()); |
| 480 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED; | 480 ReadbackResponse response = result ? READBACK_SUCCESS : READBACK_FAILED; |
| 481 | 481 |
| 482 ReadbackRequestCallbackTest(quit_callback, bitmap, response); | 482 ReadbackRequestCallbackTest(quit_callback, bitmap, response); |
| 483 } | 483 } |
| 484 | 484 |
| 485 void SetExpectedCopyFromCompositingSurfaceResult(bool result, | 485 void SetExpectedCopyFromCompositingSurfaceResult(bool result, |
| 486 const SkBitmap& bitmap) { | 486 const SkBitmap& bitmap) { |
| 487 expected_copy_from_compositing_surface_result_ = result; | 487 expected_copy_from_compositing_surface_result_ = result; |
| 488 expected_copy_from_compositing_surface_bitmap_ = bitmap; | 488 expected_copy_from_compositing_surface_bitmap_ = bitmap; |
| 489 } | 489 } |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 910 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
| 911 INSTANTIATE_TEST_CASE_P( | 911 INSTANTIATE_TEST_CASE_P( |
| 912 GLAndSoftwareCompositing, | 912 GLAndSoftwareCompositing, |
| 913 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 913 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
| 914 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 914 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
| 915 | 915 |
| 916 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 916 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 917 | 917 |
| 918 } // namespace | 918 } // namespace |
| 919 } // namespace content | 919 } // namespace content |
| OLD | NEW |