| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 9 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
| 10 | 11 |
| 11 namespace gpu { | 12 namespace gpu { |
| 12 namespace gles2 { | 13 namespace gles2 { |
| 13 | 14 |
| 14 // FeatureInfo records the features that are available for a particular context. | 15 // FeatureInfo records the features that are available for a particular context. |
| 15 class FeatureInfo { | 16 class FeatureInfo { |
| 16 public: | 17 public: |
| 17 struct FeatureFlags { | 18 struct FeatureFlags { |
| 18 FeatureFlags() | 19 FeatureFlags() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 bool enable_texture_float_linear; | 31 bool enable_texture_float_linear; |
| 31 bool enable_texture_half_float_linear; | 32 bool enable_texture_half_float_linear; |
| 32 bool chromium_webglsl; | 33 bool chromium_webglsl; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 FeatureInfo(); | 36 FeatureInfo(); |
| 36 | 37 |
| 37 // If allowed features = NULL or "*", all features are allowed. Otherwise | 38 // If allowed features = NULL or "*", all features are allowed. Otherwise |
| 38 // only features that match the strings in allowed_features are allowed. | 39 // only features that match the strings in allowed_features are allowed. |
| 39 bool Initialize(const char* allowed_features); | 40 bool Initialize(const char* allowed_features); |
| 41 bool Initialize(const DisallowedExtensions& disallowed_extensions, |
| 42 const char* allowed_features); |
| 40 | 43 |
| 41 // Turns on certain features if they can be turned on. NULL turns on | 44 // Turns on certain features if they can be turned on. NULL turns on |
| 42 // all available features. | 45 // all available features. |
| 43 void AddFeatures(const char* desired_features); | 46 void AddFeatures(const char* desired_features); |
| 44 | 47 |
| 45 const Validators* validators() const { | 48 const Validators* validators() const { |
| 46 return &validators_; | 49 return &validators_; |
| 47 } | 50 } |
| 48 | 51 |
| 49 const std::string& extensions() const { | 52 const std::string& extensions() const { |
| 50 return extensions_; | 53 return extensions_; |
| 51 } | 54 } |
| 52 | 55 |
| 53 const FeatureFlags& feature_flags() const { | 56 const FeatureFlags& feature_flags() const { |
| 54 return feature_flags_; | 57 return feature_flags_; |
| 55 } | 58 } |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 void AddExtensionString(const std::string& str); | 61 void AddExtensionString(const std::string& str); |
| 59 | 62 |
| 60 Validators validators_; | 63 Validators validators_; |
| 61 | 64 |
| 65 DisallowedExtensions disallowed_extensions_; |
| 66 |
| 62 // The extensions string returned by glGetString(GL_EXTENSIONS); | 67 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 63 std::string extensions_; | 68 std::string extensions_; |
| 64 | 69 |
| 65 // Flags for some features | 70 // Flags for some features |
| 66 FeatureFlags feature_flags_; | 71 FeatureFlags feature_flags_; |
| 67 | 72 |
| 68 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 73 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 69 }; | 74 }; |
| 70 | 75 |
| 71 } // namespace gles2 | 76 } // namespace gles2 |
| 72 } // namespace gpu | 77 } // namespace gpu |
| 73 | 78 |
| 74 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 79 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 75 | 80 |
| 76 | 81 |
| OLD | NEW |