| 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 <string> | 8 #include <string> |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const char* allowed_features); | 70 const char* allowed_features); |
| 71 | 71 |
| 72 // Turns on certain features if they can be turned on. NULL turns on | 72 // Turns on certain features if they can be turned on. NULL turns on |
| 73 // all available features. | 73 // all available features. |
| 74 void AddFeatures(const char* desired_features); | 74 void AddFeatures(const char* desired_features); |
| 75 | 75 |
| 76 const Validators* validators() const { | 76 const Validators* validators() const { |
| 77 return &validators_; | 77 return &validators_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 const ValueValidator<GLenum>& GetTextureFormatValidator(GLenum format) { |
| 81 return texture_format_validators_[format]; |
| 82 } |
| 83 |
| 80 const std::string& extensions() const { | 84 const std::string& extensions() const { |
| 81 return extensions_; | 85 return extensions_; |
| 82 } | 86 } |
| 83 | 87 |
| 84 const FeatureFlags& feature_flags() const { | 88 const FeatureFlags& feature_flags() const { |
| 85 return feature_flags_; | 89 return feature_flags_; |
| 86 } | 90 } |
| 87 | 91 |
| 88 private: | 92 private: |
| 89 friend class base::RefCounted<FeatureInfo>; | 93 friend class base::RefCounted<FeatureInfo>; |
| 94 |
| 95 typedef base::hash_map<GLenum, ValueValidator<GLenum> > ValidatorMap; |
| 96 ValidatorMap texture_format_validators_; |
| 97 |
| 90 ~FeatureInfo(); | 98 ~FeatureInfo(); |
| 91 | 99 |
| 92 void AddExtensionString(const std::string& str); | 100 void AddExtensionString(const std::string& str); |
| 93 | 101 |
| 94 Validators validators_; | 102 Validators validators_; |
| 95 | 103 |
| 104 |
| 96 DisallowedFeatures disallowed_features_; | 105 DisallowedFeatures disallowed_features_; |
| 97 | 106 |
| 98 // The extensions string returned by glGetString(GL_EXTENSIONS); | 107 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 99 std::string extensions_; | 108 std::string extensions_; |
| 100 | 109 |
| 101 // Flags for some features | 110 // Flags for some features |
| 102 FeatureFlags feature_flags_; | 111 FeatureFlags feature_flags_; |
| 103 | 112 |
| 104 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 113 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 105 }; | 114 }; |
| 106 | 115 |
| 107 } // namespace gles2 | 116 } // namespace gles2 |
| 108 } // namespace gpu | 117 } // namespace gpu |
| 109 | 118 |
| 110 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 119 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 111 | 120 |
| 112 | 121 |
| OLD | NEW |