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

Side by Side Diff: ui/gl/generate_bindings.py

Issue 2136553002: Remove GetPlatformDefaultEGLNativeDisplay() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to original. Created 4 years, 5 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
« no previous file with comments | « ui/gl/egl_api_unittest.cc ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """code generator for GL/GLES extension wrangler.""" 6 """code generator for GL/GLES extension wrangler."""
7 7
8 import optparse 8 import optparse
9 import os 9 import os
10 import collections 10 import collections
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 ] }], 1489 ] }],
1490 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, ' 1490 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, '
1491 'EGLint* value' }, 1491 'EGLint* value' },
1492 { 'return_type': 'EGLBoolean', 1492 { 'return_type': 'EGLBoolean',
1493 'names': ['eglGetSyncValuesCHROMIUM'], 1493 'names': ['eglGetSyncValuesCHROMIUM'],
1494 'arguments': 1494 'arguments':
1495 'EGLDisplay dpy, EGLSurface surface, ' 1495 'EGLDisplay dpy, EGLSurface surface, '
1496 'EGLuint64CHROMIUM* ust, EGLuint64CHROMIUM* msc, ' 1496 'EGLuint64CHROMIUM* ust, EGLuint64CHROMIUM* msc, '
1497 'EGLuint64CHROMIUM* sbc', }, 1497 'EGLuint64CHROMIUM* sbc', },
1498 { 'return_type': 'EGLBoolean', 1498 { 'return_type': 'EGLBoolean',
1499 'names': ['eglImageFlushExternalEXT'], 1499 'versions': [{ 'name': 'eglImageFlushExternalEXT',
1500 'extensions': ['EGL_EXT_image_flush_external'] }],
1500 'arguments': 1501 'arguments':
1501 'EGLDisplay dpy, EGLImageKHR image, const EGLAttrib* attrib_list' }, 1502 'EGLDisplay dpy, EGLImageKHR image, const EGLAttrib* attrib_list' },
1502 { 'return_type': 'EGLBoolean', 1503 { 'return_type': 'EGLBoolean',
1503 'names': ['eglInitialize'], 1504 'names': ['eglInitialize'],
1504 'arguments': 'EGLDisplay dpy, EGLint* major, EGLint* minor', }, 1505 'arguments': 'EGLDisplay dpy, EGLint* major, EGLint* minor', },
1505 { 'return_type': 'EGLBoolean', 1506 { 'return_type': 'EGLBoolean',
1506 'names': ['eglMakeCurrent'], 1507 'names': ['eglMakeCurrent'],
1507 'arguments': 1508 'arguments':
1508 'EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx', }, 1509 'EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx', },
1509 { 'return_type': 'EGLBoolean', 1510 { 'return_type': 'EGLBoolean',
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 GLContext* context) { 2213 GLContext* context) {
2213 DCHECK(context && context->IsCurrent(NULL)); 2214 DCHECK(context && context->IsCurrent(NULL));
2214 const GLVersionInfo* ver = context->GetVersionInfo(); 2215 const GLVersionInfo* ver = context->GetVersionInfo();
2215 ALLOW_UNUSED_LOCAL(ver); 2216 ALLOW_UNUSED_LOCAL(ver);
2216 std::string extensions = context->GetExtensions() + " "; 2217 std::string extensions = context->GetExtensions() + " ";
2217 ALLOW_UNUSED_LOCAL(extensions); 2218 ALLOW_UNUSED_LOCAL(extensions);
2218 2219
2219 """) 2220 """)
2220 elif set_name == 'egl': 2221 elif set_name == 'egl':
2221 file.write("""\ 2222 file.write("""\
2222 void DriverEGL::InitializeExtensionBindings() { 2223 void DriverEGL::InitializeClientExtensionBindings() {
2223 std::string client_extensions(GetClientExtensions()); 2224 std::string client_extensions(GetClientExtensions());
2224 client_extensions += " "; 2225 client_extensions += " ";
2225 ALLOW_UNUSED_LOCAL(client_extensions); 2226 ALLOW_UNUSED_LOCAL(client_extensions);
2226 2227
2227 """) 2228 """)
2228 else: 2229 else:
2229 file.write("""\ 2230 file.write("""\
2230 void Driver%s::InitializeExtensionBindings() { 2231 void Driver%s::InitializeExtensionBindings() {
2231 std::string extensions(GetPlatformExtensions()); 2232 std::string extensions(GetPlatformExtensions());
2232 extensions += " "; 2233 extensions += " ";
(...skipping 14 matching lines...) Expand all
2247 file.write(' debug_fn.%sFn = 0;\n' % func['known_as']) 2248 file.write(' debug_fn.%sFn = 0;\n' % func['known_as'])
2248 WriteConditionalFuncBinding(file, func) 2249 WriteConditionalFuncBinding(file, func)
2249 2250
2250 OutputExtensionBindings( 2251 OutputExtensionBindings(
2251 'client_extensions', 2252 'client_extensions',
2252 sorted(used_client_extensions), 2253 sorted(used_client_extensions),
2253 [ f for f in functions if IsClientExtensionFunc(f) ]) 2254 [ f for f in functions if IsClientExtensionFunc(f) ])
2254 2255
2255 if set_name == 'egl': 2256 if set_name == 'egl':
2256 file.write("""\ 2257 file.write("""\
2258 }
2259
2260 void DriverEGL::InitializeExtensionBindings() {
2257 std::string extensions(GetPlatformExtensions()); 2261 std::string extensions(GetPlatformExtensions());
2258 extensions += " "; 2262 extensions += " ";
2259 ALLOW_UNUSED_LOCAL(extensions); 2263 ALLOW_UNUSED_LOCAL(extensions);
2260 2264
2261 """) 2265 """)
2262 2266
2263 OutputExtensionBindings( 2267 OutputExtensionBindings(
2264 'extensions', 2268 'extensions',
2265 sorted(used_extensions), 2269 sorted(used_extensions),
2266 [ f for f in functions if not IsClientExtensionFunc(f) ]) 2270 [ f for f in functions if not IsClientExtensionFunc(f) ])
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
2937 header_file = open( 2941 header_file = open(
2938 os.path.join(directory, 'gl_stub_autogen_gl.cc'), 'wb') 2942 os.path.join(directory, 'gl_stub_autogen_gl.cc'), 'wb')
2939 GenerateStubSource(header_file, GL_FUNCTIONS) 2943 GenerateStubSource(header_file, GL_FUNCTIONS)
2940 header_file.close() 2944 header_file.close()
2941 ClangFormat(header_file.name) 2945 ClangFormat(header_file.name)
2942 return 0 2946 return 0
2943 2947
2944 2948
2945 if __name__ == '__main__': 2949 if __name__ == '__main__':
2946 sys.exit(main(sys.argv[1:])) 2950 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « ui/gl/egl_api_unittest.cc ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698