| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 #define GPU_OP(type, name) bool name; | 58 #define GPU_OP(type, name) bool name; |
| 59 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 59 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 60 #undef GPU_OP | 60 #undef GPU_OP |
| 61 | 61 |
| 62 // Note: 0 here means use driver limit. | 62 // Note: 0 here means use driver limit. |
| 63 GLint max_texture_size; | 63 GLint max_texture_size; |
| 64 GLint max_cube_map_texture_size; | 64 GLint max_cube_map_texture_size; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // Constructor with workarounds taken from the current process's CommandLine |
| 67 FeatureInfo(); | 68 FeatureInfo(); |
| 68 | 69 |
| 69 // If allowed features = NULL or "*", all features are allowed. Otherwise | 70 // Constructor with workarounds taken from |command_line| |
| 70 // only features that match the strings in allowed_features are allowed. | 71 FeatureInfo(const CommandLine& command_line); |
| 71 bool Initialize(const char* allowed_features); | |
| 72 bool Initialize(const DisallowedFeatures& disallowed_features, | |
| 73 const char* allowed_features); | |
| 74 | 72 |
| 75 // Turns on certain features if they can be turned on. | 73 // Initializes the feature information. Needs a current GL context. |
| 76 void AddFeatures(const CommandLine& command_line); | 74 bool Initialize(); |
| 75 bool Initialize(const DisallowedFeatures& disallowed_features); |
| 77 | 76 |
| 78 const Validators* validators() const { | 77 const Validators* validators() const { |
| 79 return &validators_; | 78 return &validators_; |
| 80 } | 79 } |
| 81 | 80 |
| 82 const ValueValidator<GLenum>& GetTextureFormatValidator(GLenum format) { | 81 const ValueValidator<GLenum>& GetTextureFormatValidator(GLenum format) { |
| 83 return texture_format_validators_[format]; | 82 return texture_format_validators_[format]; |
| 84 } | 83 } |
| 85 | 84 |
| 86 const std::string& extensions() const { | 85 const std::string& extensions() const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 99 friend class base::RefCounted<FeatureInfo>; | 98 friend class base::RefCounted<FeatureInfo>; |
| 100 friend class BufferManagerClientSideArraysTest; | 99 friend class BufferManagerClientSideArraysTest; |
| 101 friend class GLES2DecoderTestBase; | 100 friend class GLES2DecoderTestBase; |
| 102 | 101 |
| 103 typedef base::hash_map<GLenum, ValueValidator<GLenum> > ValidatorMap; | 102 typedef base::hash_map<GLenum, ValueValidator<GLenum> > ValidatorMap; |
| 104 ValidatorMap texture_format_validators_; | 103 ValidatorMap texture_format_validators_; |
| 105 | 104 |
| 106 ~FeatureInfo(); | 105 ~FeatureInfo(); |
| 107 | 106 |
| 108 void AddExtensionString(const std::string& str); | 107 void AddExtensionString(const std::string& str); |
| 108 void InitializeBasicState(const CommandLine& command_line); |
| 109 void InitializeFeatures(); |
| 109 | 110 |
| 110 Validators validators_; | 111 Validators validators_; |
| 111 | 112 |
| 112 DisallowedFeatures disallowed_features_; | 113 DisallowedFeatures disallowed_features_; |
| 113 | 114 |
| 114 // The extensions string returned by glGetString(GL_EXTENSIONS); | 115 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 115 std::string extensions_; | 116 std::string extensions_; |
| 116 | 117 |
| 117 // Flags for some features | 118 // Flags for some features |
| 118 FeatureFlags feature_flags_; | 119 FeatureFlags feature_flags_; |
| 119 | 120 |
| 120 // Flags for Workarounds. | 121 // Flags for Workarounds. |
| 121 Workarounds workarounds_; | 122 Workarounds workarounds_; |
| 122 | 123 |
| 123 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 124 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 } // namespace gles2 | 127 } // namespace gles2 |
| 127 } // namespace gpu | 128 } // namespace gpu |
| 128 | 129 |
| 129 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 130 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| OLD | NEW |