| 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)
|
|
|