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/location.h" | 7 #include "base/location.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 "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 #define MAYBE_CopyToVideoFrame_CenterRegion CopyToVideoFrame_CenterRegion | 837 #define MAYBE_CopyToVideoFrame_CenterRegion CopyToVideoFrame_CenterRegion |
838 #define MAYBE_CopyToVideoFrame_ScaledResult CopyToVideoFrame_ScaledResult | 838 #define MAYBE_CopyToVideoFrame_ScaledResult CopyToVideoFrame_ScaledResult |
839 #endif | 839 #endif |
840 | 840 |
841 IN_PROC_BROWSER_TEST_P( | 841 IN_PROC_BROWSER_TEST_P( |
842 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 842 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
843 MAYBE_CopyToBitmap_EntireRegion) { | 843 MAYBE_CopyToBitmap_EntireRegion) { |
844 gfx::Size html_rect_size(200, 150); | 844 gfx::Size html_rect_size(200, 150); |
845 gfx::Rect copy_rect(200, 150); | 845 gfx::Rect copy_rect(200, 150); |
846 // Scale the output size so that, internally, scaling is not occurring. | 846 // Scale the output size so that, internally, scaling is not occurring. |
847 gfx::Size output_size = | 847 gfx::Size output_size = gfx::ScaleToRoundedSize(copy_rect.size(), scale()); |
848 gfx::ToRoundedSize(gfx::ScaleSize(copy_rect.size(), scale())); | |
849 bool video_frame = false; | 848 bool video_frame = false; |
850 PerformTestWithLeftRightRects(html_rect_size, | 849 PerformTestWithLeftRightRects(html_rect_size, |
851 copy_rect, | 850 copy_rect, |
852 output_size, | 851 output_size, |
853 video_frame); | 852 video_frame); |
854 } | 853 } |
855 | 854 |
856 IN_PROC_BROWSER_TEST_P( | 855 IN_PROC_BROWSER_TEST_P( |
857 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 856 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
858 MAYBE_CopyToBitmap_CenterRegion) { | 857 MAYBE_CopyToBitmap_CenterRegion) { |
859 gfx::Size html_rect_size(200, 150); | 858 gfx::Size html_rect_size(200, 150); |
860 // Grab 90x60 pixels from the center of the tab contents. | 859 // Grab 90x60 pixels from the center of the tab contents. |
861 gfx::Rect copy_rect = | 860 gfx::Rect copy_rect = |
862 gfx::Rect(gfx::Rect(html_rect_size).CenterPoint() - gfx::Vector2d(45, 30), | 861 gfx::Rect(gfx::Rect(html_rect_size).CenterPoint() - gfx::Vector2d(45, 30), |
863 gfx::Size(90, 60)); | 862 gfx::Size(90, 60)); |
864 // Scale the output size so that, internally, scaling is not occurring. | 863 // Scale the output size so that, internally, scaling is not occurring. |
865 gfx::Size output_size = | 864 gfx::Size output_size = gfx::ScaleToRoundedSize(copy_rect.size(), scale()); |
866 gfx::ToRoundedSize(gfx::ScaleSize(copy_rect.size(), scale())); | |
867 bool video_frame = false; | 865 bool video_frame = false; |
868 PerformTestWithLeftRightRects(html_rect_size, | 866 PerformTestWithLeftRightRects(html_rect_size, |
869 copy_rect, | 867 copy_rect, |
870 output_size, | 868 output_size, |
871 video_frame); | 869 video_frame); |
872 } | 870 } |
873 | 871 |
874 IN_PROC_BROWSER_TEST_P( | 872 IN_PROC_BROWSER_TEST_P( |
875 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 873 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
876 MAYBE_CopyToBitmap_ScaledResult) { | 874 MAYBE_CopyToBitmap_ScaledResult) { |
877 gfx::Size html_rect_size(200, 100); | 875 gfx::Size html_rect_size(200, 100); |
878 gfx::Rect copy_rect(200, 100); | 876 gfx::Rect copy_rect(200, 100); |
879 // Output is being down-scaled since output_size is in phyiscal pixels. | 877 // Output is being down-scaled since output_size is in phyiscal pixels. |
880 gfx::Size output_size(200, 100); | 878 gfx::Size output_size(200, 100); |
881 bool video_frame = false; | 879 bool video_frame = false; |
882 PerformTestWithLeftRightRects(html_rect_size, | 880 PerformTestWithLeftRightRects(html_rect_size, |
883 copy_rect, | 881 copy_rect, |
884 output_size, | 882 output_size, |
885 video_frame); | 883 video_frame); |
886 } | 884 } |
887 | 885 |
888 IN_PROC_BROWSER_TEST_P( | 886 IN_PROC_BROWSER_TEST_P( |
889 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 887 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
890 MAYBE_CopyToVideoFrame_EntireRegion) { | 888 MAYBE_CopyToVideoFrame_EntireRegion) { |
891 gfx::Size html_rect_size(200, 150); | 889 gfx::Size html_rect_size(200, 150); |
892 gfx::Rect copy_rect(200, 150); | 890 gfx::Rect copy_rect(200, 150); |
893 // Scale the output size so that, internally, scaling is not occurring. | 891 // Scale the output size so that, internally, scaling is not occurring. |
894 gfx::Size output_size = | 892 gfx::Size output_size = gfx::ScaleToRoundedSize(copy_rect.size(), scale()); |
895 gfx::ToRoundedSize(gfx::ScaleSize(copy_rect.size(), scale())); | |
896 bool video_frame = true; | 893 bool video_frame = true; |
897 PerformTestWithLeftRightRects(html_rect_size, | 894 PerformTestWithLeftRightRects(html_rect_size, |
898 copy_rect, | 895 copy_rect, |
899 output_size, | 896 output_size, |
900 video_frame); | 897 video_frame); |
901 } | 898 } |
902 | 899 |
903 IN_PROC_BROWSER_TEST_P( | 900 IN_PROC_BROWSER_TEST_P( |
904 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 901 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
905 MAYBE_CopyToVideoFrame_CenterRegion) { | 902 MAYBE_CopyToVideoFrame_CenterRegion) { |
906 gfx::Size html_rect_size(200, 150); | 903 gfx::Size html_rect_size(200, 150); |
907 // Grab 90x60 pixels from the center of the tab contents. | 904 // Grab 90x60 pixels from the center of the tab contents. |
908 gfx::Rect copy_rect = | 905 gfx::Rect copy_rect = |
909 gfx::Rect(gfx::Rect(html_rect_size).CenterPoint() - gfx::Vector2d(45, 30), | 906 gfx::Rect(gfx::Rect(html_rect_size).CenterPoint() - gfx::Vector2d(45, 30), |
910 gfx::Size(90, 60)); | 907 gfx::Size(90, 60)); |
911 // Scale the output size so that, internally, scaling is not occurring. | 908 // Scale the output size so that, internally, scaling is not occurring. |
912 gfx::Size output_size = | 909 gfx::Size output_size = gfx::ScaleToRoundedSize(copy_rect.size(), scale()); |
913 gfx::ToRoundedSize(gfx::ScaleSize(copy_rect.size(), scale())); | |
914 bool video_frame = true; | 910 bool video_frame = true; |
915 PerformTestWithLeftRightRects(html_rect_size, | 911 PerformTestWithLeftRightRects(html_rect_size, |
916 copy_rect, | 912 copy_rect, |
917 output_size, | 913 output_size, |
918 video_frame); | 914 video_frame); |
919 } | 915 } |
920 | 916 |
921 IN_PROC_BROWSER_TEST_P( | 917 IN_PROC_BROWSER_TEST_P( |
922 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 918 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
923 MAYBE_CopyToVideoFrame_ScaledResult) { | 919 MAYBE_CopyToVideoFrame_ScaledResult) { |
(...skipping 24 matching lines...) Expand all Loading... |
948 kTestCompositingModes); | 944 kTestCompositingModes); |
949 INSTANTIATE_TEST_CASE_P( | 945 INSTANTIATE_TEST_CASE_P( |
950 GLAndSoftwareCompositing, | 946 GLAndSoftwareCompositing, |
951 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, | 947 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, |
952 kTestCompositingModes); | 948 kTestCompositingModes); |
953 | 949 |
954 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 950 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
955 | 951 |
956 } // namespace | 952 } // namespace |
957 } // namespace content | 953 } // namespace content |
OLD | NEW |