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 10 matching lines...) Expand all Loading... |
29 bool npot_ok; | 30 bool npot_ok; |
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 DisallowedExtensions& disallowed, |
| 41 const char* allowed_features); |
40 | 42 |
41 // Turns on certain features if they can be turned on. NULL turns on | 43 // Turns on certain features if they can be turned on. NULL turns on |
42 // all available features. | 44 // all available features. |
43 void AddFeatures(const char* desired_features); | 45 void AddFeatures(const char* desired_features); |
44 | 46 |
45 const Validators* validators() const { | 47 const Validators* validators() const { |
46 return &validators_; | 48 return &validators_; |
47 } | 49 } |
48 | 50 |
49 const std::string& extensions() const { | 51 const std::string& extensions() const { |
50 return extensions_; | 52 return extensions_; |
51 } | 53 } |
52 | 54 |
53 const FeatureFlags& feature_flags() const { | 55 const FeatureFlags& feature_flags() const { |
54 return feature_flags_; | 56 return feature_flags_; |
55 } | 57 } |
56 | 58 |
57 private: | 59 private: |
58 void AddExtensionString(const std::string& str); | 60 void AddExtensionString(const std::string& str); |
59 | 61 |
60 Validators validators_; | 62 Validators validators_; |
61 | 63 |
| 64 DisallowedExtensions disallowed_extensions_; |
| 65 |
62 // The extensions string returned by glGetString(GL_EXTENSIONS); | 66 // The extensions string returned by glGetString(GL_EXTENSIONS); |
63 std::string extensions_; | 67 std::string extensions_; |
64 | 68 |
65 // Flags for some features | 69 // Flags for some features |
66 FeatureFlags feature_flags_; | 70 FeatureFlags feature_flags_; |
67 | 71 |
68 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 72 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
69 }; | 73 }; |
70 | 74 |
71 } // namespace gles2 | 75 } // namespace gles2 |
72 } // namespace gpu | 76 } // namespace gpu |
73 | 77 |
74 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 78 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
75 | 79 |
76 | 80 |
OLD | NEW |