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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 SetExcludeRect( | 725 SetExcludeRect( |
726 gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); | 726 gfx::Rect(output_size.width() / 2 - 1, 0, 2, output_size.height())); |
727 } | 727 } |
728 #endif | 728 #endif |
729 | 729 |
730 base::Callback<void(bool, const SkBitmap&)> callback = | 730 base::Callback<void(bool, const SkBitmap&)> callback = |
731 base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: | 731 base::Bind(&CompositingRenderWidgetHostViewBrowserTestTabCapture:: |
732 CopyFromCompositingSurfaceCallback, | 732 CopyFromCompositingSurfaceCallback, |
733 base::Unretained(this), | 733 base::Unretained(this), |
734 run_loop.QuitClosure()); | 734 run_loop.QuitClosure()); |
735 rwhvp->CopyFromCompositingSurface(copy_rect, | 735 rwhvp->CopyFromCompositingSurface(copy_rect, output_size, callback); |
736 output_size, | |
737 callback, | |
738 false); | |
739 } | 736 } |
740 run_loop.Run(); | 737 run_loop.Run(); |
741 } | 738 } |
742 | 739 |
743 // Sets up |bitmap| to have size |copy_size|. It floods the left half with | 740 // Sets up |bitmap| to have size |copy_size|. It floods the left half with |
744 // #0ff and the right half with #ff0. | 741 // #0ff and the right half with #ff0. |
745 void SetupLeftRightBitmap(const gfx::Size& copy_size, SkBitmap* bitmap) { | 742 void SetupLeftRightBitmap(const gfx::Size& copy_size, SkBitmap* bitmap) { |
746 bitmap->setConfig( | 743 bitmap->setConfig( |
747 SkBitmap::kARGB_8888_Config, copy_size.width(), copy_size.height()); | 744 SkBitmap::kARGB_8888_Config, copy_size.width(), copy_size.height()); |
748 bitmap->allocPixels(); | 745 bitmap->allocPixels(); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 944 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
948 testing::ValuesIn(kAllCompositingModes)); | 945 testing::ValuesIn(kAllCompositingModes)); |
949 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 946 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
950 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 947 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
951 testing::ValuesIn(kAllCompositingModes)); | 948 testing::ValuesIn(kAllCompositingModes)); |
952 | 949 |
953 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 950 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
954 | 951 |
955 } // namespace | 952 } // namespace |
956 } // namespace content | 953 } // namespace content |
OLD | NEW |