Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 238933003: Re-land: gpu: Add CHROMIUM_sync_query extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/macros.h" 10 #include "base/macros.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") 770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects")
771 // when available. 771 // when available.
772 } 772 }
773 773
774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && 774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) &&
775 !workarounds_.disable_ext_discard_framebuffer) { 775 !workarounds_.disable_ext_discard_framebuffer) {
776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. 776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer.
777 AddExtensionString("GL_EXT_discard_framebuffer"); 777 AddExtensionString("GL_EXT_discard_framebuffer");
778 feature_flags_.ext_discard_framebuffer = true; 778 feature_flags_.ext_discard_framebuffer = true;
779 } 779 }
780
781 if (ui_gl_fence_works)
782 AddExtensionString("GL_CHROMIUM_sync_query");
780 } 783 }
781 784
782 void FeatureInfo::AddExtensionString(const std::string& str) { 785 void FeatureInfo::AddExtensionString(const std::string& str) {
783 size_t pos = extensions_.find(str); 786 size_t pos = extensions_.find(str);
784 while (pos != std::string::npos && 787 while (pos != std::string::npos &&
785 pos + str.length() < extensions_.length() && 788 pos + str.length() < extensions_.length() &&
786 extensions_.substr(pos + str.length(), 1) != " ") { 789 extensions_.substr(pos + str.length(), 1) != " ") {
787 // This extension name is a substring of another. 790 // This extension name is a substring of another.
788 pos = extensions_.find(str, pos + str.length()); 791 pos = extensions_.find(str, pos + str.length());
789 } 792 }
790 if (pos == std::string::npos) { 793 if (pos == std::string::npos) {
791 extensions_ += (extensions_.empty() ? "" : " ") + str; 794 extensions_ += (extensions_.empty() ? "" : " ") + str;
792 } 795 }
793 } 796 }
794 797
795 FeatureInfo::~FeatureInfo() { 798 FeatureInfo::~FeatureInfo() {
796 } 799 }
797 800
798 } // namespace gles2 801 } // namespace gles2
799 } // namespace gpu 802 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698