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 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 !workarounds_.disable_async_readpixels) { | 678 !workarounds_.disable_async_readpixels) { |
679 feature_flags_.use_async_readpixels = true; | 679 feature_flags_.use_async_readpixels = true; |
680 } | 680 } |
681 | 681 |
682 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { | 682 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { |
683 feature_flags_.enable_samplers = true; | 683 feature_flags_.enable_samplers = true; |
684 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 684 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
685 // when available. | 685 // when available. |
686 } | 686 } |
687 | 687 |
688 if (is_es3) { | 688 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && |
| 689 !workarounds_.disable_ext_discard_framebuffer) { |
689 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 690 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
690 AddExtensionString("GL_EXT_discard_framebuffer"); | 691 AddExtensionString("GL_EXT_discard_framebuffer"); |
691 } | 692 } |
692 } | 693 } |
693 | 694 |
694 void FeatureInfo::AddExtensionString(const std::string& str) { | 695 void FeatureInfo::AddExtensionString(const std::string& str) { |
695 if (extensions_.find(str) == std::string::npos) { | 696 if (extensions_.find(str) == std::string::npos) { |
696 extensions_ += (extensions_.empty() ? "" : " ") + str; | 697 extensions_ += (extensions_.empty() ? "" : " ") + str; |
697 } | 698 } |
698 } | 699 } |
699 | 700 |
700 FeatureInfo::~FeatureInfo() { | 701 FeatureInfo::~FeatureInfo() { |
701 } | 702 } |
702 | 703 |
703 } // namespace gles2 | 704 } // namespace gles2 |
704 } // namespace gpu | 705 } // namespace gpu |
OLD | NEW |