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

Unified Diff: ui/gl/generate_bindings.py

Issue 1203513004: Respect the disabled extension list during binding initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split extension binding loading from static binding loading; pass enabled extensions Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gl/gl_bindings.h » ('j') | ui/gl/gl_egl_api_implementation.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/generate_bindings.py
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index d40be26a9178519fd7a366dd7a2c38f20dd61210..b7f80741666d83cc8581869fb82ffcba0bd56290 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -1905,51 +1905,31 @@ namespace gfx {
return True
return False
- if set_name == 'egl':
- file.write("""std::string client_extensions(GetClientExtensions());
- client_extensions += " ";
- ALLOW_UNUSED_LOCAL(client_extensions);
-
-""")
- for extension in sorted(used_client_extensions):
- # Extra space at the end of the extension name is intentional,
- # it is used as a separator
- file.write(
- ' ext.b_%s = client_extensions.find("%s ") != std::string::npos;\n' %
- (extension, extension))
- for func in functions:
- if not 'static_binding' in func and IsClientExtensionFunc(func):
- file.write('\n')
- file.write(' debug_fn.%sFn = 0;\n' % func['known_as'])
- WriteConditionalFuncBinding(file, func)
+ file.write("}\n\n");
if set_name == 'gl':
- # Write the deferred bindings for GL that need a current context and depend
- # on GL_VERSION and GL_EXTENSIONS.
- file.write('}\n\n')
- file.write("""void DriverGL::InitializeDynamicBindings(GLContext* context) {
+ file.write("""\
+void DriverGL::InitializeExtensionBindings(
+ GLContext* context,
+ const std::set<std::string> &enabled_extensions) {
DCHECK(context && context->IsCurrent(NULL));
const GLVersionInfo* ver = context->GetVersionInfo();
ALLOW_UNUSED_LOCAL(ver);
- std::string extensions = context->GetExtensions() + " ";
- ALLOW_UNUSED_LOCAL(extensions);
-
""")
else:
- file.write("""std::string extensions(GetPlatformExtensions());
- extensions += " ";
- ALLOW_UNUSED_LOCAL(extensions);
-
-""")
-
- for extension in sorted(used_extensions):
- # Extra space at the end of the extension name is intentional, it is used
- # as a separator
- file.write(' ext.b_%s = extensions.find("%s ") != std::string::npos;\n' %
- (extension, extension))
-
- for func in functions:
- if not 'static_binding' in func and not IsClientExtensionFunc(func):
+ file.write("""\
+void Driver%s::InitializeExtensionBindings(
+ const std::set<std::string> &enabled_extensions) {
+""" % (set_name.upper(),))
+
+ for extension in sorted(used_client_extensions) + sorted(used_extensions):
+ # Extra space at the end of the extension name is intentional,
+ # it is used as a separator
+ file.write('ext.b_{0} = enabled_extensions.find("{0}") != enabled_extensions.end();'.format(
+ extension))
+
+ for func in sorted(functions, key = lambda func: not IsClientExtensionFunc(func)):
+ if not 'static_binding' in func:
file.write('\n')
file.write(' debug_fn.%sFn = 0;\n' % func['known_as'])
WriteConditionalFuncBinding(file, func)
« no previous file with comments | « no previous file | ui/gl/gl_bindings.h » ('j') | ui/gl/gl_egl_api_implementation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698