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 #include <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include "app/gfx/gl/gl_implementation.h" | 7 #include "app/gfx/gl/gl_implementation.h" |
8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
9 #include "gpu/command_buffer/service/gl_utils.h" | 9 #include "gpu/command_buffer/service/gl_utils.h" |
10 #include "gpu/GLES2/gles2_command_buffer.h" | 10 #include "gpu/GLES2/gles2_command_buffer.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 bool desire_all_features_; | 72 bool desire_all_features_; |
73 | 73 |
74 // Extensions that exist. | 74 // Extensions that exist. |
75 std::set<std::string> have_extensions_; | 75 std::set<std::string> have_extensions_; |
76 | 76 |
77 // Extensions that are desired but may not exist. | 77 // Extensions that are desired but may not exist. |
78 std::set<std::string> desired_extensions_; | 78 std::set<std::string> desired_extensions_; |
79 }; | 79 }; |
80 | 80 |
81 bool FeatureInfo::Initialize(const char* allowed_features) { | 81 bool FeatureInfo::Initialize(const DisallowedExtensions& extensions, |
| 82 const char* allowed_features) { |
| 83 disallowed_extensions_ = extensions; |
82 AddFeatures(allowed_features); | 84 AddFeatures(allowed_features); |
83 return true; | 85 return true; |
84 } | 86 } |
85 | 87 |
86 void FeatureInfo::AddFeatures(const char* desired_features) { | 88 void FeatureInfo::AddFeatures(const char* desired_features) { |
87 // Figure out what extensions to turn on. | 89 // Figure out what extensions to turn on. |
88 ExtensionHelper ext( | 90 ExtensionHelper ext( |
89 reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)), | 91 reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)), |
90 desired_features); | 92 desired_features); |
91 | 93 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 270 |
269 if (enable_texture_half_float) { | 271 if (enable_texture_half_float) { |
270 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); | 272 validators_.pixel_type.AddValue(GL_HALF_FLOAT_OES); |
271 AddExtensionString("GL_OES_texture_half_float"); | 273 AddExtensionString("GL_OES_texture_half_float"); |
272 if (enable_texture_half_float_linear) { | 274 if (enable_texture_half_float_linear) { |
273 AddExtensionString("GL_OES_texture_half_float_linear"); | 275 AddExtensionString("GL_OES_texture_half_float_linear"); |
274 } | 276 } |
275 } | 277 } |
276 | 278 |
277 // Check for multisample support | 279 // Check for multisample support |
278 if (ext.Desire("GL_CHROMIUM_framebuffer_multisample") && | 280 if (!disallowed_extensions_.multisampling && |
| 281 ext.Desire("GL_CHROMIUM_framebuffer_multisample") && |
279 (ext.Have("GL_EXT_framebuffer_multisample") || | 282 (ext.Have("GL_EXT_framebuffer_multisample") || |
280 ext.Have("GL_ANGLE_framebuffer_multisample"))) { | 283 ext.Have("GL_ANGLE_framebuffer_multisample"))) { |
281 feature_flags_.chromium_framebuffer_multisample = true; | 284 feature_flags_.chromium_framebuffer_multisample = true; |
282 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); | 285 validators_.frame_buffer_target.AddValue(GL_READ_FRAMEBUFFER_EXT); |
283 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); | 286 validators_.frame_buffer_target.AddValue(GL_DRAW_FRAMEBUFFER_EXT); |
284 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); | 287 validators_.g_l_state.AddValue(GL_READ_FRAMEBUFFER_BINDING_EXT); |
285 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); | 288 validators_.g_l_state.AddValue(GL_MAX_SAMPLES_EXT); |
286 validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); | 289 validators_.render_buffer_parameter.AddValue(GL_RENDERBUFFER_SAMPLES_EXT); |
287 AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); | 290 AddExtensionString("GL_CHROMIUM_framebuffer_multisample"); |
288 } | 291 } |
(...skipping 28 matching lines...) Expand all Loading... |
317 if (extensions_.find(str) == std::string::npos) { | 320 if (extensions_.find(str) == std::string::npos) { |
318 extensions_ += (extensions_.empty() ? "" : " ") + str; | 321 extensions_ += (extensions_.empty() ? "" : " ") + str; |
319 } | 322 } |
320 } | 323 } |
321 | 324 |
322 } // namespace gles2 | 325 } // namespace gles2 |
323 } // namespace gpu | 326 } // namespace gpu |
324 | 327 |
325 | 328 |
326 | 329 |
OLD | NEW |