Index: content/browser/gpu/gpu_data_manager_impl_private.cc |
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc |
index 9bfb5f5722daf4144ff28636200e7cdce259762f..55f8026c40c8d129f84bd95053df4ff42d1aefc2 100644 |
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc |
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc |
@@ -319,6 +319,24 @@ void AdjustGpuSwitchingOption(std::set<int>* workarounds) { |
} |
} |
+bool IsAcceleratedVideoDecodeEnabled( |
+ const GpuDataManagerImplPrivate* gpu_manager) { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ if (gpu_manager->IsFeatureBlacklisted( |
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && |
+ !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
+ return false; |
+ |
+#if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_ANDROID) |
+ return true; |
+#endif |
+#if defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
+ return true; |
+#endif |
+ |
+ return false; |
+} |
+ |
// Block all domains' use of 3D APIs for this many milliseconds if |
// approaching a threshold where system stability might be compromised. |
const int64 kBlockAllDomainsMs = 10000; |
@@ -646,8 +664,7 @@ void GpuDataManagerImplPrivate::AppendRendererCommandLine( |
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) && |
!command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) |
command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); |
- if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && |
- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) |
+ if (!IsAcceleratedVideoDecodeEnabled(this)) |
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); |
#if defined(ENABLE_WEBRTC) |
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
@@ -706,10 +723,8 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( |
IntSetToString(gpu_driver_bugs_)); |
} |
- if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && |
- !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) { |
+ if (!IsAcceleratedVideoDecodeEnabled(this)) |
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); |
- } |
#if defined(ENABLE_WEBRTC) |
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
!command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |