Chromium Code Reviews| 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 <vector> | |
| 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 28 matching lines...) Expand all Loading... | |
| 47 } | 48 } |
| 48 | 49 |
| 49 const std::string& extensions() const { | 50 const std::string& extensions() const { |
| 50 return extensions_; | 51 return extensions_; |
| 51 } | 52 } |
| 52 | 53 |
| 53 const FeatureFlags& feature_flags() const { | 54 const FeatureFlags& feature_flags() const { |
| 54 return feature_flags_; | 55 return feature_flags_; |
| 55 } | 56 } |
| 56 | 57 |
| 58 // Returns a string containing the extensions that can be | |
| 59 // successfully requested on the current hardware. | |
| 60 const std::string& RequestableExtensions(); | |
| 61 | |
| 57 private: | 62 private: |
| 63 // Checks the given extension or extensions for availability. If it | |
| 64 // is available, then if it is desired, should_enable is set to | |
| 65 // true. (No other changes are made in this case.) Otherwise, | |
| 66 // "extension" (and not alternate_extension) is added to the set of | |
| 67 // requestable extensions. | |
| 68 void DoSimpleTestForEnablingExtension( | |
|
greggman
2010/12/04 01:28:44
Why do these take void extension_helper? Why not E
| |
| 69 void* extensions_helper, const char* extension, bool* should_enable); | |
| 70 void DoSimpleTestForEnablingExtension( | |
| 71 void* extensions_helper, const char* extension, | |
| 72 const char* alternate_extension, bool* should_enable); | |
| 73 | |
| 58 void AddExtensionString(const std::string& str); | 74 void AddExtensionString(const std::string& str); |
| 75 void AddRequestableExtensionString(const std::string& str); | |
| 76 void RemoveRequestableExtensionString(const std::string& str); | |
| 59 | 77 |
| 60 Validators validators_; | 78 Validators validators_; |
| 61 | 79 |
| 62 // The extensions string returned by glGetString(GL_EXTENSIONS); | 80 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 63 std::string extensions_; | 81 std::string extensions_; |
| 64 | 82 |
| 83 // The list of extensions returned by glGetRequestableExtensionsCHROMIUM(). | |
| 84 std::vector<std::string> requestable_extensions_list_; | |
|
greggman
2010/12/04 01:28:44
why a list and not a set? This would simplify the
| |
| 85 bool requestable_extensions_dirty_; | |
| 86 std::string requestable_extensions_; | |
| 87 | |
| 65 // Flags for some features | 88 // Flags for some features |
| 66 FeatureFlags feature_flags_; | 89 FeatureFlags feature_flags_; |
| 67 | 90 |
| 68 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 91 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 69 }; | 92 }; |
| 70 | 93 |
| 71 } // namespace gles2 | 94 } // namespace gles2 |
| 72 } // namespace gpu | 95 } // namespace gpu |
| 73 | 96 |
| 74 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 97 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 75 | 98 |
| 76 | 99 |
| OLD | NEW |