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

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

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/events/latency_info.cc ('k') | ui/gl/gl_bindings_autogen_egl.cc » ('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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 'names': ['glReadBuffer'], 810 'names': ['glReadBuffer'],
811 'arguments': 'GLenum src', }, 811 'arguments': 'GLenum src', },
812 { 'return_type': 'void', 812 { 'return_type': 'void',
813 'names': ['glReadPixels'], 813 'names': ['glReadPixels'],
814 'arguments': 814 'arguments':
815 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, ' 815 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, '
816 'GLenum type, void* pixels', }, 816 'GLenum type, void* pixels', },
817 { 'return_type': 'void', 817 { 'return_type': 'void',
818 'names': ['glReleaseShaderCompiler'], 818 'names': ['glReleaseShaderCompiler'],
819 'arguments': 'void', }, 819 'arguments': 'void', },
820 # Multisampling API is different in different GL versions, some require an
821 # explicit resolve step for renderbuffers and/or FBO texture attachments and
822 # some do not. Multiple alternatives might be present in a single
823 # implementation, which require different use of the API and may have
824 # different performance (explicit resolve performing worse, for example).
825 # So even though the function signature is the same across versions, we split
826 # their definitions so that the function to use can be chosen correctly at a
827 # higher level.
828 # TODO(oetuaho@nvidia.com): Some of these might still be possible to combine.
829 # This could also fix weirdness in the mock bindings that's caused by the same
830 # function name appearing multiple times.
831 # This is the ES3 function, which requires explicit resolve:
832 { 'return_type': 'void', 820 { 'return_type': 'void',
833 'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'], 821 'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'],
834 'arguments': 822 'arguments':
835 'GLenum target, GLenum internalformat, GLsizei width, GLsizei height', }, 823 'GLenum target, GLenum internalformat, GLsizei width, GLsizei height', },
836 { 'return_type': 'void', 824 { 'return_type': 'void',
837 'names': ['glRenderbufferStorageMultisample'], 825 'names': ['glRenderbufferStorageMultisample'],
838 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, ' 826 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
839 'GLsizei width, GLsizei height', }, 827 'GLsizei width, GLsizei height', },
840 { 'return_type': 'void', 828 { 'return_type': 'void',
841 'names': ['glRenderbufferStorageMultisampleANGLE', 829 'names': ['glRenderbufferStorageMultisampleANGLE'],
842 'glRenderbufferStorageMultisample'],
843 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
844 'GLsizei width, GLsizei height', },
845 # In desktop GL, EXT and core versions both have an explicit resolve step,
846 # though desktop core GL implicitly resolves when drawing to a window.
847 # TODO(oetuaho@nvidia.com): Right now this function also doubles as ES2 EXT
848 # function, which has implicit resolve, and for which the fallback is wrong.
849 # Fix this.
850 { 'return_type': 'void',
851 'names': ['glRenderbufferStorageMultisampleEXT',
852 'glRenderbufferStorageMultisample'],
853 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, ' 830 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
854 'GLsizei width, GLsizei height', }, 831 'GLsizei width, GLsizei height', },
855 { 'return_type': 'void', 832 { 'return_type': 'void',
833 'names': ['glRenderbufferStorageMultisampleEXT'],
834 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
835 'GLsizei width, GLsizei height', },
836 { 'return_type': 'void',
856 'names': ['glRenderbufferStorageMultisampleIMG'], 837 'names': ['glRenderbufferStorageMultisampleIMG'],
857 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, ' 838 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
858 'GLsizei width, GLsizei height', }, 839 'GLsizei width, GLsizei height', },
859 { 'return_type': 'void', 840 { 'return_type': 'void',
860 'versions': [{ 'name': 'glResumeTransformFeedback' }], 841 'versions': [{ 'name': 'glResumeTransformFeedback' }],
861 'arguments': 'void', }, 842 'arguments': 'void', },
862 { 'return_type': 'void', 843 { 'return_type': 'void',
863 'names': ['glSampleCoverage'], 844 'names': ['glSampleCoverage'],
864 'arguments': 'GLclampf value, GLboolean invert', }, 845 'arguments': 'GLclampf value, GLboolean invert', },
865 { 'return_type': 'void', 846 { 'return_type': 'void',
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 'names': ['eglWaitClient'], 1353 'names': ['eglWaitClient'],
1373 'arguments': 'void', }, 1354 'arguments': 'void', },
1374 { 'return_type': 'EGLBoolean', 1355 { 'return_type': 'EGLBoolean',
1375 'names': ['eglWaitGL'], 1356 'names': ['eglWaitGL'],
1376 'arguments': 'void', }, 1357 'arguments': 'void', },
1377 { 'return_type': 'EGLBoolean', 1358 { 'return_type': 'EGLBoolean',
1378 'names': ['eglWaitNative'], 1359 'names': ['eglWaitNative'],
1379 'arguments': 'EGLint engine', }, 1360 'arguments': 'EGLint engine', },
1380 { 'return_type': 'EGLint', 1361 { 'return_type': 'EGLint',
1381 'versions': [{ 'name': 'eglWaitSyncKHR', 1362 'versions': [{ 'name': 'eglWaitSyncKHR',
1382 'extensions': ['EGL_KHR_fence_sync', 'EGL_KHR_wait_sync'] }], 1363 'extensions': ['EGL_KHR_wait_sync'] }],
1383 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags' }, 1364 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags' },
1384 ] 1365 ]
1385 1366
1386 WGL_FUNCTIONS = [ 1367 WGL_FUNCTIONS = [
1387 { 'return_type': 'BOOL', 1368 { 'return_type': 'BOOL',
1388 'names': ['wglChoosePixelFormatARB'], 1369 'names': ['wglChoosePixelFormatARB'],
1389 'arguments': 1370 'arguments':
1390 'HDC dc, const int* int_attrib_list, const float* float_attrib_list, ' 1371 'HDC dc, const int* int_attrib_list, const float* float_attrib_list, '
1391 'UINT max_formats, int* formats, UINT* num_formats', }, 1372 'UINT max_formats, int* formats, UINT* num_formats', },
1392 { 'return_type': 'BOOL', 1373 { 'return_type': 'BOOL',
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 'gl_enums_implementation_autogen.h'), 2550 'gl_enums_implementation_autogen.h'),
2570 'wb') 2551 'wb')
2571 GenerateEnumUtils(header_file, enum_header_filenames) 2552 GenerateEnumUtils(header_file, enum_header_filenames)
2572 header_file.close() 2553 header_file.close()
2573 ClangFormat(header_file.name) 2554 ClangFormat(header_file.name)
2574 return 0 2555 return 0
2575 2556
2576 2557
2577 if __name__ == '__main__': 2558 if __name__ == '__main__':
2578 sys.exit(main(sys.argv[1:])) 2559 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « ui/events/latency_info.cc ('k') | ui/gl/gl_bindings_autogen_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698