Chromium Code Reviews| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 13 #include "gpu/command_buffer/service/gles2_cmd_validation.h" | 13 #include "gpu/command_buffer/service/gles2_cmd_validation.h" |
| 14 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 14 #include "gpu/config/gpu_driver_bug_workarounds.h" |
| 15 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class CommandLine; | 18 class CommandLine; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 struct GLVersionInfo; | 22 struct GLVersionInfo; |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 bool chromium_image_ycbcr_420v; | 83 bool chromium_image_ycbcr_420v; |
| 84 bool chromium_image_ycbcr_422; | 84 bool chromium_image_ycbcr_422; |
| 85 bool enable_subscribe_uniform; | 85 bool enable_subscribe_uniform; |
| 86 bool emulate_primitive_restart_fixed_index; | 86 bool emulate_primitive_restart_fixed_index; |
| 87 bool ext_render_buffer_format_bgra8888; | 87 bool ext_render_buffer_format_bgra8888; |
| 88 bool ext_multisample_compatibility; | 88 bool ext_multisample_compatibility; |
| 89 bool ext_blend_func_extended; | 89 bool ext_blend_func_extended; |
| 90 bool ext_read_format_bgra; | 90 bool ext_read_format_bgra; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 struct Workarounds { | |
| 94 Workarounds(); | |
| 95 | |
| 96 #define GPU_OP(type, name) bool name; | |
| 97 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | |
| 98 #undef GPU_OP | |
| 99 | |
| 100 // Note: 0 here means use driver limit. | |
| 101 GLint max_texture_size; | |
| 102 GLint max_cube_map_texture_size; | |
| 103 GLint max_fragment_uniform_vectors; | |
| 104 GLint max_varying_vectors; | |
| 105 GLint max_vertex_uniform_vectors; | |
| 106 GLint max_copy_texture_chromium_size; | |
| 107 }; | |
| 108 | |
| 109 // Constructor with workarounds taken from the current process's CommandLine | 93 // Constructor with workarounds taken from the current process's CommandLine |
| 110 FeatureInfo(); | 94 FeatureInfo(const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); |
|
piman
2016/04/12 04:38:44
nit: explicit
Julien Isorce Samsung
2016/04/12 16:11:32
Done.
| |
| 111 | 95 |
| 112 // Constructor with workarounds taken from |command_line| | 96 // Constructor with workarounds taken from |command_line| |
| 113 FeatureInfo(const base::CommandLine& command_line); | 97 FeatureInfo(const base::CommandLine& command_line, |
| 98 const GpuDriverBugWorkarounds& gpu_driver_bug_workarounds); | |
| 114 | 99 |
| 115 // Initializes the feature information. Needs a current GL context. | 100 // Initializes the feature information. Needs a current GL context. |
| 116 bool Initialize(ContextType context_type, | 101 bool Initialize(ContextType context_type, |
| 117 const DisallowedFeatures& disallowed_features); | 102 const DisallowedFeatures& disallowed_features); |
| 118 | 103 |
| 119 // Helper that defaults to no disallowed features and a GLES2 context. | 104 // Helper that defaults to no disallowed features and a GLES2 context. |
| 120 bool InitializeForTesting(); | 105 bool InitializeForTesting(); |
| 121 // Helper that defaults to a GLES2 context. | 106 // Helper that defaults to a GLES2 context. |
| 122 bool InitializeForTesting(const DisallowedFeatures& disallowed_features); | 107 bool InitializeForTesting(const DisallowedFeatures& disallowed_features); |
| 123 | 108 |
| 124 const Validators* validators() const { | 109 const Validators* validators() const { |
| 125 return &validators_; | 110 return &validators_; |
| 126 } | 111 } |
| 127 | 112 |
| 128 ContextType context_type() const { return context_type_; } | 113 ContextType context_type() const { return context_type_; } |
| 129 | 114 |
| 130 const std::string& extensions() const { | 115 const std::string& extensions() const { |
| 131 return extensions_; | 116 return extensions_; |
| 132 } | 117 } |
| 133 | 118 |
| 134 const FeatureFlags& feature_flags() const { | 119 const FeatureFlags& feature_flags() const { |
| 135 return feature_flags_; | 120 return feature_flags_; |
| 136 } | 121 } |
| 137 | 122 |
| 138 const Workarounds& workarounds() const { | 123 const GpuDriverBugWorkarounds& workarounds() const { return workarounds_; } |
| 139 return workarounds_; | |
| 140 } | |
| 141 | 124 |
| 142 const DisallowedFeatures& disallowed_features() const { | 125 const DisallowedFeatures& disallowed_features() const { |
| 143 return disallowed_features_; | 126 return disallowed_features_; |
| 144 } | 127 } |
| 145 | 128 |
| 146 const gfx::GLVersionInfo& gl_version_info() const { | 129 const gfx::GLVersionInfo& gl_version_info() const { |
| 147 DCHECK(gl_version_info_.get()); | 130 DCHECK(gl_version_info_.get()); |
| 148 return *(gl_version_info_.get()); | 131 return *(gl_version_info_.get()); |
| 149 } | 132 } |
| 150 | 133 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 181 | 164 |
| 182 ContextType context_type_; | 165 ContextType context_type_; |
| 183 | 166 |
| 184 // The extensions string returned by glGetString(GL_EXTENSIONS); | 167 // The extensions string returned by glGetString(GL_EXTENSIONS); |
| 185 std::string extensions_; | 168 std::string extensions_; |
| 186 | 169 |
| 187 // Flags for some features | 170 // Flags for some features |
| 188 FeatureFlags feature_flags_; | 171 FeatureFlags feature_flags_; |
| 189 | 172 |
| 190 // Flags for Workarounds. | 173 // Flags for Workarounds. |
| 191 Workarounds workarounds_; | 174 const GpuDriverBugWorkarounds& workarounds_; |
| 192 | 175 |
| 193 // Whether the command line switch kEnableUnsafeES3APIs is passed in. | 176 // Whether the command line switch kEnableUnsafeES3APIs is passed in. |
| 194 bool enable_unsafe_es3_apis_switch_; | 177 bool enable_unsafe_es3_apis_switch_; |
| 195 | 178 |
| 196 bool unsafe_es3_apis_enabled_; | 179 bool unsafe_es3_apis_enabled_; |
| 197 | 180 |
| 198 bool chromium_color_buffer_float_rgba_available_; | 181 bool chromium_color_buffer_float_rgba_available_; |
| 199 bool chromium_color_buffer_float_rgb_available_; | 182 bool chromium_color_buffer_float_rgb_available_; |
| 200 bool ext_color_buffer_float_available_; | 183 bool ext_color_buffer_float_available_; |
| 201 bool oes_texture_float_linear_available_; | 184 bool oes_texture_float_linear_available_; |
| 202 bool oes_texture_half_float_linear_available_; | 185 bool oes_texture_half_float_linear_available_; |
| 203 | 186 |
| 204 bool disable_shader_translator_; | 187 bool disable_shader_translator_; |
| 205 scoped_ptr<gfx::GLVersionInfo> gl_version_info_; | 188 scoped_ptr<gfx::GLVersionInfo> gl_version_info_; |
| 206 | 189 |
| 207 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); | 190 DISALLOW_COPY_AND_ASSIGN(FeatureInfo); |
| 208 }; | 191 }; |
| 209 | 192 |
| 210 } // namespace gles2 | 193 } // namespace gles2 |
| 211 } // namespace gpu | 194 } // namespace gpu |
| 212 | 195 |
| 213 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ | 196 #endif // GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ |
| OLD | NEW |