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

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

Issue 2781993002: Get the proper GPU Info in GpuProcessHost (Closed)
Patch Set: Added tests 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
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 a8aed63c7af29974eac7a0594f9bd56dc5a03bfa..bee3831282470cbda91dc34994691d98a4cef68a 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -721,7 +721,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(
@@ -1277,11 +1279,21 @@ 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";
+ gpu_info_.software_rendering = true;
+
+ for (auto& status : gpu_feature_info_.status_values)
+ status = gpu::kGpuFeatureStatusBlacklisted;
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698