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 "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
22 #include "base/version.h" | 22 #include "base/version.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "cc/base/switches.h" | 24 #include "cc/base/switches.h" |
25 #include "content/browser/gpu/gpu_process_host.h" | 25 #include "content/browser/gpu/gpu_process_host.h" |
26 #include "content/common/gpu_host_messages.h" | 26 #include "content/common/gpu_host_messages.h" |
27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
28 #include "content/public/browser/gpu_data_manager_observer.h" | 28 #include "content/public/browser/gpu_data_manager_observer.h" |
29 #include "content/public/common/content_client.h" | 29 #include "content/public/common/content_client.h" |
30 #include "content/public/common/content_constants.h" | 30 #include "content/public/common/content_constants.h" |
| 31 #include "content/public/common/content_features.h" |
31 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/web_preferences.h" | 33 #include "content/public/common/web_preferences.h" |
33 #include "gpu/command_buffer/service/gpu_preferences.h" | 34 #include "gpu/command_buffer/service/gpu_preferences.h" |
34 #include "gpu/command_buffer/service/gpu_switches.h" | 35 #include "gpu/command_buffer/service/gpu_switches.h" |
35 #include "gpu/config/gpu_control_list_jsons.h" | 36 #include "gpu/config/gpu_control_list_jsons.h" |
36 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 37 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
37 #include "gpu/config/gpu_feature_type.h" | 38 #include "gpu/config/gpu_feature_type.h" |
38 #include "gpu/config/gpu_info_collector.h" | 39 #include "gpu/config/gpu_info_collector.h" |
39 #include "gpu/config/gpu_switches.h" | 40 #include "gpu/config/gpu_switches.h" |
40 #include "gpu/config/gpu_util.h" | 41 #include "gpu/config/gpu_util.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } | 686 } |
686 | 687 |
687 void GpuDataManagerImplPrivate::AppendRendererCommandLine( | 688 void GpuDataManagerImplPrivate::AppendRendererCommandLine( |
688 base::CommandLine* command_line) const { | 689 base::CommandLine* command_line) const { |
689 DCHECK(command_line); | 690 DCHECK(command_line); |
690 | 691 |
691 if (ShouldDisableAcceleratedVideoDecode(command_line)) | 692 if (ShouldDisableAcceleratedVideoDecode(command_line)) |
692 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); | 693 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); |
693 #if BUILDFLAG(ENABLE_WEBRTC) | 694 #if BUILDFLAG(ENABLE_WEBRTC) |
694 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 695 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
695 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 696 !command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding)) |
696 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 697 command_line->AppendSwitch(switches::kDisableWebRtcHWVP8Encoding); |
697 #endif | 698 #endif |
698 | 699 |
699 #if defined(USE_AURA) | 700 #if defined(USE_AURA) |
700 if (!CanUseGpuBrowserCompositor()) | 701 if (!CanUseGpuBrowserCompositor()) |
701 command_line->AppendSwitch(switches::kDisableGpuCompositing); | 702 command_line->AppendSwitch(switches::kDisableGpuCompositing); |
702 #endif | 703 #endif |
703 } | 704 } |
704 | 705 |
705 void GpuDataManagerImplPrivate::AppendGpuCommandLine( | 706 void GpuDataManagerImplPrivate::AppendGpuCommandLine( |
706 base::CommandLine* command_line, | 707 base::CommandLine* command_line, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 #if defined(OS_WIN) | 769 #if defined(OS_WIN) |
769 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) && | 770 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) && |
770 gpu_preferences) { | 771 gpu_preferences) { |
771 gpu_preferences->enable_accelerated_vpx_decode = | 772 gpu_preferences->enable_accelerated_vpx_decode = |
772 gpu::GpuPreferences::VPX_VENDOR_NONE; | 773 gpu::GpuPreferences::VPX_VENDOR_NONE; |
773 } | 774 } |
774 #endif | 775 #endif |
775 | 776 |
776 #if BUILDFLAG(ENABLE_WEBRTC) | 777 #if BUILDFLAG(ENABLE_WEBRTC) |
777 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 778 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
778 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 779 !command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) && |
| 780 !base::FeatureList::IsEnabled(features::kWebRtcHWH264Encoding)) { |
779 if (gpu_preferences) { | 781 if (gpu_preferences) { |
780 gpu_preferences->disable_web_rtc_hw_encoding = true; | 782 gpu_preferences->disable_web_rtc_hw_encoding = true; |
781 } else { | 783 } else { |
782 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 784 command_line->AppendSwitch(switches::kDisableWebRtcHWVP8Encoding); |
783 } | 785 } |
784 } | 786 } |
785 #endif | 787 #endif |
786 | 788 |
787 if (gpu_preferences) { // enable_es3_apis | 789 if (gpu_preferences) { // enable_es3_apis |
788 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); | 790 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); |
789 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 791 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
790 switches::kEnableES3APIs); | 792 switches::kEnableES3APIs); |
791 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 793 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
792 switches::kDisableES3APIs); | 794 switches::kDisableES3APIs); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1324 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1323 #if defined(OS_WIN) | 1325 #if defined(OS_WIN) |
1324 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1326 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1325 #endif | 1327 #endif |
1326 complete_gpu_info_already_requested_ = true; | 1328 complete_gpu_info_already_requested_ = true; |
1327 // Some observers might be waiting. | 1329 // Some observers might be waiting. |
1328 NotifyGpuInfoUpdate(); | 1330 NotifyGpuInfoUpdate(); |
1329 } | 1331 } |
1330 | 1332 |
1331 } // namespace content | 1333 } // namespace content |
OLD | NEW |