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" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 if (!result) { | 484 if (!result) { |
485 quit_callback.Run(); | 485 quit_callback.Run(); |
486 return; | 486 return; |
487 } | 487 } |
488 | 488 |
489 media::SkCanvasVideoRenderer video_renderer; | 489 media::SkCanvasVideoRenderer video_renderer; |
490 | 490 |
491 SkBitmap bitmap; | 491 SkBitmap bitmap; |
492 bitmap.allocN32Pixels(video_frame->visible_rect().width(), | 492 bitmap.allocN32Pixels(video_frame->visible_rect().width(), |
493 video_frame->visible_rect().height()); | 493 video_frame->visible_rect().height()); |
494 bitmap.eraseColor(SK_ColorTRANSPARENT); | 494 // Don't clear the canvas because drawing a video frame by Src mode. |
495 SkCanvas canvas(bitmap); | 495 SkCanvas canvas(bitmap); |
496 | 496 video_renderer.Copy(video_frame.get(), &canvas); |
497 video_renderer.Paint(video_frame.get(), | |
498 &canvas, | |
499 video_frame->visible_rect(), | |
500 0xff, | |
501 media::VIDEO_ROTATION_0); | |
502 | 497 |
503 CopyFromCompositingSurfaceCallback(quit_callback, | 498 CopyFromCompositingSurfaceCallback(quit_callback, |
504 result, | 499 result, |
505 bitmap); | 500 bitmap); |
506 } | 501 } |
507 | 502 |
508 void SetExpectedCopyFromCompositingSurfaceResult(bool result, | 503 void SetExpectedCopyFromCompositingSurfaceResult(bool result, |
509 const SkBitmap& bitmap) { | 504 const SkBitmap& bitmap) { |
510 expected_copy_from_compositing_surface_result_ = result; | 505 expected_copy_from_compositing_surface_result_ = result; |
511 expected_copy_from_compositing_surface_bitmap_ = bitmap; | 506 expected_copy_from_compositing_surface_bitmap_ = bitmap; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 910 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
916 INSTANTIATE_TEST_CASE_P( | 911 INSTANTIATE_TEST_CASE_P( |
917 GLAndSoftwareCompositing, | 912 GLAndSoftwareCompositing, |
918 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 913 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
919 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); | 914 testing::Values(GL_COMPOSITING, SOFTWARE_COMPOSITING)); |
920 | 915 |
921 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 916 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
922 | 917 |
923 } // namespace | 918 } // namespace |
924 } // namespace content | 919 } // namespace content |
OLD | NEW |