| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bool chromium_stream_texture; | 47 bool chromium_stream_texture; |
| 48 bool angle_translated_shader_source; | 48 bool angle_translated_shader_source; |
| 49 bool angle_pack_reverse_row_order; | 49 bool angle_pack_reverse_row_order; |
| 50 bool arb_texture_rectangle; | 50 bool arb_texture_rectangle; |
| 51 bool angle_instanced_arrays; | 51 bool angle_instanced_arrays; |
| 52 bool occlusion_query_boolean; | 52 bool occlusion_query_boolean; |
| 53 bool use_arb_occlusion_query2_for_occlusion_query_boolean; | 53 bool use_arb_occlusion_query2_for_occlusion_query_boolean; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 FeatureInfo(); | 56 FeatureInfo(); |
| 57 ~FeatureInfo(); | |
| 58 | 57 |
| 59 // If allowed features = NULL or "*", all features are allowed. Otherwise | 58 // If allowed features = NULL or "*", all features are allowed. Otherwise |
| 60 // only features that match the strings in allowed_features are allowed. | 59 // only features that match the strings in allowed_features are allowed. |
| 61 bool Initialize(const char* allowed_features); | 60 bool Initialize(const char* allowed_features); |
| 62 bool Initialize(const DisallowedFeatures& disallowed_features, | 61 bool Initialize(const DisallowedFeatures& disallowed_features, |
| 63 const char* allowed_features); | 62 const char* allowed_features); |
| 64 | 63 |
| 65 // Turns on certain features if they can be turned on. NULL turns on | 64 // Turns on certain features if they can be turned on. NULL turns on |
| 66 // all available features. | 65 // all available features. |
| 67 void AddFeatures(const char* desired_features); | 66 void AddFeatures(const char* desired_features); |
| 68 | 67 |
| 69 const Validators* validators() const { | 68 const Validators* validators() const { |
| 70 return &validators_; | 69 return &validators_; |
| 71 } | 70 } |
| 72 | 71 |
| 73 const std::string& extensions() const { | 72 const std::string& extensions() const { |
| 74 return extensions_; | 73 return extensions_; |
| 75 } | 74 } |
| 76 | 75 |
| 77 const FeatureFlags& feature_flags() const { | 76 const FeatureFlags& feature_flags() const { |
| 78 return feature_flags_; | 77 return feature_flags_; |
| 79 } | 78 } |
| 80 | 79 |
| 81 private: | 80 private: |
| 81 friend class base::RefCounted<FeatureInfo>; |
| 82 ~FeatureInfo(); |
| 83 |
| 82 void AddExtensionString(const std::string& str); | 84 void AddExtensionString(const std::string& str); |
| 83 | 85 |
| 84 Validators validators_; | 86 Validators validators_; |
| 85 | 87 |
| 86 DisallowedFeatures disallowed_features_; | 88 DisallowedFeatures disallowed_features_; |
| 87 | 89 |
| 88 // The extensions string returned by glGetString(GL_EXTENSIONS); | 90 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 89 std::string extensions_; | 91 std::string extensions_; |
| 90 | 92 |
| 91 // Flags for some features | 93 // Flags for some features |
| 92 FeatureFlags feature_flags_; | 94 FeatureFlags feature_flags_; |
| 93 | 95 |
| 94 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 96 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 } // namespace gles2 | 99 } // namespace gles2 |
| 98 } // namespace gpu | 100 } // namespace gpu |
| 99 | 101 |
| 100 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 102 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| 101 | 103 |
| 102 | 104 |
| OLD | NEW |