| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
| 8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
| 9 #include "ui/gfx/gl/gl_implementation.h" | 9 #include "ui/gfx/gl/gl_implementation.h" |
| 10 #include "ui/gfx/gl/gl_surface.h" |
| 10 | 11 |
| 11 namespace gpu { | 12 namespace gpu { |
| 12 namespace gles2 { | 13 namespace gles2 { |
| 13 | 14 |
| 14 FeatureInfo::FeatureInfo() { | 15 FeatureInfo::FeatureInfo() { |
| 15 } | 16 } |
| 16 | 17 |
| 17 FeatureInfo::~FeatureInfo() { | 18 FeatureInfo::~FeatureInfo() { |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 351 } |
| 351 | 352 |
| 352 // TODO(gman): Add support for these extensions. | 353 // TODO(gman): Add support for these extensions. |
| 353 // GL_OES_depth32 | 354 // GL_OES_depth32 |
| 354 // GL_OES_element_index_uint | 355 // GL_OES_element_index_uint |
| 355 | 356 |
| 356 feature_flags_.enable_texture_float_linear = enable_texture_float_linear; | 357 feature_flags_.enable_texture_float_linear = enable_texture_float_linear; |
| 357 feature_flags_.enable_texture_half_float_linear = | 358 feature_flags_.enable_texture_half_float_linear = |
| 358 enable_texture_half_float_linear; | 359 enable_texture_half_float_linear; |
| 359 feature_flags_.npot_ok = npot_ok; | 360 feature_flags_.npot_ok = npot_ok; |
| 361 |
| 362 if (ext.Desire("GL_CHROMIUM_post_sub_buffer") && |
| 363 gfx::GLSurface::GetCurrent() && |
| 364 gfx::GLSurface::GetCurrent()->SupportsPostSubBuffer()) { |
| 365 AddExtensionString("GL_CHROMIUM_post_sub_buffer"); |
| 366 } |
| 360 } | 367 } |
| 361 | 368 |
| 362 void FeatureInfo::AddExtensionString(const std::string& str) { | 369 void FeatureInfo::AddExtensionString(const std::string& str) { |
| 363 if (extensions_.find(str) == std::string::npos) { | 370 if (extensions_.find(str) == std::string::npos) { |
| 364 extensions_ += (extensions_.empty() ? "" : " ") + str; | 371 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 365 } | 372 } |
| 366 } | 373 } |
| 367 | 374 |
| 368 } // namespace gles2 | 375 } // namespace gles2 |
| 369 } // namespace gpu | 376 } // namespace gpu |
| OLD | NEW |