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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 gpu_feature_info_ = gpu_feature_info; | 721 gpu_feature_info_ = gpu_feature_info; |
722 } | 722 } |
723 } | 723 } |
724 | 724 |
725 void GpuDataManagerImplPrivate::AppendRendererCommandLine( | 725 void GpuDataManagerImplPrivate::AppendRendererCommandLine( |
726 base::CommandLine* command_line) const { | 726 base::CommandLine* command_line) const { |
727 DCHECK(command_line); | 727 DCHECK(command_line); |
728 | 728 |
729 if (ShouldDisableAcceleratedVideoDecode(command_line)) | 729 if (ShouldDisableAcceleratedVideoDecode(command_line)) |
730 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); | 730 command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); |
731 #if BUILDFLAG(ENABLE_WEBRTC) | |
732 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | |
733 !command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding)) | |
734 command_line->AppendSwitch(switches::kDisableWebRtcHWVP8Encoding); | |
735 #endif | |
736 | 731 |
737 #if defined(USE_AURA) | 732 #if defined(USE_AURA) |
738 if (!CanUseGpuBrowserCompositor()) | 733 if (!CanUseGpuBrowserCompositor()) |
739 command_line->AppendSwitch(switches::kDisableGpuCompositing); | 734 command_line->AppendSwitch(switches::kDisableGpuCompositing); |
740 #endif | 735 #endif |
741 } | 736 } |
742 | 737 |
743 void GpuDataManagerImplPrivate::AppendGpuCommandLine( | 738 void GpuDataManagerImplPrivate::AppendGpuCommandLine( |
744 base::CommandLine* command_line, | 739 base::CommandLine* command_line, |
745 gpu::GpuPreferences* gpu_preferences) const { | 740 gpu::GpuPreferences* gpu_preferences) const { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 } | 802 } |
808 #endif | 803 #endif |
809 #if defined(OS_WIN) | 804 #if defined(OS_WIN) |
810 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) && | 805 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VPX_DECODE) && |
811 gpu_preferences) { | 806 gpu_preferences) { |
812 gpu_preferences->enable_accelerated_vpx_decode = | 807 gpu_preferences->enable_accelerated_vpx_decode = |
813 gpu::GpuPreferences::VPX_VENDOR_NONE; | 808 gpu::GpuPreferences::VPX_VENDOR_NONE; |
814 } | 809 } |
815 #endif | 810 #endif |
816 | 811 |
817 #if BUILDFLAG(ENABLE_WEBRTC) | |
818 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE)) { | |
819 #if defined (OS_ANDROID) | |
820 // On Android HW H264 is enabled by default behind a flag now, regardless of | |
821 // the blacklist. Disable HW encoding if every single HW codec is disabled. | |
822 // TODO(braveyao): remove this once the blacklist is removed | |
823 // (crbug.com/638664). | |
824 if (!base::FeatureList::IsEnabled(features::kWebRtcHWH264Encoding)) { | |
825 #endif | |
826 if (!command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | |
827 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | |
828 if (gpu_preferences) | |
829 gpu_preferences->disable_web_rtc_hw_encoding = true; | |
830 #if defined (OS_ANDROID) | |
831 } | |
832 #endif | |
833 } | |
834 #endif | |
835 | |
836 if (gpu_preferences) { // enable_es3_apis | 812 if (gpu_preferences) { // enable_es3_apis |
837 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); | 813 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); |
838 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 814 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
839 switches::kEnableES3APIs); | 815 switches::kEnableES3APIs); |
840 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 816 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
841 switches::kDisableES3APIs); | 817 switches::kDisableES3APIs); |
842 gpu_preferences->enable_es3_apis = (enabled || !blacklisted) && !disabled; | 818 gpu_preferences->enable_es3_apis = (enabled || !blacklisted) && !disabled; |
843 } | 819 } |
844 | 820 |
845 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 821 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1384 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1409 #if defined(OS_WIN) | 1385 #if defined(OS_WIN) |
1410 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1386 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1411 #endif | 1387 #endif |
1412 complete_gpu_info_already_requested_ = true; | 1388 complete_gpu_info_already_requested_ = true; |
1413 // Some observers might be waiting. | 1389 // Some observers might be waiting. |
1414 NotifyGpuInfoUpdate(); | 1390 NotifyGpuInfoUpdate(); |
1415 } | 1391 } |
1416 | 1392 |
1417 } // namespace content | 1393 } // namespace content |
OLD | NEW |