| 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");
|
|
|