Chromium Code Reviews| 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 bb28f10dd7c5a14bbed629605053597485c05990..2f5c3bc4eb1fa8ad0666ed0e6ff87d7505a83c9b 100644 |
| --- a/content/browser/gpu/gpu_data_manager_impl_private.cc |
| +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc |
| @@ -717,7 +717,9 @@ void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { |
| void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo( |
| const gpu::GpuFeatureInfo& gpu_feature_info) { |
| - gpu_feature_info_ = gpu_feature_info; |
| + if (!use_swiftshader_) { |
| + gpu_feature_info_ = gpu_feature_info; |
| + } |
| } |
| void GpuDataManagerImplPrivate::UpdateVideoMemoryUsageStats( |
| @@ -1269,11 +1271,20 @@ void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() { |
| void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { |
| #if BUILDFLAG(ENABLE_SWIFTSHADER) |
| - if (!GpuAccessAllowed(nullptr) || |
| - blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL)) { |
| - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kDisableSoftwareRasterizer)) |
| - use_swiftshader_ = true; |
| + if ((!GpuAccessAllowed(nullptr) || |
| + blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL)) && |
| + !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableSoftwareRasterizer)) { |
| + use_swiftshader_ = true; |
| + |
| + // Remove all previously recorded GPU info |
| + gpu_info_ = gpu::GPUInfo(); |
| + // Set some basic info to identify the GPU as SwiftShader |
| + gpu_info_.gl_vendor = "Google Inc."; |
| + gpu_info_.gl_renderer = "Google SwiftShader"; |
| + |
| + for (auto& status : gpu_feature_info_.status_values) |
| + status = gpu::kGpuFeatureStatusBlacklisted; |
|
Ken Russell (switch to Gerrit)
2017/03/29 17:29:22
Is this status update correct? Isn't WebGL still s
sugoi1
2017/03/29 17:39:47
Yes, but the feature is now called "GPU_FEATURE_TY
Zhenyao Mo
2017/03/29 17:48:48
In theory the webgl status should be hardware_acce
|
| } |
| #endif |
| } |