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