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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 bool result) { | 481 bool result) { |
482 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); | 482 EXPECT_EQ(expected_copy_from_compositing_surface_result_, result); |
483 if (!result) { | 483 if (!result) { |
484 quit_callback.Run(); | 484 quit_callback.Run(); |
485 return; | 485 return; |
486 } | 486 } |
487 | 487 |
488 media::SkCanvasVideoRenderer video_renderer; | 488 media::SkCanvasVideoRenderer video_renderer; |
489 | 489 |
490 SkBitmap bitmap; | 490 SkBitmap bitmap; |
491 bitmap.allocPixels(SkImageInfo::Make(video_frame->visible_rect().width(), | 491 bitmap.allocN32Pixels(video_frame->visible_rect().width(), |
492 video_frame->visible_rect().height(), | 492 video_frame->visible_rect().height()); |
493 kPMColor_SkColorType, | |
494 kPremul_SkAlphaType)); | |
495 bitmap.eraseColor(SK_ColorTRANSPARENT); | 493 bitmap.eraseColor(SK_ColorTRANSPARENT); |
496 SkCanvas canvas(bitmap); | 494 SkCanvas canvas(bitmap); |
497 | 495 |
498 video_renderer.Paint(video_frame.get(), | 496 video_renderer.Paint(video_frame.get(), |
499 &canvas, | 497 &canvas, |
500 video_frame->visible_rect(), | 498 video_frame->visible_rect(), |
501 0xff); | 499 0xff); |
502 | 500 |
503 CopyFromCompositingSurfaceCallback(quit_callback, | 501 CopyFromCompositingSurfaceCallback(quit_callback, |
504 result, | 502 result, |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 853 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
856 testing::ValuesIn(kAllCompositingModes)); | 854 testing::ValuesIn(kAllCompositingModes)); |
857 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 855 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
858 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 856 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
859 testing::ValuesIn(kAllCompositingModes)); | 857 testing::ValuesIn(kAllCompositingModes)); |
860 | 858 |
861 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 859 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
862 | 860 |
863 } // namespace | 861 } // namespace |
864 } // namespace content | 862 } // namespace content |
OLD | NEW |