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

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

Issue 2737983002: WebGL feature will only enabled when accelerated (Closed)
Patch Set: Added SwiftShader as a GPU feature 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 5bd58166d21c06128803323d55d75381bfd7dfc4..f9ec8e15bbc599cf857e0bf7ba428bb50aa28efb 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -933,8 +933,13 @@ void GpuDataManagerImplPrivate::DisableHardwareAcceleration() {
card_blacklisted_ = true;
- for (int i = 0; i < gpu::NUMBER_OF_GPU_FEATURE_TYPES; ++i)
- blacklisted_features_.insert(i);
+ for (int i = 0; i < gpu::NUMBER_OF_GPU_FEATURE_TYPES; ++i) {
+ if ((i != gpu::GPU_FEATURE_TYPE_SWIFTSHADER) ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableSoftwareRasterizer)) {
Zhenyao Mo 2017/03/09 19:18:03 Consider this situation: on a system where kDisabl
sugoi1 2017/03/09 19:24:33 Ok, but this isn't new, I simply moved it from Gpu
sugoi1 2017/03/09 20:07:12 Removed kDisableSoftwareRasterizer check.
sugoi1 2017/03/09 20:17:07 Wait a second, I just looked into it and the kDisa
+ blacklisted_features_.insert(i);
+ }
+ }
EnableSwiftShaderIfNecessary();
NotifyGpuInfoUpdate();
@@ -1231,6 +1236,11 @@ void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures(
blacklisted_features_.insert(gpu::GPU_FEATURE_TYPE_WEBGL);
}
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableSoftwareRasterizer)) {
+ blacklisted_features_.insert(gpu::GPU_FEATURE_TYPE_SWIFTSHADER);
Zhenyao Mo 2017/03/09 19:18:03 Same here.
sugoi1 2017/03/09 20:07:12 Removed this change.
+ }
+
EnableSwiftShaderIfNecessary();
}
@@ -1257,11 +1267,10 @@ void GpuDataManagerImplPrivate::NotifyGpuInfoUpdate() {
}
void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() {
- if (!GpuAccessAllowed(NULL) ||
+ if (!GpuAccessAllowed(nullptr) ||
blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) {
if (!swiftshader_path_.empty() &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableSoftwareRasterizer))
+ !blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_SWIFTSHADER))
use_swiftshader_ = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698