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

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

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 enable_samplers(false), 127 enable_samplers(false),
128 ext_draw_buffers(false), 128 ext_draw_buffers(false),
129 ext_frag_depth(false), 129 ext_frag_depth(false),
130 use_async_readpixels(false), 130 use_async_readpixels(false),
131 map_buffer_range(false), 131 map_buffer_range(false),
132 ext_discard_framebuffer(false), 132 ext_discard_framebuffer(false),
133 angle_depth_texture(false), 133 angle_depth_texture(false),
134 is_angle(false), 134 is_angle(false),
135 is_swiftshader(false), 135 is_swiftshader(false),
136 angle_texture_usage(false), 136 angle_texture_usage(false),
137 ext_texture_storage(false) { 137 ext_texture_storage(false),
138 nv_path_rendering(false) {
138 } 139 }
139 140
140 FeatureInfo::Workarounds::Workarounds() : 141 FeatureInfo::Workarounds::Workarounds() :
141 #define GPU_OP(type, name) name(false), 142 #define GPU_OP(type, name) name(false),
142 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 143 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
143 #undef GPU_OP 144 #undef GPU_OP
144 max_texture_size(0), 145 max_texture_size(0),
145 max_cube_map_texture_size(0) { 146 max_cube_map_texture_size(0) {
146 } 147 }
147 148
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") 770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects")
770 // when available. 771 // when available.
771 } 772 }
772 773
773 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && 774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) &&
774 !workarounds_.disable_ext_discard_framebuffer) { 775 !workarounds_.disable_ext_discard_framebuffer) {
775 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. 776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer.
776 AddExtensionString("GL_EXT_discard_framebuffer"); 777 AddExtensionString("GL_EXT_discard_framebuffer");
777 feature_flags_.ext_discard_framebuffer = true; 778 feature_flags_.ext_discard_framebuffer = true;
778 } 779 }
780
781 if (extensions.Contains("GL_NV_path_rendering")) {
782 AddExtensionString("GL_CHROMIUM_NV_path_rendering");
piman 2014/04/11 22:19:27 nit: GL_CHROMIUM_path_rendering
Kimmo Kinnunen 2014/04/15 16:16:58 Done.
783 feature_flags_.nv_path_rendering = true;
784 validators_.g_l_state.AddValue(GL_MATRIX_MODE);
785 }
779 } 786 }
780 787
781 void FeatureInfo::AddExtensionString(const std::string& str) { 788 void FeatureInfo::AddExtensionString(const std::string& str) {
782 size_t pos = extensions_.find(str); 789 size_t pos = extensions_.find(str);
783 while (pos != std::string::npos && 790 while (pos != std::string::npos &&
784 pos + str.length() < extensions_.length() && 791 pos + str.length() < extensions_.length() &&
785 extensions_.substr(pos + str.length(), 1) != " ") { 792 extensions_.substr(pos + str.length(), 1) != " ") {
786 // This extension name is a substring of another. 793 // This extension name is a substring of another.
787 pos = extensions_.find(str, pos + str.length()); 794 pos = extensions_.find(str, pos + str.length());
788 } 795 }
789 if (pos == std::string::npos) { 796 if (pos == std::string::npos) {
790 extensions_ += (extensions_.empty() ? "" : " ") + str; 797 extensions_ += (extensions_.empty() ? "" : " ") + str;
791 } 798 }
792 } 799 }
793 800
794 FeatureInfo::~FeatureInfo() { 801 FeatureInfo::~FeatureInfo() {
795 } 802 }
796 803
797 } // namespace gles2 804 } // namespace gles2
798 } // namespace gpu 805 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698