Chromium Code Reviews| Index: content/browser/gpu/gpu_data_manager_impl.cc |
| diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc |
| index d549edf8f52267eb97f31172a31d00cc610d7b45..8f18faa4aba6f14a7265f4fa0255455eeca24a0e 100644 |
| --- a/content/browser/gpu/gpu_data_manager_impl.cc |
| +++ b/content/browser/gpu/gpu_data_manager_impl.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind_helpers.h" |
| #include "base/command_line.h" |
| #include "base/file_util.h" |
| +#include "base/metrics/field_trial.h" |
| #include "base/stringprintf.h" |
| #include "base/sys_info.h" |
| #include "base/values.h" |
| @@ -19,6 +20,7 @@ |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/gpu_data_manager_observer.h" |
| #include "content/public/common/content_client.h" |
| +#include "content/public/common/content_constants.h" |
| #include "content/public/common/content_switches.h" |
| #include "ui/base/ui_base_switches.h" |
| #include "ui/gl/gl_implementation.h" |
| @@ -383,6 +385,20 @@ void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( |
| video_memory_usage_stats); |
| } |
| +// Experiment to determine whether Stage3D should be blacklisted on XP. |
| +bool Stage3DBlacklisted() { |
| +#if !defined(OS_WIN) |
| + return false; |
| +#else |
| + if (base::win::GetVersion() >= base::win::VERSION_VISTA) |
| + return false; |
| + base::FieldTrial* trial = |
| + base::FieldTrialList::Find(content::kStage3DFieldTrialName); |
| + return !trial || |
| + trial->group_name() == content::kStage3DFieldTrialBlacklistedName; |
|
Alexei Svitkine (slow)
2012/09/19 20:33:16
Nit: You can just use:
return base::FieldTrialLis
|
| +#endif |
| +} |
| + |
| void GpuDataManagerImpl::UpdateBlacklistedFeatures( |
| GpuFeatureType features) { |
| CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| @@ -398,6 +414,9 @@ void GpuDataManagerImpl::UpdateBlacklistedFeatures( |
| command_line->HasSwitch(switches::kBlacklistWebGL)) { |
| flags |= content::GPU_FEATURE_TYPE_WEBGL; |
| } |
| + if (Stage3DBlacklisted()) { |
| + flags |= content::GPU_FEATURE_TYPE_FLASH_STAGE3D; |
| + } |
| gpu_feature_type_ = static_cast<GpuFeatureType>(flags); |
| EnableSoftwareRenderingIfNecessary(); |