Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2781993002: Get the proper GPU Info in GpuProcessHost (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698