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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 output_size, | 772 output_size, |
773 expected_bitmap_size, | 773 expected_bitmap_size, |
774 video_frame); | 774 video_frame); |
775 } | 775 } |
776 | 776 |
777 class CompositingRenderWidgetHostViewTabCaptureHighDPI | 777 class CompositingRenderWidgetHostViewTabCaptureHighDPI |
778 : public CompositingRenderWidgetHostViewBrowserTestTabCapture { | 778 : public CompositingRenderWidgetHostViewBrowserTestTabCapture { |
779 public: | 779 public: |
780 CompositingRenderWidgetHostViewTabCaptureHighDPI() : kScale(2.f) {} | 780 CompositingRenderWidgetHostViewTabCaptureHighDPI() : kScale(2.f) {} |
781 | 781 |
782 virtual void SetUpOnMainThread() OVERRIDE { | 782 virtual void SetUpCommandLine(base::CommandLine* cmd) OVERRIDE { |
783 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 783 CompositingRenderWidgetHostViewBrowserTestTabCapture::SetUpCommandLine(cmd); |
784 cmd->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 784 cmd->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
785 base::StringPrintf("%f", scale())); | 785 base::StringPrintf("%f", scale())); |
786 #if defined(OS_WIN) | |
787 gfx::ForceHighDPISupportForTesting(scale()); | 786 gfx::ForceHighDPISupportForTesting(scale()); |
788 gfx::EnableHighDPISupport(); | 787 gfx::EnableHighDPISupport(); |
| 788 } |
| 789 |
| 790 virtual void SetUpOnMainThread() OVERRIDE { |
| 791 #if defined(OS_WIN) |
| 792 // gfx::ForceHighDPISupportForTesting(scale()); |
| 793 // gfx::EnableHighDPISupport(); |
789 #endif | 794 #endif |
790 } | 795 } |
791 | 796 |
792 float scale() const { return kScale; } | 797 float scale() const { return kScale; } |
793 | 798 |
794 private: | 799 private: |
795 virtual bool ShouldContinueAfterTestURLLoad() OVERRIDE { | 800 virtual bool ShouldContinueAfterTestURLLoad() OVERRIDE { |
796 // Short-circuit a pass for platforms where setting up high-DPI fails. | 801 // Short-circuit a pass for platforms where setting up high-DPI fails. |
797 if (ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactor( | 802 if (ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactor( |
798 GetScaleFactorForView(GetRenderWidgetHostView()))) != scale()) { | 803 GetScaleFactorForView(GetRenderWidgetHostView()))) != scale()) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 862 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
858 testing::ValuesIn(kAllCompositingModes)); | 863 testing::ValuesIn(kAllCompositingModes)); |
859 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 864 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
860 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 865 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
861 testing::ValuesIn(kAllCompositingModes)); | 866 testing::ValuesIn(kAllCompositingModes)); |
862 | 867 |
863 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 868 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
864 | 869 |
865 } // namespace | 870 } // namespace |
866 } // namespace content | 871 } // namespace content |
OLD | NEW |