| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 13 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 14 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 14 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
| 15 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 15 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
| 16 #include "gpu/gpu_export.h" | 16 #include "gpu/gpu_export.h" |
| 17 | 17 |
| 18 namespace base { |
| 18 class CommandLine; | 19 class CommandLine; |
| 20 } |
| 19 | 21 |
| 20 namespace gpu { | 22 namespace gpu { |
| 21 namespace gles2 { | 23 namespace gles2 { |
| 22 | 24 |
| 23 // FeatureInfo records the features that are available for a ContextGroup. | 25 // FeatureInfo records the features that are available for a ContextGroup. |
| 24 class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { | 26 class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { |
| 25 public: | 27 public: |
| 26 struct FeatureFlags { | 28 struct FeatureFlags { |
| 27 FeatureFlags(); | 29 FeatureFlags(); |
| 28 | 30 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 78 |
| 77 // Note: 0 here means use driver limit. | 79 // Note: 0 here means use driver limit. |
| 78 GLint max_texture_size; | 80 GLint max_texture_size; |
| 79 GLint max_cube_map_texture_size; | 81 GLint max_cube_map_texture_size; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 // Constructor with workarounds taken from the current process's CommandLine | 84 // Constructor with workarounds taken from the current process's CommandLine |
| 83 FeatureInfo(); | 85 FeatureInfo(); |
| 84 | 86 |
| 85 // Constructor with workarounds taken from |command_line| | 87 // Constructor with workarounds taken from |command_line| |
| 86 FeatureInfo(const CommandLine& command_line); | 88 FeatureInfo(const base::CommandLine& command_line); |
| 87 | 89 |
| 88 // Initializes the feature information. Needs a current GL context. | 90 // Initializes the feature information. Needs a current GL context. |
| 89 bool Initialize(); | 91 bool Initialize(); |
| 90 bool Initialize(const DisallowedFeatures& disallowed_features); | 92 bool Initialize(const DisallowedFeatures& disallowed_features); |
| 91 | 93 |
| 92 const Validators* validators() const { | 94 const Validators* validators() const { |
| 93 return &validators_; | 95 return &validators_; |
| 94 } | 96 } |
| 95 | 97 |
| 96 const ValueValidator<GLenum>& GetTextureFormatValidator(GLenum format) { | 98 const ValueValidator<GLenum>& GetTextureFormatValidator(GLenum format) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 112 private: | 114 private: |
| 113 friend class base::RefCounted<FeatureInfo>; | 115 friend class base::RefCounted<FeatureInfo>; |
| 114 friend class BufferManagerClientSideArraysTest; | 116 friend class BufferManagerClientSideArraysTest; |
| 115 | 117 |
| 116 typedef base::hash_map<GLenum, ValueValidator<GLenum> > ValidatorMap; | 118 typedef base::hash_map<GLenum, ValueValidator<GLenum> > ValidatorMap; |
| 117 ValidatorMap texture_format_validators_; | 119 ValidatorMap texture_format_validators_; |
| 118 | 120 |
| 119 ~FeatureInfo(); | 121 ~FeatureInfo(); |
| 120 | 122 |
| 121 void AddExtensionString(const std::string& str); | 123 void AddExtensionString(const std::string& str); |
| 122 void InitializeBasicState(const CommandLine& command_line); | 124 void InitializeBasicState(const base::CommandLine& command_line); |
| 123 void InitializeFeatures(); | 125 void InitializeFeatures(); |
| 124 | 126 |
| 125 Validators validators_; | 127 Validators validators_; |
| 126 | 128 |
| 127 DisallowedFeatures disallowed_features_; | 129 DisallowedFeatures disallowed_features_; |
| 128 | 130 |
| 129 // The extensions string returned by glGetString(GL_EXTENSIONS); | 131 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 130 std::string extensions_; | 132 std::string extensions_; |
| 131 | 133 |
| 132 // Flags for some features | 134 // Flags for some features |
| 133 FeatureFlags feature_flags_; | 135 FeatureFlags feature_flags_; |
| 134 | 136 |
| 135 // Flags for Workarounds. | 137 // Flags for Workarounds. |
| 136 Workarounds workarounds_; | 138 Workarounds workarounds_; |
| 137 | 139 |
| 138 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 140 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 } // namespace gles2 | 143 } // namespace gles2 |
| 142 } // namespace gpu | 144 } // namespace gpu |
| 143 | 145 |
| 144 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 146 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| OLD | NEW |