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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 23660006: FeatureInfo: Remove allowed_extensions and init workarounds early (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android_webview build Created 7 years, 3 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 | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 453b43d8a2b54c52befc50f7eda29d8436f1b43a..eeeabd94c01d87f4205b9bb778af6979324c7e3a 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -133,6 +133,22 @@ FeatureInfo::Workarounds::Workarounds() :
}
FeatureInfo::FeatureInfo() {
+ InitializeBasicState(*CommandLine::ForCurrentProcess());
+}
+
+FeatureInfo::FeatureInfo(const CommandLine& command_line) {
+ InitializeBasicState(command_line);
+}
+
+void FeatureInfo::InitializeBasicState(const CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) {
+ std::string types = command_line.GetSwitchValueASCII(
+ switches::kGpuDriverBugWorkarounds);
+ StringToWorkarounds(types, &workarounds_);
+ }
+ feature_flags_.enable_shader_name_hashing =
+ !command_line.HasSwitch(switches::kDisableShaderNameHashing);
+
static const GLenum kAlphaTypes[] = {
GL_UNSIGNED_BYTE,
};
@@ -168,33 +184,23 @@ FeatureInfo::FeatureInfo() {
}
}
-bool FeatureInfo::Initialize(const char* allowed_features) {
+bool FeatureInfo::Initialize() {
disallowed_features_ = DisallowedFeatures();
- AddFeatures(*CommandLine::ForCurrentProcess());
+ InitializeFeatures();
return true;
}
-bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features,
- const char* allowed_features) {
+bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features) {
disallowed_features_ = disallowed_features;
- AddFeatures(*CommandLine::ForCurrentProcess());
+ InitializeFeatures();
return true;
}
-void FeatureInfo::AddFeatures(const CommandLine& command_line) {
+void FeatureInfo::InitializeFeatures() {
// Figure out what extensions to turn on.
StringSet extensions(
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
- if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) {
- std::string types = command_line.GetSwitchValueASCII(
- switches::kGpuDriverBugWorkarounds);
- StringToWorkarounds(types, &workarounds_);
- }
-
- feature_flags_.enable_shader_name_hashing =
- !command_line.HasSwitch(switches::kDisableShaderNameHashing);
-
bool npot_ok = false;
AddExtensionString("GL_ANGLE_translated_shader_source");
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698