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

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

Issue 2505473002: Don't forbid GPU process if WebGL/WebGL2 is disabled on GPU but not browser. (Closed)
Patch Set: Created 4 years, 1 month 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 2ebba27be59ac3d858b9549732c2f164a78c254e..bc782ce476bb30f6cf7ee7f1513da527fb1350f4 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -4,6 +4,8 @@
#include "content/browser/gpu/gpu_data_manager_impl_private.h"
+#include <algorithm>
+#include <iterator>
#include <memory>
#include <utility>
@@ -347,12 +349,22 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(
// We only need to block GPU process if more features are disallowed other
// than those in the preliminary gpu feature flags because the latter work
- // through renderer commandline switches.
- std::set<int> features = preliminary_blacklisted_features_;
- gpu::MergeFeatureSets(&features, blacklisted_features_);
- if (features.size() > preliminary_blacklisted_features_.size()) {
+ // through renderer commandline switches. WebGL and WebGL2 should not matter
+ // because their context creation can always be rejected on the GPU process
+ // side.
Ken Russell (switch to Gerrit) 2016/11/15 01:25:14 Would other GPU acceleration features also be good
Zhenyao Mo 2016/11/15 01:38:21 Might be. Good point. Added.
+ std::set<int> feature_diffs;
+ std::set_difference(blacklisted_features_.begin(),
+ blacklisted_features_.end(),
+ preliminary_blacklisted_features_.begin(),
+ preliminary_blacklisted_features_.end(),
+ std::inserter(feature_diffs, feature_diffs.begin()));
+ if (feature_diffs.size()) {
+ feature_diffs.erase(gpu::GPU_FEATURE_TYPE_WEBGL);
+ feature_diffs.erase(gpu::GPU_FEATURE_TYPE_WEBGL2);
+ }
+ if (feature_diffs.size()) {
if (reason) {
- *reason = "Features are disabled upon full but not preliminary GPU info.";
+ *reason = "Features are disabled on full but not preliminary GPU info.";
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698