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

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: remove runtime flag unsafeES3APIs from blink webgl module Created 4 years, 1 month 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 #!/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 GLES2 command buffers.""" 6 """code generator for GLES2 command buffers."""
7 7
8 import itertools 8 import itertools
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 # shadowed: True = the value is shadowed so no glGetXXX call will be made. 2368 # shadowed: True = the value is shadowed so no glGetXXX call will be made.
2369 # first_element_only: For PUT types, True if only the first element of an 2369 # first_element_only: For PUT types, True if only the first element of an
2370 # array is used and we end up calling the single value 2370 # array is used and we end up calling the single value
2371 # corresponding function. eg. TexParameteriv -> TexParameteri 2371 # corresponding function. eg. TexParameteriv -> TexParameteri
2372 # extension: Function is an extension to GL and should not be exposed to 2372 # extension: Function is an extension to GL and should not be exposed to
2373 # pepper unless pepper_interface is defined. 2373 # pepper unless pepper_interface is defined.
2374 # extension_flag: Function is an extension and should be enabled only when 2374 # extension_flag: Function is an extension and should be enabled only when
2375 # the corresponding feature info flag is enabled. Implies 2375 # the corresponding feature info flag is enabled. Implies
2376 # 'extension': True. 2376 # 'extension': True.
2377 # not_shared: For GENn types, True if objects can't be shared between contexts 2377 # not_shared: For GENn types, True if objects can't be shared between contexts
2378 # unsafe: True = no validation is implemented on the service side and the 2378 # es3api: ES3 API, which is valid in WebGL2 or ES3 context.
2379 # command is only available with --enable-unsafe-es3-apis.
2380 # id_mapping: A list of resource type names whose client side IDs need to be 2379 # id_mapping: A list of resource type names whose client side IDs need to be
2381 # mapped to service side IDs. This is only used for unsafe APIs. 2380 # mapped to service side IDs. This is only used for es3 APIs.
2382 2381
2383 _FUNCTION_INFO = { 2382 _FUNCTION_INFO = {
2384 'ActiveTexture': { 2383 'ActiveTexture': {
2385 'decoder_func': 'DoActiveTexture', 2384 'decoder_func': 'DoActiveTexture',
2386 'unit_test': False, 2385 'unit_test': False,
2387 'impl_func': False, 2386 'impl_func': False,
2388 'client_test': False, 2387 'client_test': False,
2389 }, 2388 },
2390 'ApplyScreenSpaceAntialiasingCHROMIUM': { 2389 'ApplyScreenSpaceAntialiasingCHROMIUM': {
2391 'decoder_func': 'DoApplyScreenSpaceAntialiasingCHROMIUM', 2390 'decoder_func': 'DoApplyScreenSpaceAntialiasingCHROMIUM',
(...skipping 11 matching lines...) Expand all
2403 'BindBuffer': { 2402 'BindBuffer': {
2404 'type': 'Bind', 2403 'type': 'Bind',
2405 'decoder_func': 'DoBindBuffer', 2404 'decoder_func': 'DoBindBuffer',
2406 'gen_func': 'GenBuffersARB', 2405 'gen_func': 'GenBuffersARB',
2407 }, 2406 },
2408 'BindBufferBase': { 2407 'BindBufferBase': {
2409 'type': 'Bind', 2408 'type': 'Bind',
2410 'decoder_func': 'DoBindBufferBase', 2409 'decoder_func': 'DoBindBufferBase',
2411 'gen_func': 'GenBuffersARB', 2410 'gen_func': 'GenBuffersARB',
2412 'unit_test': False, 2411 'unit_test': False,
2413 'unsafe': True, 2412 'es3api': True,
2414 }, 2413 },
2415 'BindBufferRange': { 2414 'BindBufferRange': {
2416 'type': 'Bind', 2415 'type': 'Bind',
2417 'decoder_func': 'DoBindBufferRange', 2416 'decoder_func': 'DoBindBufferRange',
2418 'gen_func': 'GenBuffersARB', 2417 'gen_func': 'GenBuffersARB',
2419 'unit_test': False, 2418 'unit_test': False,
2420 'valid_args': { 2419 'valid_args': {
2421 '3': '4', 2420 '3': '4',
2422 '4': '4' 2421 '4': '4'
2423 }, 2422 },
2424 'unsafe': True, 2423 'es3api': True,
2425 }, 2424 },
2426 'BindFramebuffer': { 2425 'BindFramebuffer': {
2427 'type': 'Bind', 2426 'type': 'Bind',
2428 'decoder_func': 'DoBindFramebuffer', 2427 'decoder_func': 'DoBindFramebuffer',
2429 'gl_test_func': 'glBindFramebufferEXT', 2428 'gl_test_func': 'glBindFramebufferEXT',
2430 'gen_func': 'GenFramebuffersEXT', 2429 'gen_func': 'GenFramebuffersEXT',
2431 'trace_level': 1, 2430 'trace_level': 1,
2432 }, 2431 },
2433 'BindRenderbuffer': { 2432 'BindRenderbuffer': {
2434 'type': 'Bind', 2433 'type': 'Bind',
2435 'decoder_func': 'DoBindRenderbuffer', 2434 'decoder_func': 'DoBindRenderbuffer',
2436 'gl_test_func': 'glBindRenderbufferEXT', 2435 'gl_test_func': 'glBindRenderbufferEXT',
2437 'gen_func': 'GenRenderbuffersEXT', 2436 'gen_func': 'GenRenderbuffersEXT',
2438 }, 2437 },
2439 'BindSampler': { 2438 'BindSampler': {
2440 'type': 'Bind', 2439 'type': 'Bind',
2441 'decoder_func': 'DoBindSampler', 2440 'decoder_func': 'DoBindSampler',
2442 'unsafe': True, 2441 'es3api': True,
2443 }, 2442 },
2444 'BindTexture': { 2443 'BindTexture': {
2445 'type': 'Bind', 2444 'type': 'Bind',
2446 'decoder_func': 'DoBindTexture', 2445 'decoder_func': 'DoBindTexture',
2447 'gen_func': 'GenTextures', 2446 'gen_func': 'GenTextures',
2448 # TODO: remove this once client side caching works. 2447 # TODO: remove this once client side caching works.
2449 'client_test': False, 2448 'client_test': False,
2450 'unit_test': False, 2449 'unit_test': False,
2451 'trace_level': 2, 2450 'trace_level': 2,
2452 }, 2451 },
2453 'BindTransformFeedback': { 2452 'BindTransformFeedback': {
2454 'type': 'Bind', 2453 'type': 'Bind',
2455 'decoder_func': 'DoBindTransformFeedback', 2454 'decoder_func': 'DoBindTransformFeedback',
2456 'unsafe': True, 2455 'es3api': True,
2457 'unit_test': False, 2456 'unit_test': False,
2458 }, 2457 },
2459 'BlitFramebufferCHROMIUM': { 2458 'BlitFramebufferCHROMIUM': {
2460 'decoder_func': 'DoBlitFramebufferCHROMIUM', 2459 'decoder_func': 'DoBlitFramebufferCHROMIUM',
2461 'unit_test': False, 2460 'unit_test': False,
2462 'extension': 'chromium_framebuffer_multisample', 2461 'extension': 'chromium_framebuffer_multisample',
2463 'extension_flag': 'chromium_framebuffer_multisample', 2462 'extension_flag': 'chromium_framebuffer_multisample',
2464 'pepper_interface': 'FramebufferBlit', 2463 'pepper_interface': 'FramebufferBlit',
2465 'pepper_name': 'BlitFramebufferEXT', 2464 'pepper_name': 'BlitFramebufferEXT',
2466 'defer_reads': True, 2465 'defer_reads': True,
(...skipping 25 matching lines...) Expand all
2492 'decoder_func': 'DoClear', 2491 'decoder_func': 'DoClear',
2493 'defer_draws': True, 2492 'defer_draws': True,
2494 'trace_level': 2, 2493 'trace_level': 2,
2495 }, 2494 },
2496 'ClearBufferiv': { 2495 'ClearBufferiv': {
2497 'type': 'PUT', 2496 'type': 'PUT',
2498 'use_count_func': True, 2497 'use_count_func': True,
2499 'count': 4, 2498 'count': 4,
2500 'decoder_func': 'DoClearBufferiv', 2499 'decoder_func': 'DoClearBufferiv',
2501 'unit_test': False, 2500 'unit_test': False,
2502 'unsafe': True, 2501 'es3api': True,
2503 'trace_level': 2, 2502 'trace_level': 2,
2504 }, 2503 },
2505 'ClearBufferuiv': { 2504 'ClearBufferuiv': {
2506 'type': 'PUT', 2505 'type': 'PUT',
2507 'count': 4, 2506 'count': 4,
2508 'decoder_func': 'DoClearBufferuiv', 2507 'decoder_func': 'DoClearBufferuiv',
2509 'unit_test': False, 2508 'unit_test': False,
2510 'unsafe': True, 2509 'es3api': True,
2511 'trace_level': 2, 2510 'trace_level': 2,
2512 }, 2511 },
2513 'ClearBufferfv': { 2512 'ClearBufferfv': {
2514 'type': 'PUT', 2513 'type': 'PUT',
2515 'use_count_func': True, 2514 'use_count_func': True,
2516 'count': 4, 2515 'count': 4,
2517 'decoder_func': 'DoClearBufferfv', 2516 'decoder_func': 'DoClearBufferfv',
2518 'unit_test': False, 2517 'unit_test': False,
2519 'unsafe': True, 2518 'es3api': True,
2520 'trace_level': 2, 2519 'trace_level': 2,
2521 }, 2520 },
2522 'ClearBufferfi': { 2521 'ClearBufferfi': {
2523 'unsafe': True, 2522 'es3api': True,
2524 'decoder_func': 'DoClearBufferfi', 2523 'decoder_func': 'DoClearBufferfi',
2525 'unit_test': False, 2524 'unit_test': False,
2526 'trace_level': 2, 2525 'trace_level': 2,
2527 }, 2526 },
2528 'ClearColor': { 2527 'ClearColor': {
2529 'type': 'StateSet', 2528 'type': 'StateSet',
2530 'state': 'ClearColor', 2529 'state': 'ClearColor',
2531 }, 2530 },
2532 'ClearDepthf': { 2531 'ClearDepthf': {
2533 'type': 'StateSet', 2532 'type': 'StateSet',
2534 'state': 'ClearDepthf', 2533 'state': 'ClearDepthf',
2535 'decoder_func': 'glClearDepth', 2534 'decoder_func': 'glClearDepth',
2536 'gl_test_func': 'glClearDepth', 2535 'gl_test_func': 'glClearDepth',
2537 'valid_args': { 2536 'valid_args': {
2538 '0': '0.5f' 2537 '0': '0.5f'
2539 }, 2538 },
2540 }, 2539 },
2541 'ClientWaitSync': { 2540 'ClientWaitSync': {
2542 'type': 'Custom', 2541 'type': 'Custom',
2543 'data_transfer_methods': ['shm'], 2542 'data_transfer_methods': ['shm'],
2544 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, ' 2543 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, '
2545 'GLuint64 timeout, GLenum* result', 2544 'GLuint64 timeout, GLenum* result',
2546 'unsafe': True, 2545 'es3api': True,
2547 'result': ['GLenum'], 2546 'result': ['GLenum'],
2548 'trace_level': 2, 2547 'trace_level': 2,
2549 }, 2548 },
2550 'ColorMask': { 2549 'ColorMask': {
2551 'type': 'StateSet', 2550 'type': 'StateSet',
2552 'state': 'ColorMask', 2551 'state': 'ColorMask',
2553 'no_gl': True, 2552 'no_gl': True,
2554 'expectation': False, 2553 'expectation': False,
2555 }, 2554 },
2556 'ConsumeTextureCHROMIUM': { 2555 'ConsumeTextureCHROMIUM': {
2557 'decoder_func': 'DoConsumeTextureCHROMIUM', 2556 'decoder_func': 'DoConsumeTextureCHROMIUM',
2558 'impl_func': False, 2557 'impl_func': False,
2559 'type': 'PUT', 2558 'type': 'PUT',
2560 'count': 64, # GL_MAILBOX_SIZE_CHROMIUM 2559 'count': 64, # GL_MAILBOX_SIZE_CHROMIUM
2561 'unit_test': False, 2560 'unit_test': False,
2562 'client_test': False, 2561 'client_test': False,
2563 'extension': "CHROMIUM_texture_mailbox", 2562 'extension': "CHROMIUM_texture_mailbox",
2564 'trace_level': 2, 2563 'trace_level': 2,
2565 }, 2564 },
2566 'CopyBufferSubData': { 2565 'CopyBufferSubData': {
2567 'decoder_func': 'DoCopyBufferSubData', 2566 'decoder_func': 'DoCopyBufferSubData',
2568 'unit_test': False, 2567 'unit_test': False,
2569 'unsafe': True, 2568 'es3api': True,
2570 }, 2569 },
2571 'CoverageModulationCHROMIUM': { 2570 'CoverageModulationCHROMIUM': {
2572 'type': 'StateSet', 2571 'type': 'StateSet',
2573 'state': 'CoverageModulationCHROMIUM', 2572 'state': 'CoverageModulationCHROMIUM',
2574 'decoder_func': 'glCoverageModulationNV', 2573 'decoder_func': 'glCoverageModulationNV',
2575 'extension': 'CHROMIUM_framebuffer_mixed_samples', 2574 'extension': 'CHROMIUM_framebuffer_mixed_samples',
2576 'extension_flag': 'chromium_framebuffer_mixed_samples', 2575 'extension_flag': 'chromium_framebuffer_mixed_samples',
2577 }, 2576 },
2578 'CreateAndConsumeTextureCHROMIUM': { 2577 'CreateAndConsumeTextureCHROMIUM': {
2579 'type': 'NoCommand', 2578 'type': 'NoCommand',
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 }, 2621 },
2623 'CopyTexSubImage2D': { 2622 'CopyTexSubImage2D': {
2624 'decoder_func': 'DoCopyTexSubImage2D', 2623 'decoder_func': 'DoCopyTexSubImage2D',
2625 'defer_reads': True, 2624 'defer_reads': True,
2626 'trace_level': 1, 2625 'trace_level': 1,
2627 }, 2626 },
2628 'CompressedTexImage3D': { 2627 'CompressedTexImage3D': {
2629 'type': 'Data', 2628 'type': 'Data',
2630 'data_transfer_methods': ['bucket', 'shm'], 2629 'data_transfer_methods': ['bucket', 'shm'],
2631 'decoder_func': 'DoCompressedTexImage3D', 2630 'decoder_func': 'DoCompressedTexImage3D',
2632 'unsafe': True, 2631 'es3api': True,
2633 'trace_level': 1, 2632 'trace_level': 1,
2634 }, 2633 },
2635 'CompressedTexSubImage3D': { 2634 'CompressedTexSubImage3D': {
2636 'type': 'Data', 2635 'type': 'Data',
2637 'data_transfer_methods': ['bucket', 'shm'], 2636 'data_transfer_methods': ['bucket', 'shm'],
2638 'decoder_func': 'DoCompressedTexSubImage3D', 2637 'decoder_func': 'DoCompressedTexSubImage3D',
2639 'unsafe': True, 2638 'es3api': True,
2640 'trace_level': 1, 2639 'trace_level': 1,
2641 }, 2640 },
2642 'CopyTexSubImage3D': { 2641 'CopyTexSubImage3D': {
2643 'decoder_func': 'DoCopyTexSubImage3D', 2642 'decoder_func': 'DoCopyTexSubImage3D',
2644 'unit_test': False, 2643 'unit_test': False,
2645 'defer_reads': True, 2644 'defer_reads': True,
2646 'unsafe': True, 2645 'es3api': True,
2647 'trace_level': 1, 2646 'trace_level': 1,
2648 }, 2647 },
2649 'CreateImageCHROMIUM': { 2648 'CreateImageCHROMIUM': {
2650 'type': 'NoCommand', 2649 'type': 'NoCommand',
2651 'cmd_args': 2650 'cmd_args':
2652 'ClientBuffer buffer, GLsizei width, GLsizei height, ' 2651 'ClientBuffer buffer, GLsizei width, GLsizei height, '
2653 'GLenum internalformat', 2652 'GLenum internalformat',
2654 'result': ['GLuint'], 2653 'result': ['GLuint'],
2655 'extension': "CHROMIUM_image", 2654 'extension': "CHROMIUM_image",
2656 'trace_level': 1, 2655 'trace_level': 1,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 'type': 'DELn', 2773 'type': 'DELn',
2775 'gl_test_func': 'glDeleteRenderbuffersEXT', 2774 'gl_test_func': 'glDeleteRenderbuffersEXT',
2776 'resource_type': 'Renderbuffer', 2775 'resource_type': 'Renderbuffer',
2777 'resource_types': 'Renderbuffers', 2776 'resource_types': 'Renderbuffers',
2778 'trace_level': 2, 2777 'trace_level': 2,
2779 }, 2778 },
2780 'DeleteSamplers': { 2779 'DeleteSamplers': {
2781 'type': 'DELn', 2780 'type': 'DELn',
2782 'resource_type': 'Sampler', 2781 'resource_type': 'Sampler',
2783 'resource_types': 'Samplers', 2782 'resource_types': 'Samplers',
2784 'unsafe': True, 2783 'es3api': True,
2785 }, 2784 },
2786 'DeleteShader': { 'type': 'Delete' }, 2785 'DeleteShader': { 'type': 'Delete' },
2787 'DeleteSync': { 2786 'DeleteSync': {
2788 'type': 'Delete', 2787 'type': 'Delete',
2789 'cmd_args': 'GLuint sync', 2788 'cmd_args': 'GLuint sync',
2790 'resource_type': 'Sync', 2789 'resource_type': 'Sync',
2791 'unsafe': True, 2790 'es3api': True,
2792 }, 2791 },
2793 'DeleteTextures': { 2792 'DeleteTextures': {
2794 'type': 'DELn', 2793 'type': 'DELn',
2795 'resource_type': 'Texture', 2794 'resource_type': 'Texture',
2796 'resource_types': 'Textures', 2795 'resource_types': 'Textures',
2797 }, 2796 },
2798 'DeleteTransformFeedbacks': { 2797 'DeleteTransformFeedbacks': {
2799 'type': 'DELn', 2798 'type': 'DELn',
2800 'resource_type': 'TransformFeedback', 2799 'resource_type': 'TransformFeedback',
2801 'resource_types': 'TransformFeedbacks', 2800 'resource_types': 'TransformFeedbacks',
2802 'unsafe': True, 2801 'es3api': True,
2803 'unit_test': False, 2802 'unit_test': False,
2804 }, 2803 },
2805 'DepthRangef': { 2804 'DepthRangef': {
2806 'decoder_func': 'DoDepthRangef', 2805 'decoder_func': 'DoDepthRangef',
2807 'gl_test_func': 'glDepthRange', 2806 'gl_test_func': 'glDepthRange',
2808 }, 2807 },
2809 'DepthMask': { 2808 'DepthMask': {
2810 'type': 'StateSet', 2809 'type': 'StateSet',
2811 'state': 'DepthMask', 2810 'state': 'DepthMask',
2812 'no_gl': True, 2811 'no_gl': True,
(...skipping 20 matching lines...) Expand all
2833 'type': 'Custom', 2832 'type': 'Custom',
2834 'impl_func': False, 2833 'impl_func': False,
2835 'cmd_args': 'GLenumDrawMode mode, GLsizei count, ' 2834 'cmd_args': 'GLenumDrawMode mode, GLsizei count, '
2836 'GLenumIndexType type, GLuint index_offset', 2835 'GLenumIndexType type, GLuint index_offset',
2837 'client_test': False, 2836 'client_test': False,
2838 'defer_draws': True, 2837 'defer_draws': True,
2839 'trace_level': 2, 2838 'trace_level': 2,
2840 }, 2839 },
2841 'DrawRangeElements': { 2840 'DrawRangeElements': {
2842 'type': 'NoCommand', 2841 'type': 'NoCommand',
2843 'unsafe': True, 2842 'es3api': True,
2844 }, 2843 },
2845 'Enable': { 2844 'Enable': {
2846 'decoder_func': 'DoEnable', 2845 'decoder_func': 'DoEnable',
2847 'impl_func': False, 2846 'impl_func': False,
2848 'client_test': False, 2847 'client_test': False,
2849 }, 2848 },
2850 'EnableVertexAttribArray': { 2849 'EnableVertexAttribArray': {
2851 'decoder_func': 'DoEnableVertexAttribArray', 2850 'decoder_func': 'DoEnableVertexAttribArray',
2852 'impl_func': False, 2851 'impl_func': False,
2853 }, 2852 },
2854 'FenceSync': { 2853 'FenceSync': {
2855 'type': 'Create', 2854 'type': 'Create',
2856 'client_test': False, 2855 'client_test': False,
2857 'decoder_func': 'DoFenceSync', 2856 'decoder_func': 'DoFenceSync',
2858 'unsafe': True, 2857 'es3api': True,
2859 'trace_level': 1, 2858 'trace_level': 1,
2860 }, 2859 },
2861 'Finish': { 2860 'Finish': {
2862 'impl_func': False, 2861 'impl_func': False,
2863 'client_test': False, 2862 'client_test': False,
2864 'decoder_func': 'DoFinish', 2863 'decoder_func': 'DoFinish',
2865 'defer_reads': True, 2864 'defer_reads': True,
2866 'trace_level': 1, 2865 'trace_level': 1,
2867 }, 2866 },
2868 'Flush': { 2867 'Flush': {
2869 'impl_func': False, 2868 'impl_func': False,
2870 'decoder_func': 'DoFlush', 2869 'decoder_func': 'DoFlush',
2871 'trace_level': 1, 2870 'trace_level': 1,
2872 }, 2871 },
2873 'FlushMappedBufferRange': { 2872 'FlushMappedBufferRange': {
2874 'decoder_func': 'DoFlushMappedBufferRange', 2873 'decoder_func': 'DoFlushMappedBufferRange',
2875 'trace_level': 1, 2874 'trace_level': 1,
2876 'unit_test': False, 2875 'unit_test': False,
2877 'unsafe': True, 2876 'es3api': True,
2878 }, 2877 },
2879 'FramebufferRenderbuffer': { 2878 'FramebufferRenderbuffer': {
2880 'decoder_func': 'DoFramebufferRenderbuffer', 2879 'decoder_func': 'DoFramebufferRenderbuffer',
2881 'gl_test_func': 'glFramebufferRenderbufferEXT', 2880 'gl_test_func': 'glFramebufferRenderbufferEXT',
2882 'trace_level': 1, 2881 'trace_level': 1,
2883 }, 2882 },
2884 'FramebufferTexture2D': { 2883 'FramebufferTexture2D': {
2885 'decoder_func': 'DoFramebufferTexture2D', 2884 'decoder_func': 'DoFramebufferTexture2D',
2886 'gl_test_func': 'glFramebufferTexture2DEXT', 2885 'gl_test_func': 'glFramebufferTexture2DEXT',
2887 'unit_test': False, 2886 'unit_test': False,
2888 'trace_level': 1, 2887 'trace_level': 1,
2889 }, 2888 },
2890 'FramebufferTexture2DMultisampleEXT': { 2889 'FramebufferTexture2DMultisampleEXT': {
2891 'decoder_func': 'DoFramebufferTexture2DMultisample', 2890 'decoder_func': 'DoFramebufferTexture2DMultisample',
2892 'gl_test_func': 'glFramebufferTexture2DMultisampleEXT', 2891 'gl_test_func': 'glFramebufferTexture2DMultisampleEXT',
2893 'unit_test': False, 2892 'unit_test': False,
2894 'extension': 'EXT_multisampled_render_to_texture', 2893 'extension': 'EXT_multisampled_render_to_texture',
2895 'extension_flag': 'multisampled_render_to_texture', 2894 'extension_flag': 'multisampled_render_to_texture',
2896 'trace_level': 1, 2895 'trace_level': 1,
2897 }, 2896 },
2898 'FramebufferTextureLayer': { 2897 'FramebufferTextureLayer': {
2899 'decoder_func': 'DoFramebufferTextureLayer', 2898 'decoder_func': 'DoFramebufferTextureLayer',
2900 'unsafe': True, 2899 'es3api': True,
2901 'unit_test': False, 2900 'unit_test': False,
2902 'trace_level': 1, 2901 'trace_level': 1,
2903 }, 2902 },
2904 'GenerateMipmap': { 2903 'GenerateMipmap': {
2905 'decoder_func': 'DoGenerateMipmap', 2904 'decoder_func': 'DoGenerateMipmap',
2906 'gl_test_func': 'glGenerateMipmapEXT', 2905 'gl_test_func': 'glGenerateMipmapEXT',
2907 'trace_level': 1, 2906 'trace_level': 1,
2908 }, 2907 },
2909 'GenBuffers': { 2908 'GenBuffers': {
2910 'type': 'GENn', 2909 'type': 'GENn',
(...skipping 14 matching lines...) Expand all
2925 'GenRenderbuffers': { 2924 'GenRenderbuffers': {
2926 'type': 'GENn', 'gl_test_func': 'glGenRenderbuffersEXT', 2925 'type': 'GENn', 'gl_test_func': 'glGenRenderbuffersEXT',
2927 'resource_type': 'Renderbuffer', 2926 'resource_type': 'Renderbuffer',
2928 'resource_types': 'Renderbuffers', 2927 'resource_types': 'Renderbuffers',
2929 }, 2928 },
2930 'GenSamplers': { 2929 'GenSamplers': {
2931 'type': 'GENn', 2930 'type': 'GENn',
2932 'gl_test_func': 'glGenSamplers', 2931 'gl_test_func': 'glGenSamplers',
2933 'resource_type': 'Sampler', 2932 'resource_type': 'Sampler',
2934 'resource_types': 'Samplers', 2933 'resource_types': 'Samplers',
2935 'unsafe': True, 2934 'es3api': True,
2936 }, 2935 },
2937 'GenTextures': { 2936 'GenTextures': {
2938 'type': 'GENn', 2937 'type': 'GENn',
2939 'gl_test_func': 'glGenTextures', 2938 'gl_test_func': 'glGenTextures',
2940 'resource_type': 'Texture', 2939 'resource_type': 'Texture',
2941 'resource_types': 'Textures', 2940 'resource_types': 'Textures',
2942 }, 2941 },
2943 'GenTransformFeedbacks': { 2942 'GenTransformFeedbacks': {
2944 'type': 'GENn', 2943 'type': 'GENn',
2945 'gl_test_func': 'glGenTransformFeedbacks', 2944 'gl_test_func': 'glGenTransformFeedbacks',
2946 'resource_type': 'TransformFeedback', 2945 'resource_type': 'TransformFeedback',
2947 'resource_types': 'TransformFeedbacks', 2946 'resource_types': 'TransformFeedbacks',
2948 'unsafe': True, 2947 'es3api': True,
2949 }, 2948 },
2950 'GetActiveAttrib': { 2949 'GetActiveAttrib': {
2951 'type': 'Custom', 2950 'type': 'Custom',
2952 'data_transfer_methods': ['shm'], 2951 'data_transfer_methods': ['shm'],
2953 'cmd_args': 2952 'cmd_args':
2954 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 2953 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
2955 'void* result', 2954 'void* result',
2956 'result': [ 2955 'result': [
2957 'int32_t success', 2956 'int32_t success',
2958 'int32_t size', 2957 'int32_t size',
2959 'uint32_t type', 2958 'uint32_t type',
2960 ], 2959 ],
2961 }, 2960 },
2962 'GetActiveUniform': { 2961 'GetActiveUniform': {
2963 'type': 'Custom', 2962 'type': 'Custom',
2964 'data_transfer_methods': ['shm'], 2963 'data_transfer_methods': ['shm'],
2965 'cmd_args': 2964 'cmd_args':
2966 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 2965 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
2967 'void* result', 2966 'void* result',
2968 'result': [ 2967 'result': [
2969 'int32_t success', 2968 'int32_t success',
2970 'int32_t size', 2969 'int32_t size',
2971 'uint32_t type', 2970 'uint32_t type',
2972 ], 2971 ],
2973 }, 2972 },
2974 'GetActiveUniformBlockiv': { 2973 'GetActiveUniformBlockiv': {
2975 'type': 'Custom', 2974 'type': 'Custom',
2976 'data_transfer_methods': ['shm'], 2975 'data_transfer_methods': ['shm'],
2977 'result': ['SizedResult<GLint>'], 2976 'result': ['SizedResult<GLint>'],
2978 'unsafe': True, 2977 'es3api': True,
2979 }, 2978 },
2980 'GetActiveUniformBlockName': { 2979 'GetActiveUniformBlockName': {
2981 'type': 'Custom', 2980 'type': 'Custom',
2982 'data_transfer_methods': ['shm'], 2981 'data_transfer_methods': ['shm'],
2983 'cmd_args': 2982 'cmd_args':
2984 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 2983 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
2985 'void* result', 2984 'void* result',
2986 'result': ['int32_t'], 2985 'result': ['int32_t'],
2987 'unsafe': True, 2986 'es3api': True,
2988 }, 2987 },
2989 'GetActiveUniformsiv': { 2988 'GetActiveUniformsiv': {
2990 'type': 'Custom', 2989 'type': 'Custom',
2991 'data_transfer_methods': ['shm'], 2990 'data_transfer_methods': ['shm'],
2992 'cmd_args': 2991 'cmd_args':
2993 'GLidProgram program, uint32_t indices_bucket_id, GLenum pname, ' 2992 'GLidProgram program, uint32_t indices_bucket_id, GLenum pname, '
2994 'GLint* params', 2993 'GLint* params',
2995 'result': ['SizedResult<GLint>'], 2994 'result': ['SizedResult<GLint>'],
2996 'unsafe': True, 2995 'es3api': True,
2997 }, 2996 },
2998 'GetAttachedShaders': { 2997 'GetAttachedShaders': {
2999 'type': 'Custom', 2998 'type': 'Custom',
3000 'data_transfer_methods': ['shm'], 2999 'data_transfer_methods': ['shm'],
3001 'cmd_args': 'GLidProgram program, void* result, uint32_t result_size', 3000 'cmd_args': 'GLidProgram program, void* result, uint32_t result_size',
3002 'result': ['SizedResult<GLuint>'], 3001 'result': ['SizedResult<GLuint>'],
3003 }, 3002 },
3004 'GetAttribLocation': { 3003 'GetAttribLocation': {
3005 'type': 'Custom', 3004 'type': 'Custom',
3006 'data_transfer_methods': ['shm'], 3005 'data_transfer_methods': ['shm'],
3007 'cmd_args': 3006 'cmd_args':
3008 'GLidProgram program, uint32_t name_bucket_id, GLint* location', 3007 'GLidProgram program, uint32_t name_bucket_id, GLint* location',
3009 'result': ['GLint'], 3008 'result': ['GLint'],
3010 'error_return': -1, 3009 'error_return': -1,
3011 }, 3010 },
3012 'GetBufferSubDataAsyncCHROMIUM': { 3011 'GetBufferSubDataAsyncCHROMIUM': {
3013 'type': 'Custom', 3012 'type': 'Custom',
3014 'data_transfer_methods': ['shm'], 3013 'data_transfer_methods': ['shm'],
3015 'cmd_args': 'GLenumBufferTarget target, GLintptrNotNegative offset, ' 3014 'cmd_args': 'GLenumBufferTarget target, GLintptrNotNegative offset, '
3016 'GLsizeiptr size, ' 3015 'GLsizeiptr size, '
3017 'uint32_t data_shm_id, uint32_t data_shm_offset', 3016 'uint32_t data_shm_id, uint32_t data_shm_offset',
3018 'unsafe': True, 3017 'es3api': True,
3019 'impl_func': False, 3018 'impl_func': False,
3020 'client_test': False, 3019 'client_test': False,
3021 'trace_level': 1, 3020 'trace_level': 1,
3022 }, 3021 },
3023 'GetFragDataIndexEXT': { 3022 'GetFragDataIndexEXT': {
3024 'type': 'Custom', 3023 'type': 'Custom',
3025 'data_transfer_methods': ['shm'], 3024 'data_transfer_methods': ['shm'],
3026 'cmd_args': 3025 'cmd_args':
3027 'GLidProgram program, uint32_t name_bucket_id, GLint* index', 3026 'GLidProgram program, uint32_t name_bucket_id, GLint* index',
3028 'result': ['GLint'], 3027 'result': ['GLint'],
3029 'error_return': -1, 3028 'error_return': -1,
3030 'extension': 'EXT_blend_func_extended', 3029 'extension': 'EXT_blend_func_extended',
3031 'extension_flag': 'ext_blend_func_extended', 3030 'extension_flag': 'ext_blend_func_extended',
3032 }, 3031 },
3033 'GetFragDataLocation': { 3032 'GetFragDataLocation': {
3034 'type': 'Custom', 3033 'type': 'Custom',
3035 'data_transfer_methods': ['shm'], 3034 'data_transfer_methods': ['shm'],
3036 'cmd_args': 3035 'cmd_args':
3037 'GLidProgram program, uint32_t name_bucket_id, GLint* location', 3036 'GLidProgram program, uint32_t name_bucket_id, GLint* location',
3038 'result': ['GLint'], 3037 'result': ['GLint'],
3039 'error_return': -1, 3038 'error_return': -1,
3040 'unsafe': True, 3039 'es3api': True,
3041 }, 3040 },
3042 'GetBooleanv': { 3041 'GetBooleanv': {
3043 'type': 'GETn', 3042 'type': 'GETn',
3044 'result': ['SizedResult<GLboolean>'], 3043 'result': ['SizedResult<GLboolean>'],
3045 'decoder_func': 'DoGetBooleanv', 3044 'decoder_func': 'DoGetBooleanv',
3046 'gl_test_func': 'glGetIntegerv', 3045 'gl_test_func': 'glGetIntegerv',
3047 }, 3046 },
3048 'GetBufferParameteri64v': { 3047 'GetBufferParameteri64v': {
3049 'type': 'GETn', 3048 'type': 'GETn',
3050 'result': ['SizedResult<GLint64>'], 3049 'result': ['SizedResult<GLint64>'],
3051 'decoder_func': 'DoGetBufferParameteri64v', 3050 'decoder_func': 'DoGetBufferParameteri64v',
3052 'expectation': False, 3051 'expectation': False,
3053 'shadowed': True, 3052 'shadowed': True,
3054 'unsafe': True, 3053 'es3api': True,
3055 }, 3054 },
3056 'GetBufferParameteriv': { 3055 'GetBufferParameteriv': {
3057 'type': 'GETn', 3056 'type': 'GETn',
3058 'result': ['SizedResult<GLint>'], 3057 'result': ['SizedResult<GLint>'],
3059 'decoder_func': 'DoGetBufferParameteriv', 3058 'decoder_func': 'DoGetBufferParameteriv',
3060 'expectation': False, 3059 'expectation': False,
3061 'shadowed': True, 3060 'shadowed': True,
3062 }, 3061 },
3063 'GetError': { 3062 'GetError': {
3064 'type': 'Is', 3063 'type': 'Is',
(...skipping 18 matching lines...) Expand all
3083 'type': 'NoCommand', 3082 'type': 'NoCommand',
3084 'extension': True, 3083 'extension': True,
3085 'trace_level': 1, 3084 'trace_level': 1,
3086 }, 3085 },
3087 'GetInteger64v': { 3086 'GetInteger64v': {
3088 'type': 'GETn', 3087 'type': 'GETn',
3089 'result': ['SizedResult<GLint64>'], 3088 'result': ['SizedResult<GLint64>'],
3090 'client_test': False, 3089 'client_test': False,
3091 'decoder_func': 'DoGetInteger64v', 3090 'decoder_func': 'DoGetInteger64v',
3092 'gl_test_func': 'glGetIntegerv', 3091 'gl_test_func': 'glGetIntegerv',
3093 'unsafe': True 3092 'es3api': True
3094 }, 3093 },
3095 'GetIntegerv': { 3094 'GetIntegerv': {
3096 'type': 'GETn', 3095 'type': 'GETn',
3097 'result': ['SizedResult<GLint>'], 3096 'result': ['SizedResult<GLint>'],
3098 'decoder_func': 'DoGetIntegerv', 3097 'decoder_func': 'DoGetIntegerv',
3099 'client_test': False, 3098 'client_test': False,
3100 }, 3099 },
3101 'GetInteger64i_v': { 3100 'GetInteger64i_v': {
3102 'type': 'GETn', 3101 'type': 'GETn',
3103 'result': ['SizedResult<GLint64>'], 3102 'result': ['SizedResult<GLint64>'],
3104 'decoder_func': 'DoGetInteger64i_v', 3103 'decoder_func': 'DoGetInteger64i_v',
3105 'shadowed': True, 3104 'shadowed': True,
3106 'client_test': False, 3105 'client_test': False,
3107 'unit_test': False, 3106 'unit_test': False,
3108 'unsafe': True 3107 'es3api': True
3109 }, 3108 },
3110 'GetIntegeri_v': { 3109 'GetIntegeri_v': {
3111 'type': 'GETn', 3110 'type': 'GETn',
3112 'result': ['SizedResult<GLint>'], 3111 'result': ['SizedResult<GLint>'],
3113 'decoder_func': 'DoGetIntegeri_v', 3112 'decoder_func': 'DoGetIntegeri_v',
3114 'shadowed': True, 3113 'shadowed': True,
3115 'client_test': False, 3114 'client_test': False,
3116 'unit_test': False, 3115 'unit_test': False,
3117 'unsafe': True 3116 'es3api': True
3118 }, 3117 },
3119 'GetInternalformativ': { 3118 'GetInternalformativ': {
3120 'type': 'Custom', 3119 'type': 'Custom',
3121 'data_transfer_methods': ['shm'], 3120 'data_transfer_methods': ['shm'],
3122 'result': ['SizedResult<GLint>'], 3121 'result': ['SizedResult<GLint>'],
3123 'cmd_args': 3122 'cmd_args':
3124 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, ' 3123 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, '
3125 'GLenumInternalFormatParameter pname, GLint* params', 3124 'GLenumInternalFormatParameter pname, GLint* params',
3126 'unsafe': True, 3125 'es3api': True,
3127 }, 3126 },
3128 'GetMaxValueInBufferCHROMIUM': { 3127 'GetMaxValueInBufferCHROMIUM': {
3129 'type': 'Is', 3128 'type': 'Is',
3130 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM', 3129 'decoder_func': 'DoGetMaxValueInBufferCHROMIUM',
3131 'result': ['GLuint'], 3130 'result': ['GLuint'],
3132 'unit_test': False, 3131 'unit_test': False,
3133 'client_test': False, 3132 'client_test': False,
3134 'extension': True, 3133 'extension': True,
3135 'impl_func': False, 3134 'impl_func': False,
3136 }, 3135 },
(...skipping 22 matching lines...) Expand all
3159 'GetRenderbufferParameteriv': { 3158 'GetRenderbufferParameteriv': {
3160 'type': 'GETn', 3159 'type': 'GETn',
3161 'decoder_func': 'DoGetRenderbufferParameteriv', 3160 'decoder_func': 'DoGetRenderbufferParameteriv',
3162 'gl_test_func': 'glGetRenderbufferParameterivEXT', 3161 'gl_test_func': 'glGetRenderbufferParameterivEXT',
3163 'result': ['SizedResult<GLint>'], 3162 'result': ['SizedResult<GLint>'],
3164 }, 3163 },
3165 'GetSamplerParameterfv': { 3164 'GetSamplerParameterfv': {
3166 'type': 'GETn', 3165 'type': 'GETn',
3167 'decoder_func': 'DoGetSamplerParameterfv', 3166 'decoder_func': 'DoGetSamplerParameterfv',
3168 'result': ['SizedResult<GLfloat>'], 3167 'result': ['SizedResult<GLfloat>'],
3169 'unsafe': True, 3168 'es3api': True,
3170 }, 3169 },
3171 'GetSamplerParameteriv': { 3170 'GetSamplerParameteriv': {
3172 'type': 'GETn', 3171 'type': 'GETn',
3173 'decoder_func': 'DoGetSamplerParameteriv', 3172 'decoder_func': 'DoGetSamplerParameteriv',
3174 'result': ['SizedResult<GLint>'], 3173 'result': ['SizedResult<GLint>'],
3175 'unsafe': True, 3174 'es3api': True,
3176 }, 3175 },
3177 'GetShaderiv': { 3176 'GetShaderiv': {
3178 'type': 'GETn', 3177 'type': 'GETn',
3179 'decoder_func': 'DoGetShaderiv', 3178 'decoder_func': 'DoGetShaderiv',
3180 'result': ['SizedResult<GLint>'], 3179 'result': ['SizedResult<GLint>'],
3181 }, 3180 },
3182 'GetShaderInfoLog': { 3181 'GetShaderInfoLog': {
3183 'type': 'STRn', 3182 'type': 'STRn',
3184 'get_len_func': 'glGetShaderiv', 3183 'get_len_func': 'glGetShaderiv',
3185 'get_len_enum': 'GL_INFO_LOG_LENGTH', 3184 'get_len_enum': 'GL_INFO_LOG_LENGTH',
(...skipping 19 matching lines...) Expand all
3205 'unit_test': False, 3204 'unit_test': False,
3206 'client_test': False, 3205 'client_test': False,
3207 }, 3206 },
3208 'GetString': { 3207 'GetString': {
3209 'type': 'Custom', 3208 'type': 'Custom',
3210 'client_test': False, 3209 'client_test': False,
3211 'cmd_args': 'GLenumStringType name, uint32_t bucket_id', 3210 'cmd_args': 'GLenumStringType name, uint32_t bucket_id',
3212 }, 3211 },
3213 'GetStringi': { 3212 'GetStringi': {
3214 'type': 'NoCommand', 3213 'type': 'NoCommand',
3215 'unsafe': True, 3214 'es3api': True,
3216 }, 3215 },
3217 'GetSynciv': { 3216 'GetSynciv': {
3218 'type': 'GETn', 3217 'type': 'GETn',
3219 'cmd_args': 'GLuint sync, GLenumSyncParameter pname, void* values', 3218 'cmd_args': 'GLuint sync, GLenumSyncParameter pname, void* values',
3220 'result': ['SizedResult<GLint>'], 3219 'result': ['SizedResult<GLint>'],
3221 'id_mapping': ['Sync'], 3220 'id_mapping': ['Sync'],
3222 'unsafe': True, 3221 'es3api': True,
3223 }, 3222 },
3224 'GetTexParameterfv': { 3223 'GetTexParameterfv': {
3225 'type': 'GETn', 3224 'type': 'GETn',
3226 'decoder_func': 'DoGetTexParameterfv', 3225 'decoder_func': 'DoGetTexParameterfv',
3227 'result': ['SizedResult<GLfloat>'] 3226 'result': ['SizedResult<GLfloat>']
3228 }, 3227 },
3229 'GetTexParameteriv': { 3228 'GetTexParameteriv': {
3230 'type': 'GETn', 3229 'type': 'GETn',
3231 'decoder_func': 'DoGetTexParameteriv', 3230 'decoder_func': 'DoGetTexParameteriv',
3232 'result': ['SizedResult<GLint>'] 3231 'result': ['SizedResult<GLint>']
3233 }, 3232 },
3234 'GetTranslatedShaderSourceANGLE': { 3233 'GetTranslatedShaderSourceANGLE': {
3235 'type': 'STRn', 3234 'type': 'STRn',
3236 'get_len_func': 'DoGetShaderiv', 3235 'get_len_func': 'DoGetShaderiv',
3237 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE', 3236 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE',
3238 'unit_test': False, 3237 'unit_test': False,
3239 'extension': True, 3238 'extension': True,
3240 }, 3239 },
3241 'GetUniformBlockIndex': { 3240 'GetUniformBlockIndex': {
3242 'type': 'Custom', 3241 'type': 'Custom',
3243 'data_transfer_methods': ['shm'], 3242 'data_transfer_methods': ['shm'],
3244 'cmd_args': 3243 'cmd_args':
3245 'GLidProgram program, uint32_t name_bucket_id, GLuint* index', 3244 'GLidProgram program, uint32_t name_bucket_id, GLuint* index',
3246 'result': ['GLuint'], 3245 'result': ['GLuint'],
3247 'error_return': 'GL_INVALID_INDEX', 3246 'error_return': 'GL_INVALID_INDEX',
3248 'unsafe': True, 3247 'es3api': True,
3249 }, 3248 },
3250 'GetUniformBlocksCHROMIUM': { 3249 'GetUniformBlocksCHROMIUM': {
3251 'type': 'Custom', 3250 'type': 'Custom',
3252 'impl_func': False, 3251 'impl_func': False,
3253 'extension': True, 3252 'extension': True,
3254 'client_test': False, 3253 'client_test': False,
3255 'cmd_args': 'GLidProgram program, uint32_t bucket_id', 3254 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
3256 'result': ['uint32_t'], 3255 'result': ['uint32_t'],
3257 'unsafe': True, 3256 'es3api': True,
3258 }, 3257 },
3259 'GetUniformsES3CHROMIUM': { 3258 'GetUniformsES3CHROMIUM': {
3260 'type': 'Custom', 3259 'type': 'Custom',
3261 'impl_func': False, 3260 'impl_func': False,
3262 'extension': True, 3261 'extension': True,
3263 'client_test': False, 3262 'client_test': False,
3264 'cmd_args': 'GLidProgram program, uint32_t bucket_id', 3263 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
3265 'result': ['uint32_t'], 3264 'result': ['uint32_t'],
3266 'unsafe': True, 3265 'es3api': True,
3267 }, 3266 },
3268 'GetTransformFeedbackVarying': { 3267 'GetTransformFeedbackVarying': {
3269 'type': 'Custom', 3268 'type': 'Custom',
3270 'data_transfer_methods': ['shm'], 3269 'data_transfer_methods': ['shm'],
3271 'cmd_args': 3270 'cmd_args':
3272 'GLidProgram program, GLuint index, uint32_t name_bucket_id, ' 3271 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
3273 'void* result', 3272 'void* result',
3274 'result': [ 3273 'result': [
3275 'int32_t success', 3274 'int32_t success',
3276 'int32_t size', 3275 'int32_t size',
3277 'uint32_t type', 3276 'uint32_t type',
3278 ], 3277 ],
3279 'unsafe': True, 3278 'es3api': True,
3280 }, 3279 },
3281 'GetTransformFeedbackVaryingsCHROMIUM': { 3280 'GetTransformFeedbackVaryingsCHROMIUM': {
3282 'type': 'Custom', 3281 'type': 'Custom',
3283 'impl_func': False, 3282 'impl_func': False,
3284 'extension': True, 3283 'extension': True,
3285 'client_test': False, 3284 'client_test': False,
3286 'cmd_args': 'GLidProgram program, uint32_t bucket_id', 3285 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
3287 'result': ['uint32_t'], 3286 'result': ['uint32_t'],
3288 'unsafe': True, 3287 'es3api': True,
3289 }, 3288 },
3290 'GetUniformfv': { 3289 'GetUniformfv': {
3291 'type': 'Custom', 3290 'type': 'Custom',
3292 'data_transfer_methods': ['shm'], 3291 'data_transfer_methods': ['shm'],
3293 'result': ['SizedResult<GLfloat>'], 3292 'result': ['SizedResult<GLfloat>'],
3294 }, 3293 },
3295 'GetUniformiv': { 3294 'GetUniformiv': {
3296 'type': 'Custom', 3295 'type': 'Custom',
3297 'data_transfer_methods': ['shm'], 3296 'data_transfer_methods': ['shm'],
3298 'result': ['SizedResult<GLint>'], 3297 'result': ['SizedResult<GLint>'],
3299 }, 3298 },
3300 'GetUniformuiv': { 3299 'GetUniformuiv': {
3301 'type': 'Custom', 3300 'type': 'Custom',
3302 'data_transfer_methods': ['shm'], 3301 'data_transfer_methods': ['shm'],
3303 'result': ['SizedResult<GLuint>'], 3302 'result': ['SizedResult<GLuint>'],
3304 'unsafe': True, 3303 'es3api': True,
3305 }, 3304 },
3306 'GetUniformIndices': { 3305 'GetUniformIndices': {
3307 'type': 'Custom', 3306 'type': 'Custom',
3308 'data_transfer_methods': ['shm'], 3307 'data_transfer_methods': ['shm'],
3309 'result': ['SizedResult<GLuint>'], 3308 'result': ['SizedResult<GLuint>'],
3310 'cmd_args': 'GLidProgram program, uint32_t names_bucket_id, ' 3309 'cmd_args': 'GLidProgram program, uint32_t names_bucket_id, '
3311 'GLuint* indices', 3310 'GLuint* indices',
3312 'unsafe': True, 3311 'es3api': True,
3313 }, 3312 },
3314 'GetUniformLocation': { 3313 'GetUniformLocation': {
3315 'type': 'Custom', 3314 'type': 'Custom',
3316 'data_transfer_methods': ['shm'], 3315 'data_transfer_methods': ['shm'],
3317 'cmd_args': 3316 'cmd_args':
3318 'GLidProgram program, uint32_t name_bucket_id, GLint* location', 3317 'GLidProgram program, uint32_t name_bucket_id, GLint* location',
3319 'result': ['GLint'], 3318 'result': ['GLint'],
3320 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformL ocation.xml 3319 'error_return': -1, # http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformL ocation.xml
3321 }, 3320 },
3322 'GetVertexAttribfv': { 3321 'GetVertexAttribfv': {
(...skipping 12 matching lines...) Expand all
3335 'expectation': False, 3334 'expectation': False,
3336 'client_test': False, 3335 'client_test': False,
3337 }, 3336 },
3338 'GetVertexAttribIiv': { 3337 'GetVertexAttribIiv': {
3339 'type': 'GETn', 3338 'type': 'GETn',
3340 'result': ['SizedResult<GLint>'], 3339 'result': ['SizedResult<GLint>'],
3341 'impl_func': False, 3340 'impl_func': False,
3342 'decoder_func': 'DoGetVertexAttribIiv', 3341 'decoder_func': 'DoGetVertexAttribIiv',
3343 'expectation': False, 3342 'expectation': False,
3344 'client_test': False, 3343 'client_test': False,
3345 'unsafe': True, 3344 'es3api': True,
3346 }, 3345 },
3347 'GetVertexAttribIuiv': { 3346 'GetVertexAttribIuiv': {
3348 'type': 'GETn', 3347 'type': 'GETn',
3349 'result': ['SizedResult<GLuint>'], 3348 'result': ['SizedResult<GLuint>'],
3350 'impl_func': False, 3349 'impl_func': False,
3351 'decoder_func': 'DoGetVertexAttribIuiv', 3350 'decoder_func': 'DoGetVertexAttribIuiv',
3352 'expectation': False, 3351 'expectation': False,
3353 'client_test': False, 3352 'client_test': False,
3354 'unsafe': True, 3353 'es3api': True,
3355 }, 3354 },
3356 'GetVertexAttribPointerv': { 3355 'GetVertexAttribPointerv': {
3357 'type': 'Custom', 3356 'type': 'Custom',
3358 'data_transfer_methods': ['shm'], 3357 'data_transfer_methods': ['shm'],
3359 'result': ['SizedResult<GLuint>'], 3358 'result': ['SizedResult<GLuint>'],
3360 'client_test': False, 3359 'client_test': False,
3361 }, 3360 },
3362 'InvalidateFramebuffer': { 3361 'InvalidateFramebuffer': {
3363 'type': 'PUTn', 3362 'type': 'PUTn',
3364 'count': 1, 3363 'count': 1,
3365 'decoder_func': 'DoInvalidateFramebuffer', 3364 'decoder_func': 'DoInvalidateFramebuffer',
3366 'client_test': False, 3365 'client_test': False,
3367 'unit_test': False, 3366 'unit_test': False,
3368 'unsafe': True, 3367 'es3api': True,
3369 }, 3368 },
3370 'InvalidateSubFramebuffer': { 3369 'InvalidateSubFramebuffer': {
3371 'type': 'PUTn', 3370 'type': 'PUTn',
3372 'count': 1, 3371 'count': 1,
3373 'decoder_func': 'DoInvalidateSubFramebuffer', 3372 'decoder_func': 'DoInvalidateSubFramebuffer',
3374 'client_test': False, 3373 'client_test': False,
3375 'unit_test': False, 3374 'unit_test': False,
3376 'unsafe': True, 3375 'es3api': True,
3377 }, 3376 },
3378 'IsBuffer': { 3377 'IsBuffer': {
3379 'type': 'Is', 3378 'type': 'Is',
3380 'decoder_func': 'DoIsBuffer', 3379 'decoder_func': 'DoIsBuffer',
3381 'expectation': False, 3380 'expectation': False,
3382 }, 3381 },
3383 'IsEnabled': { 3382 'IsEnabled': {
3384 'type': 'Is', 3383 'type': 'Is',
3385 'decoder_func': 'DoIsEnabled', 3384 'decoder_func': 'DoIsEnabled',
3386 'client_test': False, 3385 'client_test': False,
(...skipping 17 matching lines...) Expand all
3404 }, 3403 },
3405 'IsShader': { 3404 'IsShader': {
3406 'type': 'Is', 3405 'type': 'Is',
3407 'decoder_func': 'DoIsShader', 3406 'decoder_func': 'DoIsShader',
3408 'expectation': False, 3407 'expectation': False,
3409 }, 3408 },
3410 'IsSampler': { 3409 'IsSampler': {
3411 'type': 'Is', 3410 'type': 'Is',
3412 'decoder_func': 'DoIsSampler', 3411 'decoder_func': 'DoIsSampler',
3413 'expectation': False, 3412 'expectation': False,
3414 'unsafe': True, 3413 'es3api': True,
3415 }, 3414 },
3416 'IsSync': { 3415 'IsSync': {
3417 'type': 'Is', 3416 'type': 'Is',
3418 'id_mapping': [ 'Sync' ], 3417 'id_mapping': [ 'Sync' ],
3419 'cmd_args': 'GLuint sync', 3418 'cmd_args': 'GLuint sync',
3420 'decoder_func': 'DoIsSync', 3419 'decoder_func': 'DoIsSync',
3421 'expectation': False, 3420 'expectation': False,
3422 'unsafe': True, 3421 'es3api': True,
3423 }, 3422 },
3424 'IsTexture': { 3423 'IsTexture': {
3425 'type': 'Is', 3424 'type': 'Is',
3426 'decoder_func': 'DoIsTexture', 3425 'decoder_func': 'DoIsTexture',
3427 'expectation': False, 3426 'expectation': False,
3428 }, 3427 },
3429 'IsTransformFeedback': { 3428 'IsTransformFeedback': {
3430 'type': 'Is', 3429 'type': 'Is',
3431 'decoder_func': 'DoIsTransformFeedback', 3430 'decoder_func': 'DoIsTransformFeedback',
3432 'expectation': False, 3431 'expectation': False,
3433 'unsafe': True, 3432 'es3api': True,
3434 }, 3433 },
3435 'GetLastFlushIdCHROMIUM': { 3434 'GetLastFlushIdCHROMIUM': {
3436 'type': 'NoCommand', 3435 'type': 'NoCommand',
3437 'impl_func': False, 3436 'impl_func': False,
3438 'result': ['GLuint'], 3437 'result': ['GLuint'],
3439 'extension': True, 3438 'extension': True,
3440 }, 3439 },
3441 'LinkProgram': { 3440 'LinkProgram': {
3442 'decoder_func': 'DoLinkProgram', 3441 'decoder_func': 'DoLinkProgram',
3443 'impl_func': False, 3442 'impl_func': False,
(...skipping 16 matching lines...) Expand all
3460 'pepper_interface': 'ChromiumMapSub', 3459 'pepper_interface': 'ChromiumMapSub',
3461 'trace_level': 1, 3460 'trace_level': 1,
3462 }, 3461 },
3463 'MapBufferRange': { 3462 'MapBufferRange': {
3464 'type': 'Custom', 3463 'type': 'Custom',
3465 'data_transfer_methods': ['shm'], 3464 'data_transfer_methods': ['shm'],
3466 'cmd_args': 'GLenumBufferTarget target, GLintptrNotNegative offset, ' 3465 'cmd_args': 'GLenumBufferTarget target, GLintptrNotNegative offset, '
3467 'GLsizeiptr size, GLbitfieldMapBufferAccess access, ' 3466 'GLsizeiptr size, GLbitfieldMapBufferAccess access, '
3468 'uint32_t data_shm_id, uint32_t data_shm_offset, ' 3467 'uint32_t data_shm_id, uint32_t data_shm_offset, '
3469 'uint32_t result_shm_id, uint32_t result_shm_offset', 3468 'uint32_t result_shm_id, uint32_t result_shm_offset',
3470 'unsafe': True, 3469 'es3api': True,
3471 'result': ['uint32_t'], 3470 'result': ['uint32_t'],
3472 'trace_level': 1, 3471 'trace_level': 1,
3473 }, 3472 },
3474 'PauseTransformFeedback': { 3473 'PauseTransformFeedback': {
3475 'decoder_func': 'DoPauseTransformFeedback', 3474 'decoder_func': 'DoPauseTransformFeedback',
3476 'unit_test': False, 3475 'unit_test': False,
3477 'unsafe': True, 3476 'es3api': True,
3478 }, 3477 },
3479 'PixelStorei': { 3478 'PixelStorei': {
3480 'type': 'Custom', 3479 'type': 'Custom',
3481 'impl_func': False, 3480 'impl_func': False,
3482 }, 3481 },
3483 'PostSubBufferCHROMIUM': { 3482 'PostSubBufferCHROMIUM': {
3484 'type': 'Custom', 3483 'type': 'Custom',
3485 'impl_func': False, 3484 'impl_func': False,
3486 'client_test': False, 3485 'client_test': False,
3487 'extension': True, 3486 'extension': True,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3528 'cmd_comment': 3527 'cmd_comment':
3529 '// GL_EXT_multisampled_render_to_texture\n', 3528 '// GL_EXT_multisampled_render_to_texture\n',
3530 'decoder_func': 'DoRenderbufferStorageMultisampleEXT', 3529 'decoder_func': 'DoRenderbufferStorageMultisampleEXT',
3531 'gl_test_func': 'glRenderbufferStorageMultisampleEXT', 3530 'gl_test_func': 'glRenderbufferStorageMultisampleEXT',
3532 'unit_test': False, 3531 'unit_test': False,
3533 'extension': 'EXT_multisampled_render_to_texture', 3532 'extension': 'EXT_multisampled_render_to_texture',
3534 'extension_flag': 'multisampled_render_to_texture', 3533 'extension_flag': 'multisampled_render_to_texture',
3535 'trace_level': 1, 3534 'trace_level': 1,
3536 }, 3535 },
3537 'ReadBuffer': { 3536 'ReadBuffer': {
3538 'unsafe': True, 3537 'es3api': True,
3539 'decoder_func': 'DoReadBuffer', 3538 'decoder_func': 'DoReadBuffer',
3540 'trace_level': 1, 3539 'trace_level': 1,
3541 }, 3540 },
3542 'ReadPixels': { 3541 'ReadPixels': {
3543 'cmd_comment': 3542 'cmd_comment':
3544 '// ReadPixels has the result separated from the pixel buffer so that\n' 3543 '// ReadPixels has the result separated from the pixel buffer so that\n'
3545 '// it is easier to specify the result going to some specific place\n' 3544 '// it is easier to specify the result going to some specific place\n'
3546 '// that exactly fits the rectangle of pixels.\n', 3545 '// that exactly fits the rectangle of pixels.\n',
3547 'type': 'Custom', 3546 'type': 'Custom',
3548 'data_transfer_methods': ['shm'], 3547 'data_transfer_methods': ['shm'],
(...skipping 14 matching lines...) Expand all
3563 'defer_reads': True, 3562 'defer_reads': True,
3564 'trace_level': 1, 3563 'trace_level': 1,
3565 }, 3564 },
3566 'ReleaseShaderCompiler': { 3565 'ReleaseShaderCompiler': {
3567 'decoder_func': 'DoReleaseShaderCompiler', 3566 'decoder_func': 'DoReleaseShaderCompiler',
3568 'unit_test': False, 3567 'unit_test': False,
3569 }, 3568 },
3570 'ResumeTransformFeedback': { 3569 'ResumeTransformFeedback': {
3571 'decoder_func': 'DoResumeTransformFeedback', 3570 'decoder_func': 'DoResumeTransformFeedback',
3572 'unit_test': False, 3571 'unit_test': False,
3573 'unsafe': True, 3572 'es3api': True,
3574 }, 3573 },
3575 'SamplerParameterf': { 3574 'SamplerParameterf': {
3576 'valid_args': { 3575 'valid_args': {
3577 '2': 'GL_NEAREST' 3576 '2': 'GL_NEAREST'
3578 }, 3577 },
3579 'decoder_func': 'DoSamplerParameterf', 3578 'decoder_func': 'DoSamplerParameterf',
3580 'unsafe': True, 3579 'es3api': True,
3581 }, 3580 },
3582 'SamplerParameterfv': { 3581 'SamplerParameterfv': {
3583 'type': 'PUT', 3582 'type': 'PUT',
3584 'data_value': 'GL_NEAREST', 3583 'data_value': 'GL_NEAREST',
3585 'count': 1, 3584 'count': 1,
3586 'gl_test_func': 'glSamplerParameterf', 3585 'gl_test_func': 'glSamplerParameterf',
3587 'decoder_func': 'DoSamplerParameterfv', 3586 'decoder_func': 'DoSamplerParameterfv',
3588 'first_element_only': True, 3587 'first_element_only': True,
3589 'unsafe': True, 3588 'es3api': True,
3590 }, 3589 },
3591 'SamplerParameteri': { 3590 'SamplerParameteri': {
3592 'valid_args': { 3591 'valid_args': {
3593 '2': 'GL_NEAREST' 3592 '2': 'GL_NEAREST'
3594 }, 3593 },
3595 'decoder_func': 'DoSamplerParameteri', 3594 'decoder_func': 'DoSamplerParameteri',
3596 'unsafe': True, 3595 'es3api': True,
3597 }, 3596 },
3598 'SamplerParameteriv': { 3597 'SamplerParameteriv': {
3599 'type': 'PUT', 3598 'type': 'PUT',
3600 'data_value': 'GL_NEAREST', 3599 'data_value': 'GL_NEAREST',
3601 'count': 1, 3600 'count': 1,
3602 'gl_test_func': 'glSamplerParameteri', 3601 'gl_test_func': 'glSamplerParameteri',
3603 'decoder_func': 'DoSamplerParameteriv', 3602 'decoder_func': 'DoSamplerParameteriv',
3604 'first_element_only': True, 3603 'first_element_only': True,
3605 'unsafe': True, 3604 'es3api': True,
3606 }, 3605 },
3607 'ShaderBinary': { 3606 'ShaderBinary': {
3608 'type': 'Custom', 3607 'type': 'Custom',
3609 'client_test': False, 3608 'client_test': False,
3610 }, 3609 },
3611 'ShaderSource': { 3610 'ShaderSource': {
3612 'type': 'PUTSTR', 3611 'type': 'PUTSTR',
3613 'decoder_func': 'DoShaderSource', 3612 'decoder_func': 'DoShaderSource',
3614 'expectation': False, 3613 'expectation': False,
3615 'data_transfer_methods': ['bucket'], 3614 'data_transfer_methods': ['bucket'],
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
3657 'impl_func': False, 3656 'impl_func': False,
3658 'data_transfer_methods': ['shm'], 3657 'data_transfer_methods': ['shm'],
3659 'client_test': False, 3658 'client_test': False,
3660 'trace_level': 2, 3659 'trace_level': 2,
3661 }, 3660 },
3662 'TexImage3D': { 3661 'TexImage3D': {
3663 'type': 'Custom', 3662 'type': 'Custom',
3664 'impl_func': False, 3663 'impl_func': False,
3665 'data_transfer_methods': ['shm'], 3664 'data_transfer_methods': ['shm'],
3666 'client_test': False, 3665 'client_test': False,
3667 'unsafe': True, 3666 'es3api': True,
3668 'trace_level': 2, 3667 'trace_level': 2,
3669 }, 3668 },
3670 'TexParameterf': { 3669 'TexParameterf': {
3671 'decoder_func': 'DoTexParameterf', 3670 'decoder_func': 'DoTexParameterf',
3672 'valid_args': { 3671 'valid_args': {
3673 '2': 'GL_NEAREST' 3672 '2': 'GL_NEAREST'
3674 }, 3673 },
3675 }, 3674 },
3676 'TexParameteri': { 3675 'TexParameteri': {
3677 'decoder_func': 'DoTexParameteri', 3676 'decoder_func': 'DoTexParameteri',
(...skipping 11 matching lines...) Expand all
3689 }, 3688 },
3690 'TexParameteriv': { 3689 'TexParameteriv': {
3691 'type': 'PUT', 3690 'type': 'PUT',
3692 'data_value': 'GL_NEAREST', 3691 'data_value': 'GL_NEAREST',
3693 'count': 1, 3692 'count': 1,
3694 'decoder_func': 'DoTexParameteriv', 3693 'decoder_func': 'DoTexParameteriv',
3695 'gl_test_func': 'glTexParameteri', 3694 'gl_test_func': 'glTexParameteri',
3696 'first_element_only': True, 3695 'first_element_only': True,
3697 }, 3696 },
3698 'TexStorage3D': { 3697 'TexStorage3D': {
3699 'unsafe': True, 3698 'es3api': True,
3700 'unit_test': False, 3699 'unit_test': False,
3701 'decoder_func': 'DoTexStorage3D', 3700 'decoder_func': 'DoTexStorage3D',
3702 'trace_level': 2, 3701 'trace_level': 2,
3703 }, 3702 },
3704 'TexSubImage2D': { 3703 'TexSubImage2D': {
3705 'type': 'Custom', 3704 'type': 'Custom',
3706 'impl_func': False, 3705 'impl_func': False,
3707 'data_transfer_methods': ['shm'], 3706 'data_transfer_methods': ['shm'],
3708 'client_test': False, 3707 'client_test': False,
3709 'trace_level': 2, 3708 'trace_level': 2,
3710 'cmd_args': 'GLenumTextureTarget target, GLint level, ' 3709 'cmd_args': 'GLenumTextureTarget target, GLint level, '
3711 'GLint xoffset, GLint yoffset, ' 3710 'GLint xoffset, GLint yoffset, '
3712 'GLsizei width, GLsizei height, ' 3711 'GLsizei width, GLsizei height, '
3713 'GLenumTextureFormat format, GLenumPixelType type, ' 3712 'GLenumTextureFormat format, GLenumPixelType type, '
3714 'const void* pixels, GLboolean internal' 3713 'const void* pixels, GLboolean internal'
3715 }, 3714 },
3716 'TexSubImage3D': { 3715 'TexSubImage3D': {
3717 'type': 'Custom', 3716 'type': 'Custom',
3718 'impl_func': False, 3717 'impl_func': False,
3719 'data_transfer_methods': ['shm'], 3718 'data_transfer_methods': ['shm'],
3720 'client_test': False, 3719 'client_test': False,
3721 'trace_level': 2, 3720 'trace_level': 2,
3722 'cmd_args': 'GLenumTextureTarget target, GLint level, ' 3721 'cmd_args': 'GLenumTextureTarget target, GLint level, '
3723 'GLint xoffset, GLint yoffset, GLint zoffset, ' 3722 'GLint xoffset, GLint yoffset, GLint zoffset, '
3724 'GLsizei width, GLsizei height, GLsizei depth, ' 3723 'GLsizei width, GLsizei height, GLsizei depth, '
3725 'GLenumTextureFormat format, GLenumPixelType type, ' 3724 'GLenumTextureFormat format, GLenumPixelType type, '
3726 'const void* pixels, GLboolean internal', 3725 'const void* pixels, GLboolean internal',
3727 'unsafe': True, 3726 'es3api': True,
3728 }, 3727 },
3729 'TransformFeedbackVaryings': { 3728 'TransformFeedbackVaryings': {
3730 'type': 'PUTSTR', 3729 'type': 'PUTSTR',
3731 'data_transfer_methods': ['bucket'], 3730 'data_transfer_methods': ['bucket'],
3732 'decoder_func': 'DoTransformFeedbackVaryings', 3731 'decoder_func': 'DoTransformFeedbackVaryings',
3733 'cmd_args': 3732 'cmd_args':
3734 'GLuint program, const char** varyings, GLenum buffermode', 3733 'GLuint program, const char** varyings, GLenum buffermode',
3735 'expectation': False, 3734 'expectation': False,
3736 'unsafe': True, 3735 'es3api': True,
3737 }, 3736 },
3738 'Uniform1f': {'type': 'PUTXn', 'count': 1}, 3737 'Uniform1f': {'type': 'PUTXn', 'count': 1},
3739 'Uniform1fv': { 3738 'Uniform1fv': {
3740 'type': 'PUTn', 3739 'type': 'PUTn',
3741 'count': 1, 3740 'count': 1,
3742 'decoder_func': 'DoUniform1fv', 3741 'decoder_func': 'DoUniform1fv',
3743 }, 3742 },
3744 'Uniform1i': {'decoder_func': 'DoUniform1i', 'unit_test': False}, 3743 'Uniform1i': {'decoder_func': 'DoUniform1i', 'unit_test': False},
3745 'Uniform1iv': { 3744 'Uniform1iv': {
3746 'type': 'PUTn', 3745 'type': 'PUTn',
3747 'count': 1, 3746 'count': 1,
3748 'decoder_func': 'DoUniform1iv', 3747 'decoder_func': 'DoUniform1iv',
3749 'unit_test': False, 3748 'unit_test': False,
3750 }, 3749 },
3751 'Uniform1ui': { 3750 'Uniform1ui': {
3752 'type': 'PUTXn', 3751 'type': 'PUTXn',
3753 'count': 1, 3752 'count': 1,
3754 'unit_test': False, 3753 'unit_test': False,
3755 'unsafe': True, 3754 'es3api': True,
3756 }, 3755 },
3757 'Uniform1uiv': { 3756 'Uniform1uiv': {
3758 'type': 'PUTn', 3757 'type': 'PUTn',
3759 'count': 1, 3758 'count': 1,
3760 'decoder_func': 'DoUniform1uiv', 3759 'decoder_func': 'DoUniform1uiv',
3761 'unit_test': False, 3760 'unit_test': False,
3762 'unsafe': True, 3761 'es3api': True,
3763 }, 3762 },
3764 'Uniform2i': {'type': 'PUTXn', 'count': 2}, 3763 'Uniform2i': {'type': 'PUTXn', 'count': 2},
3765 'Uniform2f': {'type': 'PUTXn', 'count': 2}, 3764 'Uniform2f': {'type': 'PUTXn', 'count': 2},
3766 'Uniform2fv': { 3765 'Uniform2fv': {
3767 'type': 'PUTn', 3766 'type': 'PUTn',
3768 'count': 2, 3767 'count': 2,
3769 'decoder_func': 'DoUniform2fv', 3768 'decoder_func': 'DoUniform2fv',
3770 }, 3769 },
3771 'Uniform2iv': { 3770 'Uniform2iv': {
3772 'type': 'PUTn', 3771 'type': 'PUTn',
3773 'count': 2, 3772 'count': 2,
3774 'decoder_func': 'DoUniform2iv', 3773 'decoder_func': 'DoUniform2iv',
3775 }, 3774 },
3776 'Uniform2ui': { 3775 'Uniform2ui': {
3777 'type': 'PUTXn', 3776 'type': 'PUTXn',
3778 'count': 2, 3777 'count': 2,
3779 'unit_test': False, 3778 'unit_test': False,
3780 'unsafe': True, 3779 'es3api': True,
3781 }, 3780 },
3782 'Uniform2uiv': { 3781 'Uniform2uiv': {
3783 'type': 'PUTn', 3782 'type': 'PUTn',
3784 'count': 2, 3783 'count': 2,
3785 'decoder_func': 'DoUniform2uiv', 3784 'decoder_func': 'DoUniform2uiv',
3786 'unit_test': False, 3785 'unit_test': False,
3787 'unsafe': True, 3786 'es3api': True,
3788 }, 3787 },
3789 'Uniform3i': {'type': 'PUTXn', 'count': 3}, 3788 'Uniform3i': {'type': 'PUTXn', 'count': 3},
3790 'Uniform3f': {'type': 'PUTXn', 'count': 3}, 3789 'Uniform3f': {'type': 'PUTXn', 'count': 3},
3791 'Uniform3fv': { 3790 'Uniform3fv': {
3792 'type': 'PUTn', 3791 'type': 'PUTn',
3793 'count': 3, 3792 'count': 3,
3794 'decoder_func': 'DoUniform3fv', 3793 'decoder_func': 'DoUniform3fv',
3795 }, 3794 },
3796 'Uniform3iv': { 3795 'Uniform3iv': {
3797 'type': 'PUTn', 3796 'type': 'PUTn',
3798 'count': 3, 3797 'count': 3,
3799 'decoder_func': 'DoUniform3iv', 3798 'decoder_func': 'DoUniform3iv',
3800 }, 3799 },
3801 'Uniform3ui': { 3800 'Uniform3ui': {
3802 'type': 'PUTXn', 3801 'type': 'PUTXn',
3803 'count': 3, 3802 'count': 3,
3804 'unit_test': False, 3803 'unit_test': False,
3805 'unsafe': True, 3804 'es3api': True,
3806 }, 3805 },
3807 'Uniform3uiv': { 3806 'Uniform3uiv': {
3808 'type': 'PUTn', 3807 'type': 'PUTn',
3809 'count': 3, 3808 'count': 3,
3810 'decoder_func': 'DoUniform3uiv', 3809 'decoder_func': 'DoUniform3uiv',
3811 'unit_test': False, 3810 'unit_test': False,
3812 'unsafe': True, 3811 'es3api': True,
3813 }, 3812 },
3814 'Uniform4i': {'type': 'PUTXn', 'count': 4}, 3813 'Uniform4i': {'type': 'PUTXn', 'count': 4},
3815 'Uniform4f': {'type': 'PUTXn', 'count': 4}, 3814 'Uniform4f': {'type': 'PUTXn', 'count': 4},
3816 'Uniform4fv': { 3815 'Uniform4fv': {
3817 'type': 'PUTn', 3816 'type': 'PUTn',
3818 'count': 4, 3817 'count': 4,
3819 'decoder_func': 'DoUniform4fv', 3818 'decoder_func': 'DoUniform4fv',
3820 }, 3819 },
3821 'Uniform4iv': { 3820 'Uniform4iv': {
3822 'type': 'PUTn', 3821 'type': 'PUTn',
3823 'count': 4, 3822 'count': 4,
3824 'decoder_func': 'DoUniform4iv', 3823 'decoder_func': 'DoUniform4iv',
3825 }, 3824 },
3826 'Uniform4ui': { 3825 'Uniform4ui': {
3827 'type': 'PUTXn', 3826 'type': 'PUTXn',
3828 'count': 4, 3827 'count': 4,
3829 'unit_test': False, 3828 'unit_test': False,
3830 'unsafe': True, 3829 'es3api': True,
3831 }, 3830 },
3832 'Uniform4uiv': { 3831 'Uniform4uiv': {
3833 'type': 'PUTn', 3832 'type': 'PUTn',
3834 'count': 4, 3833 'count': 4,
3835 'decoder_func': 'DoUniform4uiv', 3834 'decoder_func': 'DoUniform4uiv',
3836 'unit_test': False, 3835 'unit_test': False,
3837 'unsafe': True, 3836 'es3api': True,
3838 }, 3837 },
3839 'UniformMatrix2fv': { 3838 'UniformMatrix2fv': {
3840 'type': 'PUTn', 3839 'type': 'PUTn',
3841 'count': 4, 3840 'count': 4,
3842 'decoder_func': 'DoUniformMatrix2fv', 3841 'decoder_func': 'DoUniformMatrix2fv',
3843 'unit_test': False, 3842 'unit_test': False,
3844 }, 3843 },
3845 'UniformMatrix2x3fv': { 3844 'UniformMatrix2x3fv': {
3846 'type': 'PUTn', 3845 'type': 'PUTn',
3847 'count': 6, 3846 'count': 6,
3848 'decoder_func': 'DoUniformMatrix2x3fv', 3847 'decoder_func': 'DoUniformMatrix2x3fv',
3849 'unsafe': True, 3848 'es3api': True,
3850 }, 3849 },
3851 'UniformMatrix2x4fv': { 3850 'UniformMatrix2x4fv': {
3852 'type': 'PUTn', 3851 'type': 'PUTn',
3853 'count': 8, 3852 'count': 8,
3854 'decoder_func': 'DoUniformMatrix2x4fv', 3853 'decoder_func': 'DoUniformMatrix2x4fv',
3855 'unsafe': True, 3854 'es3api': True,
3856 }, 3855 },
3857 'UniformMatrix3fv': { 3856 'UniformMatrix3fv': {
3858 'type': 'PUTn', 3857 'type': 'PUTn',
3859 'count': 9, 3858 'count': 9,
3860 'decoder_func': 'DoUniformMatrix3fv', 3859 'decoder_func': 'DoUniformMatrix3fv',
3861 'unit_test': False, 3860 'unit_test': False,
3862 }, 3861 },
3863 'UniformMatrix3x2fv': { 3862 'UniformMatrix3x2fv': {
3864 'type': 'PUTn', 3863 'type': 'PUTn',
3865 'count': 6, 3864 'count': 6,
3866 'decoder_func': 'DoUniformMatrix3x2fv', 3865 'decoder_func': 'DoUniformMatrix3x2fv',
3867 'unsafe': True, 3866 'es3api': True,
3868 }, 3867 },
3869 'UniformMatrix3x4fv': { 3868 'UniformMatrix3x4fv': {
3870 'type': 'PUTn', 3869 'type': 'PUTn',
3871 'count': 12, 3870 'count': 12,
3872 'decoder_func': 'DoUniformMatrix3x4fv', 3871 'decoder_func': 'DoUniformMatrix3x4fv',
3873 'unsafe': True, 3872 'es3api': True,
3874 }, 3873 },
3875 'UniformMatrix4fv': { 3874 'UniformMatrix4fv': {
3876 'type': 'PUTn', 3875 'type': 'PUTn',
3877 'count': 16, 3876 'count': 16,
3878 'decoder_func': 'DoUniformMatrix4fv', 3877 'decoder_func': 'DoUniformMatrix4fv',
3879 'unit_test': False, 3878 'unit_test': False,
3880 }, 3879 },
3881 'UniformMatrix4fvStreamTextureMatrixCHROMIUM': { 3880 'UniformMatrix4fvStreamTextureMatrixCHROMIUM': {
3882 'type': 'PUT', 3881 'type': 'PUT',
3883 'count': 16, 3882 'count': 16,
3884 'decoder_func': 'DoUniformMatrix4fvStreamTextureMatrixCHROMIUM', 3883 'decoder_func': 'DoUniformMatrix4fvStreamTextureMatrixCHROMIUM',
3885 'extension': "CHROMIUM_uniform_stream_texture_matrix", 3884 'extension': "CHROMIUM_uniform_stream_texture_matrix",
3886 'unit_test': False, 3885 'unit_test': False,
3887 'client_test': False, 3886 'client_test': False,
3888 }, 3887 },
3889 'UniformMatrix4x2fv': { 3888 'UniformMatrix4x2fv': {
3890 'type': 'PUTn', 3889 'type': 'PUTn',
3891 'count': 8, 3890 'count': 8,
3892 'decoder_func': 'DoUniformMatrix4x2fv', 3891 'decoder_func': 'DoUniformMatrix4x2fv',
3893 'unsafe': True, 3892 'es3api': True,
3894 }, 3893 },
3895 'UniformMatrix4x3fv': { 3894 'UniformMatrix4x3fv': {
3896 'type': 'PUTn', 3895 'type': 'PUTn',
3897 'count': 12, 3896 'count': 12,
3898 'decoder_func': 'DoUniformMatrix4x3fv', 3897 'decoder_func': 'DoUniformMatrix4x3fv',
3899 'unsafe': True, 3898 'es3api': True,
3900 }, 3899 },
3901 'UniformBlockBinding': { 3900 'UniformBlockBinding': {
3902 'type': 'Custom', 3901 'type': 'Custom',
3903 'impl_func': False, 3902 'impl_func': False,
3904 'unsafe': True, 3903 'es3api': True,
3905 }, 3904 },
3906 'UnmapBufferCHROMIUM': { 3905 'UnmapBufferCHROMIUM': {
3907 'type': 'NoCommand', 3906 'type': 'NoCommand',
3908 'extension': "CHROMIUM_pixel_transfer_buffer_object", 3907 'extension': "CHROMIUM_pixel_transfer_buffer_object",
3909 'trace_level': 1, 3908 'trace_level': 1,
3910 }, 3909 },
3911 'UnmapBufferSubDataCHROMIUM': { 3910 'UnmapBufferSubDataCHROMIUM': {
3912 'type': 'NoCommand', 3911 'type': 'NoCommand',
3913 'extension': 'CHROMIUM_map_sub', 3912 'extension': 'CHROMIUM_map_sub',
3914 'pepper_interface': 'ChromiumMapSub', 3913 'pepper_interface': 'ChromiumMapSub',
3915 'trace_level': 1, 3914 'trace_level': 1,
3916 }, 3915 },
3917 'UnmapBuffer': { 3916 'UnmapBuffer': {
3918 'type': 'Custom', 3917 'type': 'Custom',
3919 'unsafe': True, 3918 'es3api': True,
3920 'trace_level': 1, 3919 'trace_level': 1,
3921 }, 3920 },
3922 'UnmapTexSubImage2DCHROMIUM': { 3921 'UnmapTexSubImage2DCHROMIUM': {
3923 'type': 'NoCommand', 3922 'type': 'NoCommand',
3924 'extension': "CHROMIUM_sub_image", 3923 'extension': "CHROMIUM_sub_image",
3925 'pepper_interface': 'ChromiumMapSub', 3924 'pepper_interface': 'ChromiumMapSub',
3926 'trace_level': 1, 3925 'trace_level': 1,
3927 }, 3926 },
3928 'UseProgram': { 3927 'UseProgram': {
3929 'type': 'Bind', 3928 'type': 'Bind',
(...skipping 18 matching lines...) Expand all
3948 'count': 3, 3947 'count': 3,
3949 'decoder_func': 'DoVertexAttrib3fv', 3948 'decoder_func': 'DoVertexAttrib3fv',
3950 }, 3949 },
3951 'VertexAttrib4f': {'decoder_func': 'DoVertexAttrib4f'}, 3950 'VertexAttrib4f': {'decoder_func': 'DoVertexAttrib4f'},
3952 'VertexAttrib4fv': { 3951 'VertexAttrib4fv': {
3953 'type': 'PUT', 3952 'type': 'PUT',
3954 'count': 4, 3953 'count': 4,
3955 'decoder_func': 'DoVertexAttrib4fv', 3954 'decoder_func': 'DoVertexAttrib4fv',
3956 }, 3955 },
3957 'VertexAttribI4i': { 3956 'VertexAttribI4i': {
3958 'unsafe': True, 3957 'es3api': True,
3959 'decoder_func': 'DoVertexAttribI4i', 3958 'decoder_func': 'DoVertexAttribI4i',
3960 }, 3959 },
3961 'VertexAttribI4iv': { 3960 'VertexAttribI4iv': {
3962 'type': 'PUT', 3961 'type': 'PUT',
3963 'count': 4, 3962 'count': 4,
3964 'unsafe': True, 3963 'es3api': True,
3965 'decoder_func': 'DoVertexAttribI4iv', 3964 'decoder_func': 'DoVertexAttribI4iv',
3966 }, 3965 },
3967 'VertexAttribI4ui': { 3966 'VertexAttribI4ui': {
3968 'unsafe': True, 3967 'es3api': True,
3969 'decoder_func': 'DoVertexAttribI4ui', 3968 'decoder_func': 'DoVertexAttribI4ui',
3970 }, 3969 },
3971 'VertexAttribI4uiv': { 3970 'VertexAttribI4uiv': {
3972 'type': 'PUT', 3971 'type': 'PUT',
3973 'count': 4, 3972 'count': 4,
3974 'unsafe': True, 3973 'es3api': True,
3975 'decoder_func': 'DoVertexAttribI4uiv', 3974 'decoder_func': 'DoVertexAttribI4uiv',
3976 }, 3975 },
3977 'VertexAttribIPointer': { 3976 'VertexAttribIPointer': {
3978 'type': 'Custom', 3977 'type': 'Custom',
3979 'impl_func': False, 3978 'impl_func': False,
3980 'cmd_args': 'GLuint indx, GLintVertexAttribSize size, ' 3979 'cmd_args': 'GLuint indx, GLintVertexAttribSize size, '
3981 'GLenumVertexAttribIType type, GLsizei stride, ' 3980 'GLenumVertexAttribIType type, GLsizei stride, '
3982 'GLuint offset', 3981 'GLuint offset',
3983 'client_test': False, 3982 'client_test': False,
3984 'unsafe': True, 3983 'es3api': True,
3985 }, 3984 },
3986 'VertexAttribPointer': { 3985 'VertexAttribPointer': {
3987 'type': 'Custom', 3986 'type': 'Custom',
3988 'impl_func': False, 3987 'impl_func': False,
3989 'cmd_args': 'GLuint indx, GLintVertexAttribSize size, ' 3988 'cmd_args': 'GLuint indx, GLintVertexAttribSize size, '
3990 'GLenumVertexAttribType type, GLboolean normalized, ' 3989 'GLenumVertexAttribType type, GLboolean normalized, '
3991 'GLsizei stride, GLuint offset', 3990 'GLsizei stride, GLuint offset',
3992 'client_test': False, 3991 'client_test': False,
3993 }, 3992 },
3994 'WaitSync': { 3993 'WaitSync': {
3995 'type': 'Custom', 3994 'type': 'Custom',
3996 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, ' 3995 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, '
3997 'GLuint64 timeout', 3996 'GLuint64 timeout',
3998 'impl_func': False, 3997 'impl_func': False,
3999 'client_test': False, 3998 'client_test': False,
4000 'unsafe': True, 3999 'es3api': True,
4001 'trace_level': 1, 4000 'trace_level': 1,
4002 }, 4001 },
4003 'Scissor': { 4002 'Scissor': {
4004 'type': 'StateSet', 4003 'type': 'StateSet',
4005 'state': 'Scissor', 4004 'state': 'Scissor',
4006 }, 4005 },
4007 'Viewport': { 4006 'Viewport': {
4008 'decoder_func': 'DoViewport', 4007 'decoder_func': 'DoViewport',
4009 }, 4008 },
4010 'ResizeCHROMIUM': { 4009 'ResizeCHROMIUM': {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 'impl_func': False, 4118 'impl_func': False,
4120 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data', 4119 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data',
4121 'data_transfer_methods': ['shm'], 4120 'data_transfer_methods': ['shm'],
4122 'gl_test_func': 'glBeginQuery', 4121 'gl_test_func': 'glBeginQuery',
4123 'pepper_interface': 'Query', 4122 'pepper_interface': 'Query',
4124 'extension': "occlusion_query_EXT", 4123 'extension': "occlusion_query_EXT",
4125 }, 4124 },
4126 'BeginTransformFeedback': { 4125 'BeginTransformFeedback': {
4127 'decoder_func': 'DoBeginTransformFeedback', 4126 'decoder_func': 'DoBeginTransformFeedback',
4128 'unit_test': False, 4127 'unit_test': False,
4129 'unsafe': True, 4128 'es3api': True,
4130 }, 4129 },
4131 'EndQueryEXT': { 4130 'EndQueryEXT': {
4132 'type': 'Custom', 4131 'type': 'Custom',
4133 'impl_func': False, 4132 'impl_func': False,
4134 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count', 4133 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count',
4135 'gl_test_func': 'glEndnQuery', 4134 'gl_test_func': 'glEndnQuery',
4136 'client_test': False, 4135 'client_test': False,
4137 'pepper_interface': 'Query', 4136 'pepper_interface': 'Query',
4138 'extension': "occlusion_query_EXT", 4137 'extension': "occlusion_query_EXT",
4139 }, 4138 },
4140 'EndTransformFeedback': { 4139 'EndTransformFeedback': {
4141 'decoder_func': 'DoEndTransformFeedback', 4140 'decoder_func': 'DoEndTransformFeedback',
4142 'unit_test': False, 4141 'unit_test': False,
4143 'unsafe': True, 4142 'es3api': True,
4144 }, 4143 },
4145 'FlushDriverCachesCHROMIUM': { 4144 'FlushDriverCachesCHROMIUM': {
4146 'decoder_func': 'DoFlushDriverCachesCHROMIUM', 4145 'decoder_func': 'DoFlushDriverCachesCHROMIUM',
4147 'unit_test': False, 4146 'unit_test': False,
4148 'extension': True, 4147 'extension': True,
4149 'trace_level': 1, 4148 'trace_level': 1,
4150 }, 4149 },
4151 'GetQueryivEXT': { 4150 'GetQueryivEXT': {
4152 'type': 'NoCommand', 4151 'type': 'NoCommand',
4153 'gl_test_func': 'glGetQueryiv', 4152 'gl_test_func': 'glGetQueryiv',
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
4773 f.write((check.strip() + "\n") % { 4772 f.write((check.strip() + "\n") % {
4774 'cmd_name': func.name, 4773 'cmd_name': func.name,
4775 'field_name': name, 4774 'field_name': name,
4776 'offset': offset, 4775 'offset': offset,
4777 }) 4776 })
4778 offset += _SIZE_OF_UINT32 4777 offset += _SIZE_OF_UINT32
4779 f.write("\n") 4778 f.write("\n")
4780 4779
4781 def WriteHandlerImplementation(self, func, f): 4780 def WriteHandlerImplementation(self, func, f):
4782 """Writes the handler implementation for this command.""" 4781 """Writes the handler implementation for this command."""
4783 if func.IsUnsafe() and func.GetInfo('id_mapping'): 4782 if func.IsES3API() and func.GetInfo('id_mapping'):
4784 code_no_gen = """ if (!group_->Get%(type)sServiceId( 4783 code_no_gen = """ if (!group_->Get%(type)sServiceId(
4785 %(var)s, &%(service_var)s)) { 4784 %(var)s, &%(service_var)s)) {
4786 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "%(func)s", "invalid %(var)s id"); 4785 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "%(func)s", "invalid %(var)s id");
4787 return error::kNoError; 4786 return error::kNoError;
4788 } 4787 }
4789 """ 4788 """
4790 code_gen = """ if (!group_->Get%(type)sServiceId( 4789 code_gen = """ if (!group_->Get%(type)sServiceId(
4791 %(var)s, &%(service_var)s)) { 4790 %(var)s, &%(service_var)s)) {
4792 if (!group_->bind_generates_resource()) { 4791 if (!group_->bind_generates_resource()) {
4793 LOCAL_SET_GL_ERROR( 4792 LOCAL_SET_GL_ERROR(
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
4872 def WriteImmediateFormatTest(self, func, f): 4871 def WriteImmediateFormatTest(self, func, f):
4873 """Writes a format test for an immediate version of a command.""" 4872 """Writes a format test for an immediate version of a command."""
4874 pass 4873 pass
4875 4874
4876 def WriteGetDataSizeCode(self, func, f): 4875 def WriteGetDataSizeCode(self, func, f):
4877 """Writes the code to set data_size used in validation""" 4876 """Writes the code to set data_size used in validation"""
4878 pass 4877 pass
4879 4878
4880 def __WriteIdMapping(self, func, f): 4879 def __WriteIdMapping(self, func, f):
4881 """Writes client side / service side ID mapping.""" 4880 """Writes client side / service side ID mapping."""
4882 if not func.IsUnsafe() or not func.GetInfo('id_mapping'): 4881 if not func.IsES3API() or not func.GetInfo('id_mapping'):
4883 return 4882 return
4884 for id_type in func.GetInfo('id_mapping'): 4883 for id_type in func.GetInfo('id_mapping'):
4885 f.write(" group_->Get%sServiceId(%s, &%s);\n" % 4884 f.write(" group_->Get%sServiceId(%s, &%s);\n" %
4886 (id_type, id_type.lower(), id_type.lower())) 4885 (id_type, id_type.lower(), id_type.lower()))
4887 4886
4888 def WriteImmediateHandlerImplementation (self, func, f): 4887 def WriteImmediateHandlerImplementation (self, func, f):
4889 """Writes the handler impl for the immediate version of a command.""" 4888 """Writes the handler impl for the immediate version of a command."""
4890 self.__WriteIdMapping(func, f) 4889 self.__WriteIdMapping(func, f)
4891 f.write(" %s(%s);\n" % 4890 f.write(" %s(%s);\n" %
4892 (func.GetGLFunctionName(), func.MakeOriginalArgString(""))) 4891 (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
4893 4892
4894 def WriteBucketHandlerImplementation (self, func, f): 4893 def WriteBucketHandlerImplementation (self, func, f):
4895 """Writes the handler impl for the bucket version of a command.""" 4894 """Writes the handler impl for the bucket version of a command."""
4896 self.__WriteIdMapping(func, f) 4895 self.__WriteIdMapping(func, f)
4897 f.write(" %s(%s);\n" % 4896 f.write(" %s(%s);\n" %
4898 (func.GetGLFunctionName(), func.MakeOriginalArgString(""))) 4897 (func.GetGLFunctionName(), func.MakeOriginalArgString("")))
4899 4898
4900 def WriteServiceHandlerFunctionHeader(self, func, f): 4899 def WriteServiceHandlerFunctionHeader(self, func, f):
4901 """Writes function header for service implementation handlers.""" 4900 """Writes function header for service implementation handlers."""
4902 f.write("""error::Error GLES2DecoderImpl::Handle%(name)s( 4901 f.write("""error::Error GLES2DecoderImpl::Handle%(name)s(
4903 uint32_t immediate_data_size, const volatile void* cmd_data) { 4902 uint32_t immediate_data_size, const volatile void* cmd_data) {
4904 """ % {'name': func.name}) 4903 """ % {'name': func.name})
4905 if func.IsUnsafe(): 4904 if func.IsES3API():
4906 f.write("""if (!unsafe_es3_apis_enabled()) 4905 f.write("""if (!es3_apis_enabled())
4907 return error::kUnknownCommand; 4906 return error::kUnknownCommand;
4908 """) 4907 """)
4909 if func.GetCmdArgs(): 4908 if func.GetCmdArgs():
4910 f.write("""const volatile gles2::cmds::%(name)s& c = 4909 f.write("""const volatile gles2::cmds::%(name)s& c =
4911 *static_cast<const volatile gles2::cmds::%(name)s*>(cmd_data); 4910 *static_cast<const volatile gles2::cmds::%(name)s*>(cmd_data);
4912 """ % {'name': func.name}) 4911 """ % {'name': func.name})
4913 4912
4914 def WriteServiceHandlerArgGetCode(self, func, f): 4913 def WriteServiceHandlerArgGetCode(self, func, f):
4915 """Writes the argument unpack code for service handlers.""" 4914 """Writes the argument unpack code for service handlers."""
4916 if len(func.GetOriginalArgs()) > 0: 4915 if len(func.GetOriginalArgs()) > 0:
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
5062 for extra in extras: 5061 for extra in extras:
5063 vars.update(extra) 5062 vars.update(extra)
5064 old_test = "" 5063 old_test = ""
5065 while (old_test != test): 5064 while (old_test != test):
5066 old_test = test 5065 old_test = test
5067 test = test % vars 5066 test = test % vars
5068 f.write(test % vars) 5067 f.write(test % vars)
5069 5068
5070 def WriteInvalidUnitTest(self, func, f, test, *extras): 5069 def WriteInvalidUnitTest(self, func, f, test, *extras):
5071 """Writes an invalid unit test for the service implementation.""" 5070 """Writes an invalid unit test for the service implementation."""
5072 if func.IsUnsafe(): 5071 if func.IsES3API():
5073 return 5072 return
5074 for invalid_arg_index, invalid_arg in enumerate(func.GetOriginalArgs()): 5073 for invalid_arg_index, invalid_arg in enumerate(func.GetOriginalArgs()):
5075 # Service implementation does not test constants, as they are not part of 5074 # Service implementation does not test constants, as they are not part of
5076 # the call in the service side. 5075 # the call in the service side.
5077 if invalid_arg.IsConstant(): 5076 if invalid_arg.IsConstant():
5078 continue 5077 continue
5079 5078
5080 num_invalid_values = invalid_arg.GetNumInvalidValues(func) 5079 num_invalid_values = invalid_arg.GetNumInvalidValues(func)
5081 for value_index in range(0, num_invalid_values): 5080 for value_index in range(0, num_invalid_values):
5082 arg_strings = [] 5081 arg_strings = []
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 SpecializedSetup<cmds::%(name)s, 0>(true); 5130 SpecializedSetup<cmds::%(name)s, 0>(true);
5132 cmds::%(name)s cmd; 5131 cmds::%(name)s cmd;
5133 cmd.Init(%(args)s);""" 5132 cmd.Init(%(args)s);"""
5134 else: 5133 else:
5135 valid_test = """ 5134 valid_test = """
5136 TEST_P(%(test_name)s, %(name)sValidArgs) { 5135 TEST_P(%(test_name)s, %(name)sValidArgs) {
5137 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); 5136 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
5138 SpecializedSetup<cmds::%(name)s, 0>(true); 5137 SpecializedSetup<cmds::%(name)s, 0>(true);
5139 cmds::%(name)s cmd; 5138 cmds::%(name)s cmd;
5140 cmd.Init(%(args)s);""" 5139 cmd.Init(%(args)s);"""
5141 if func.IsUnsafe(): 5140 if func.IsES3API():
5142 valid_test += """ 5141 valid_test += """
5143 decoder_->set_unsafe_es3_apis_enabled(true); 5142 decoder_->set_es3_apis_enabled(true);
5144 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5143 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5145 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5144 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5146 decoder_->set_unsafe_es3_apis_enabled(false); 5145 decoder_->set_es3_apis_enabled(false);
5147 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 5146 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
5148 } 5147 }
5149 """ 5148 """
5150 else: 5149 else:
5151 valid_test += """ 5150 valid_test += """
5152 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5151 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5153 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5152 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5154 } 5153 }
5155 """ 5154 """
5156 self.WriteValidUnitTest(func, f, valid_test, *extras) 5155 self.WriteValidUnitTest(func, f, valid_test, *extras)
5157 5156
5158 if not func.IsUnsafe(): 5157 if not func.IsES3API():
5159 invalid_test = """ 5158 invalid_test = """
5160 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { 5159 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
5161 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); 5160 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
5162 SpecializedSetup<cmds::%(name)s, 0>(false); 5161 SpecializedSetup<cmds::%(name)s, 0>(false);
5163 cmds::%(name)s cmd; 5162 cmds::%(name)s cmd;
5164 cmd.Init(%(args)s); 5163 cmd.Init(%(args)s);
5165 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s 5164 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
5166 } 5165 }
5167 """ 5166 """
5168 self.WriteInvalidUnitTest(func, f, invalid_test, *extras) 5167 self.WriteInvalidUnitTest(func, f, invalid_test, *extras)
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
5796 def WriteServiceUnitTest(self, func, f, *extras): 5795 def WriteServiceUnitTest(self, func, f, *extras):
5797 """Overrriden from TypeHandler.""" 5796 """Overrriden from TypeHandler."""
5798 5797
5799 if len(func.GetOriginalArgs()) == 1: 5798 if len(func.GetOriginalArgs()) == 1:
5800 valid_test = """ 5799 valid_test = """
5801 TEST_P(%(test_name)s, %(name)sValidArgs) { 5800 TEST_P(%(test_name)s, %(name)sValidArgs) {
5802 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); 5801 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
5803 SpecializedSetup<cmds::%(name)s, 0>(true); 5802 SpecializedSetup<cmds::%(name)s, 0>(true);
5804 cmds::%(name)s cmd; 5803 cmds::%(name)s cmd;
5805 cmd.Init(%(args)s);""" 5804 cmd.Init(%(args)s);"""
5806 if func.IsUnsafe(): 5805 if func.IsES3API():
5807 valid_test += """ 5806 valid_test += """
5808 decoder_->set_unsafe_es3_apis_enabled(true); 5807 decoder_->set_es3_apis_enabled(true);
5809 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5808 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5810 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5809 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5811 decoder_->set_unsafe_es3_apis_enabled(false); 5810 decoder_->set_es3_apis_enabled(false);
5812 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 5811 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
5813 } 5812 }
5814 """ 5813 """
5815 else: 5814 else:
5816 valid_test += """ 5815 valid_test += """
5817 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5816 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5818 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5817 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5819 } 5818 }
5820 """ 5819 """
5821 if func.GetInfo("gen_func"): 5820 if func.GetInfo("gen_func"):
(...skipping 14 matching lines...) Expand all
5836 'resource_type': func.GetOriginalArgs()[0].resource_type, 5835 'resource_type': func.GetOriginalArgs()[0].resource_type,
5837 'gl_gen_func_name': func.GetInfo("gen_func"), 5836 'gl_gen_func_name': func.GetInfo("gen_func"),
5838 }, *extras) 5837 }, *extras)
5839 else: 5838 else:
5840 valid_test = """ 5839 valid_test = """
5841 TEST_P(%(test_name)s, %(name)sValidArgs) { 5840 TEST_P(%(test_name)s, %(name)sValidArgs) {
5842 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); 5841 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
5843 SpecializedSetup<cmds::%(name)s, 0>(true); 5842 SpecializedSetup<cmds::%(name)s, 0>(true);
5844 cmds::%(name)s cmd; 5843 cmds::%(name)s cmd;
5845 cmd.Init(%(args)s);""" 5844 cmd.Init(%(args)s);"""
5846 if func.IsUnsafe(): 5845 if func.IsES3API():
5847 valid_test += """ 5846 valid_test += """
5848 decoder_->set_unsafe_es3_apis_enabled(true); 5847 decoder_->set_es3_apis_enabled(true);
5849 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5848 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5850 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5849 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5851 decoder_->set_unsafe_es3_apis_enabled(false); 5850 decoder_->set_es3_apis_enabled(false);
5852 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 5851 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
5853 } 5852 }
5854 """ 5853 """
5855 else: 5854 else:
5856 valid_test += """ 5855 valid_test += """
5857 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5856 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5858 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5857 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5859 } 5858 }
5860 """ 5859 """
5861 if func.GetInfo("gen_func"): 5860 if func.GetInfo("gen_func"):
5862 valid_test += """ 5861 valid_test += """
5863 TEST_P(%(test_name)s, %(name)sValidArgsNewId) { 5862 TEST_P(%(test_name)s, %(name)sValidArgsNewId) {
5864 EXPECT_CALL(*gl_, 5863 EXPECT_CALL(*gl_,
5865 %(gl_func_name)s(%(gl_args_with_new_id)s)); 5864 %(gl_func_name)s(%(gl_args_with_new_id)s));
5866 EXPECT_CALL(*gl_, %(gl_gen_func_name)s(1, _)) 5865 EXPECT_CALL(*gl_, %(gl_gen_func_name)s(1, _))
5867 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 5866 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
5868 SpecializedSetup<cmds::%(name)s, 0>(true); 5867 SpecializedSetup<cmds::%(name)s, 0>(true);
5869 cmds::%(name)s cmd; 5868 cmds::%(name)s cmd;
5870 cmd.Init(%(args_with_new_id)s);""" 5869 cmd.Init(%(args_with_new_id)s);"""
5871 if func.IsUnsafe(): 5870 if func.IsES3API():
5872 valid_test += """ 5871 valid_test += """
5873 decoder_->set_unsafe_es3_apis_enabled(true); 5872 decoder_->set_es3_apis_enabled(true);
5874 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5873 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5875 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5874 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5876 EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL); 5875 EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL);
5877 decoder_->set_unsafe_es3_apis_enabled(false); 5876 decoder_->set_es3_apis_enabled(false);
5878 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 5877 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
5879 } 5878 }
5880 """ 5879 """
5881 else: 5880 else:
5882 valid_test += """ 5881 valid_test += """
5883 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 5882 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
5884 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 5883 EXPECT_EQ(GL_NO_ERROR, GetGLError());
5885 EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL); 5884 EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL);
5886 } 5885 }
5887 """ 5886 """
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
5953 code = """ 5952 code = """
5954 TEST_F(GLES2ImplementationTest, %(name)s) { 5953 TEST_F(GLES2ImplementationTest, %(name)s) {
5955 struct Cmds { 5954 struct Cmds {
5956 cmds::%(name)s cmd; 5955 cmds::%(name)s cmd;
5957 }; 5956 };
5958 Cmds expected; 5957 Cmds expected;
5959 expected.cmd.Init(%(cmd_args)s); 5958 expected.cmd.Init(%(cmd_args)s);
5960 5959
5961 gl_->%(name)s(%(args)s); 5960 gl_->%(name)s(%(args)s);
5962 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));""" 5961 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));"""
5963 if not func.IsUnsafe(): 5962 if not func.IsES3API():
5964 code += """ 5963 code += """
5965 ClearCommands(); 5964 ClearCommands();
5966 gl_->%(name)s(%(args)s); 5965 gl_->%(name)s(%(args)s);
5967 EXPECT_TRUE(NoCommandsWritten());""" 5966 EXPECT_TRUE(NoCommandsWritten());"""
5968 code += """ 5967 code += """
5969 } 5968 }
5970 """ 5969 """
5971 cmd_arg_strings = [ 5970 cmd_arg_strings = [
5972 arg.GetValidClientSideCmdArg(func) for arg in func.GetCmdArgs() 5971 arg.GetValidClientSideCmdArg(func) for arg in func.GetCmdArgs()
5973 ] 5972 ]
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
6092 6091
6093 def WriteImmediateServiceUnitTest(self, func, f, *extras): 6092 def WriteImmediateServiceUnitTest(self, func, f, *extras):
6094 """Overrriden from TypeHandler.""" 6093 """Overrriden from TypeHandler."""
6095 valid_test = """ 6094 valid_test = """
6096 TEST_P(%(test_name)s, %(name)sValidArgs) { 6095 TEST_P(%(test_name)s, %(name)sValidArgs) {
6097 EXPECT_CALL(*gl_, %(gl_func_name)s(1, _)) 6096 EXPECT_CALL(*gl_, %(gl_func_name)s(1, _))
6098 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 6097 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
6099 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>(); 6098 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
6100 GLuint temp = kNewClientId; 6099 GLuint temp = kNewClientId;
6101 SpecializedSetup<cmds::%(name)s, 0>(true);""" 6100 SpecializedSetup<cmds::%(name)s, 0>(true);"""
6102 if func.IsUnsafe(): 6101 if func.IsES3API():
6103 valid_test += """ 6102 valid_test += """
6104 decoder_->set_unsafe_es3_apis_enabled(true);""" 6103 decoder_->set_es3_apis_enabled(true);"""
6105 valid_test += """ 6104 valid_test += """
6106 cmd->Init(1, &temp); 6105 cmd->Init(1, &temp);
6107 EXPECT_EQ(error::kNoError, 6106 EXPECT_EQ(error::kNoError,
6108 ExecuteImmediateCmd(*cmd, sizeof(temp))); 6107 ExecuteImmediateCmd(*cmd, sizeof(temp)));
6109 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 6108 EXPECT_EQ(GL_NO_ERROR, GetGLError());
6110 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) != NULL); 6109 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) != NULL);
6111 } 6110 }
6112 """ 6111 """
6113 self.WriteValidUnitTest(func, f, valid_test, { 6112 self.WriteValidUnitTest(func, f, valid_test, {
6114 'resource_name': func.GetInfo('resource_type'), 6113 'resource_name': func.GetInfo('resource_type'),
6115 }, *extras) 6114 }, *extras)
6116 duplicate_id_test = """ 6115 duplicate_id_test = """
6117 TEST_P(%(test_name)s, %(name)sDuplicateOrNullIds) { 6116 TEST_P(%(test_name)s, %(name)sDuplicateOrNullIds) {
6118 EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0); 6117 EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0);
6119 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>(); 6118 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
6120 GLuint temp[3] = {kNewClientId, kNewClientId + 1, kNewClientId}; 6119 GLuint temp[3] = {kNewClientId, kNewClientId + 1, kNewClientId};
6121 SpecializedSetup<cmds::%(name)s, 1>(true);""" 6120 SpecializedSetup<cmds::%(name)s, 1>(true);"""
6122 if func.IsUnsafe(): 6121 if func.IsES3API():
6123 duplicate_id_test += """ 6122 duplicate_id_test += """
6124 decoder_->set_unsafe_es3_apis_enabled(true);""" 6123 decoder_->set_es3_apis_enabled(true);"""
6125 duplicate_id_test += """ 6124 duplicate_id_test += """
6126 cmd->Init(3, temp); 6125 cmd->Init(3, temp);
6127 EXPECT_EQ(error::kInvalidArguments, 6126 EXPECT_EQ(error::kInvalidArguments,
6128 ExecuteImmediateCmd(*cmd, sizeof(temp))); 6127 ExecuteImmediateCmd(*cmd, sizeof(temp)));
6129 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL); 6128 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL);
6130 EXPECT_TRUE(Get%(resource_name)s(kNewClientId + 1) == NULL); 6129 EXPECT_TRUE(Get%(resource_name)s(kNewClientId + 1) == NULL);
6131 GLuint null_id[2] = {kNewClientId, 0}; 6130 GLuint null_id[2] = {kNewClientId, 0};
6132 cmd->Init(2, null_id); 6131 cmd->Init(2, null_id);
6133 EXPECT_EQ(error::kInvalidArguments, 6132 EXPECT_EQ(error::kInvalidArguments,
6134 ExecuteImmediateCmd(*cmd, sizeof(temp))); 6133 ExecuteImmediateCmd(*cmd, sizeof(temp)));
6135 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL); 6134 EXPECT_TRUE(Get%(resource_name)s(kNewClientId) == NULL);
6136 } 6135 }
6137 """ 6136 """
6138 self.WriteValidUnitTest(func, f, duplicate_id_test, { 6137 self.WriteValidUnitTest(func, f, duplicate_id_test, {
6139 'resource_name': func.GetInfo('resource_type'), 6138 'resource_name': func.GetInfo('resource_type'),
6140 }, *extras) 6139 }, *extras)
6141 invalid_test = """ 6140 invalid_test = """
6142 TEST_P(%(test_name)s, %(name)sInvalidArgs) { 6141 TEST_P(%(test_name)s, %(name)sInvalidArgs) {
6143 EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0); 6142 EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0);
6144 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>(); 6143 cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
6145 SpecializedSetup<cmds::%(name)s, 0>(false); 6144 SpecializedSetup<cmds::%(name)s, 0>(false);
6146 cmd->Init(1, &client_%(resource_name)s_id_);""" 6145 cmd->Init(1, &client_%(resource_name)s_id_);"""
6147 if func.IsUnsafe(): 6146 if func.IsES3API():
6148 invalid_test += """ 6147 invalid_test += """
6149 decoder_->set_unsafe_es3_apis_enabled(true); 6148 decoder_->set_es3_apis_enabled(true);
6150 EXPECT_EQ(error::kInvalidArguments, 6149 EXPECT_EQ(error::kInvalidArguments,
6151 ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_))); 6150 ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_)));
6152 decoder_->set_unsafe_es3_apis_enabled(false); 6151 decoder_->set_es3_apis_enabled(false);
6153 } 6152 }
6154 """ 6153 """
6155 else: 6154 else:
6156 invalid_test += """ 6155 invalid_test += """
6157 EXPECT_EQ(error::kInvalidArguments, 6156 EXPECT_EQ(error::kInvalidArguments,
6158 ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_))); 6157 ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_)));
6159 } 6158 }
6160 """ 6159 """
6161 self.WriteValidUnitTest(func, f, invalid_test, { 6160 self.WriteValidUnitTest(func, f, invalid_test, {
6162 'resource_name': func.GetInfo('resource_type').lower(), 6161 'resource_name': func.GetInfo('resource_type').lower(),
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
6269 6268
6270 def WriteServiceUnitTest(self, func, f, *extras): 6269 def WriteServiceUnitTest(self, func, f, *extras):
6271 """Overrriden from TypeHandler.""" 6270 """Overrriden from TypeHandler."""
6272 valid_test = """ 6271 valid_test = """
6273 TEST_P(%(test_name)s, %(name)sValidArgs) { 6272 TEST_P(%(test_name)s, %(name)sValidArgs) {
6274 %(id_type_cast)sEXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) 6273 %(id_type_cast)sEXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s))
6275 .WillOnce(Return(%(const_service_id)s)); 6274 .WillOnce(Return(%(const_service_id)s));
6276 SpecializedSetup<cmds::%(name)s, 0>(true); 6275 SpecializedSetup<cmds::%(name)s, 0>(true);
6277 cmds::%(name)s cmd; 6276 cmds::%(name)s cmd;
6278 cmd.Init(%(args)s%(comma)skNewClientId);""" 6277 cmd.Init(%(args)s%(comma)skNewClientId);"""
6279 if func.IsUnsafe(): 6278 if func.IsES3API():
6280 valid_test += """ 6279 valid_test += """
6281 decoder_->set_unsafe_es3_apis_enabled(true);""" 6280 decoder_->set_es3_apis_enabled(true);"""
6282 valid_test += """ 6281 valid_test += """
6283 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 6282 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
6284 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 6283 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
6285 if func.IsUnsafe(): 6284 if func.IsES3API():
6286 valid_test += """ 6285 valid_test += """
6287 %(return_type)s service_id = 0; 6286 %(return_type)s service_id = 0;
6288 EXPECT_TRUE(Get%(resource_type)sServiceId(kNewClientId, &service_id)); 6287 EXPECT_TRUE(Get%(resource_type)sServiceId(kNewClientId, &service_id));
6289 EXPECT_EQ(%(const_service_id)s, service_id); 6288 EXPECT_EQ(%(const_service_id)s, service_id);
6290 decoder_->set_unsafe_es3_apis_enabled(false); 6289 decoder_->set_es3_apis_enabled(false);
6291 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 6290 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
6292 } 6291 }
6293 """ 6292 """
6294 else: 6293 else:
6295 valid_test += """ 6294 valid_test += """
6296 EXPECT_TRUE(Get%(resource_type)s(kNewClientId)); 6295 EXPECT_TRUE(Get%(resource_type)s(kNewClientId));
6297 } 6296 }
6298 """ 6297 """
6299 comma = "" 6298 comma = ""
6300 cmd_arg_count = 0 6299 cmd_arg_count = 0
(...skipping 24 matching lines...) Expand all
6325 cmd.Init(%(args)s%(comma)skNewClientId); 6324 cmd.Init(%(args)s%(comma)skNewClientId);
6326 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s 6325 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s
6327 } 6326 }
6328 """ 6327 """
6329 self.WriteInvalidUnitTest(func, f, invalid_test, { 6328 self.WriteInvalidUnitTest(func, f, invalid_test, {
6330 'comma': comma, 6329 'comma': comma,
6331 }, *extras) 6330 }, *extras)
6332 6331
6333 def WriteHandlerImplementation (self, func, f): 6332 def WriteHandlerImplementation (self, func, f):
6334 """Overrriden from TypeHandler.""" 6333 """Overrriden from TypeHandler."""
6335 if func.IsUnsafe(): 6334 if func.IsES3API():
6336 code = """ uint32_t client_id = c.client_id; 6335 code = """ uint32_t client_id = c.client_id;
6337 %(return_type)s service_id = 0; 6336 %(return_type)s service_id = 0;
6338 if (group_->Get%(resource_name)sServiceId(client_id, &service_id)) { 6337 if (group_->Get%(resource_name)sServiceId(client_id, &service_id)) {
6339 return error::kInvalidArguments; 6338 return error::kInvalidArguments;
6340 } 6339 }
6341 service_id = %(gl_func_name)s(%(gl_args)s); 6340 service_id = %(gl_func_name)s(%(gl_args)s);
6342 if (service_id) { 6341 if (service_id) {
6343 group_->Add%(resource_name)sId(client_id, service_id); 6342 group_->Add%(resource_name)sId(client_id, service_id);
6344 } 6343 }
6345 """ 6344 """
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
6391 6390
6392 def WritePassthroughServiceImplementation(self, func, f): 6391 def WritePassthroughServiceImplementation(self, func, f):
6393 """Overrriden from TypeHandler.""" 6392 """Overrriden from TypeHandler."""
6394 pass 6393 pass
6395 6394
6396 class DeleteHandler(TypeHandler): 6395 class DeleteHandler(TypeHandler):
6397 """Handler for glDelete___ single resource type functions.""" 6396 """Handler for glDelete___ single resource type functions."""
6398 6397
6399 def WriteServiceImplementation(self, func, f): 6398 def WriteServiceImplementation(self, func, f):
6400 """Overrriden from TypeHandler.""" 6399 """Overrriden from TypeHandler."""
6401 if func.IsUnsafe(): 6400 if func.IsES3API():
6402 TypeHandler.WriteServiceImplementation(self, func, f) 6401 TypeHandler.WriteServiceImplementation(self, func, f)
6403 # HandleDeleteShader and HandleDeleteProgram are manually written. 6402 # HandleDeleteShader and HandleDeleteProgram are manually written.
6404 pass 6403 pass
6405 6404
6406 def WriteGLES2Implementation(self, func, f): 6405 def WriteGLES2Implementation(self, func, f):
6407 """Overrriden from TypeHandler.""" 6406 """Overrriden from TypeHandler."""
6408 f.write("%s GLES2Implementation::%s(%s) {\n" % 6407 f.write("%s GLES2Implementation::%s(%s) {\n" %
6409 (func.return_type, func.original_name, 6408 (func.return_type, func.original_name,
6410 func.MakeTypedOriginalArgString(""))) 6409 func.MakeTypedOriginalArgString("")))
6411 f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n") 6410 f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
6498 """Overrriden from TypeHandler.""" 6497 """Overrriden from TypeHandler."""
6499 valid_test = """ 6498 valid_test = """
6500 TEST_P(%(test_name)s, %(name)sValidArgs) { 6499 TEST_P(%(test_name)s, %(name)sValidArgs) {
6501 EXPECT_CALL( 6500 EXPECT_CALL(
6502 *gl_, 6501 *gl_,
6503 %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId))) 6502 %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId)))
6504 .Times(1); 6503 .Times(1);
6505 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>(); 6504 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
6506 SpecializedSetup<cmds::%(name)s, 0>(true); 6505 SpecializedSetup<cmds::%(name)s, 0>(true);
6507 cmd.Init(1, &client_%(resource_name)s_id_);""" 6506 cmd.Init(1, &client_%(resource_name)s_id_);"""
6508 if func.IsUnsafe(): 6507 if func.IsES3API():
6509 valid_test += """ 6508 valid_test += """
6510 decoder_->set_unsafe_es3_apis_enabled(true);""" 6509 decoder_->set_es3_apis_enabled(true);"""
6511 valid_test += """ 6510 valid_test += """
6512 EXPECT_EQ(error::kNoError, 6511 EXPECT_EQ(error::kNoError,
6513 ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_))); 6512 ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_)));
6514 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 6513 EXPECT_EQ(GL_NO_ERROR, GetGLError());
6515 EXPECT_TRUE( 6514 EXPECT_TRUE(
6516 Get%(upper_resource_name)s(client_%(resource_name)s_id_) == NULL); 6515 Get%(upper_resource_name)s(client_%(resource_name)s_id_) == NULL);
6517 } 6516 }
6518 """ 6517 """
6519 self.WriteValidUnitTest(func, f, valid_test, { 6518 self.WriteValidUnitTest(func, f, valid_test, {
6520 'resource_name': func.GetInfo('resource_type').lower(), 6519 'resource_name': func.GetInfo('resource_type').lower(),
6521 'upper_resource_name': func.GetInfo('resource_type'), 6520 'upper_resource_name': func.GetInfo('resource_type'),
6522 }, *extras) 6521 }, *extras)
6523 invalid_test = """ 6522 invalid_test = """
6524 TEST_P(%(test_name)s, %(name)sInvalidArgs) { 6523 TEST_P(%(test_name)s, %(name)sInvalidArgs) {
6525 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>(); 6524 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
6526 SpecializedSetup<cmds::%(name)s, 0>(false); 6525 SpecializedSetup<cmds::%(name)s, 0>(false);
6527 GLuint temp = kInvalidClientId; 6526 GLuint temp = kInvalidClientId;
6528 cmd.Init(1, &temp);""" 6527 cmd.Init(1, &temp);"""
6529 if func.IsUnsafe(): 6528 if func.IsES3API():
6530 invalid_test += """ 6529 invalid_test += """
6531 decoder_->set_unsafe_es3_apis_enabled(true); 6530 decoder_->set_es3_apis_enabled(true);
6532 EXPECT_EQ(error::kNoError, 6531 EXPECT_EQ(error::kNoError,
6533 ExecuteImmediateCmd(cmd, sizeof(temp))); 6532 ExecuteImmediateCmd(cmd, sizeof(temp)));
6534 decoder_->set_unsafe_es3_apis_enabled(false); 6533 decoder_->set_es3_apis_enabled(false);
6535 EXPECT_EQ(error::kUnknownCommand, 6534 EXPECT_EQ(error::kUnknownCommand,
6536 ExecuteImmediateCmd(cmd, sizeof(temp))); 6535 ExecuteImmediateCmd(cmd, sizeof(temp)));
6537 } 6536 }
6538 """ 6537 """
6539 else: 6538 else:
6540 invalid_test += """ 6539 invalid_test += """
6541 EXPECT_EQ(error::kNoError, 6540 EXPECT_EQ(error::kNoError,
6542 ExecuteImmediateCmd(cmd, sizeof(temp))); 6541 ExecuteImmediateCmd(cmd, sizeof(temp)));
6543 } 6542 }
6544 """ 6543 """
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
6909 TEST_P(%(test_name)s, %(name)sValidArgs) { 6908 TEST_P(%(test_name)s, %(name)sValidArgs) {
6910 EXPECT_CALL(*gl_, GetError()) 6909 EXPECT_CALL(*gl_, GetError())
6911 .WillRepeatedly(Return(GL_NO_ERROR)); 6910 .WillRepeatedly(Return(GL_NO_ERROR));
6912 SpecializedSetup<cmds::%(name)s, 0>(true); 6911 SpecializedSetup<cmds::%(name)s, 0>(true);
6913 typedef cmds::%(name)s::Result Result; 6912 typedef cmds::%(name)s::Result Result;
6914 Result* result = static_cast<Result*>(shared_memory_address_); 6913 Result* result = static_cast<Result*>(shared_memory_address_);
6915 EXPECT_CALL(*gl_, %(gl_func_name)s(%(local_gl_args)s)); 6914 EXPECT_CALL(*gl_, %(gl_func_name)s(%(local_gl_args)s));
6916 result->size = 0; 6915 result->size = 0;
6917 cmds::%(name)s cmd; 6916 cmds::%(name)s cmd;
6918 cmd.Init(%(cmd_args)s);""" 6917 cmd.Init(%(cmd_args)s);"""
6919 if func.IsUnsafe(): 6918 if func.IsES3API():
6920 valid_test += """ 6919 valid_test += """
6921 decoder_->set_unsafe_es3_apis_enabled(true);""" 6920 decoder_->set_es3_apis_enabled(true);"""
6922 valid_test += """ 6921 valid_test += """
6923 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 6922 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
6924 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( 6923 EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(
6925 %(valid_pname)s), 6924 %(valid_pname)s),
6926 result->GetNumResults()); 6925 result->GetNumResults());
6927 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 6926 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
6928 if func.IsUnsafe(): 6927 if func.IsES3API():
6929 valid_test += """ 6928 valid_test += """
6930 decoder_->set_unsafe_es3_apis_enabled(false); 6929 decoder_->set_es3_apis_enabled(false);
6931 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));""" 6930 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
6932 valid_test += """ 6931 valid_test += """
6933 } 6932 }
6934 """ 6933 """
6935 gl_arg_strings = [] 6934 gl_arg_strings = []
6936 cmd_arg_strings = [] 6935 cmd_arg_strings = []
6937 valid_pname = '' 6936 valid_pname = ''
6938 for arg in func.GetOriginalArgs()[:-1]: 6937 for arg in func.GetOriginalArgs()[:-1]:
6939 if arg.name == 'length': 6938 if arg.name == 'length':
6940 gl_arg_value = 'nullptr' 6939 gl_arg_value = 'nullptr'
(...skipping 20 matching lines...) Expand all
6961 gl_arg_strings.append("result->GetData()") 6960 gl_arg_strings.append("result->GetData()")
6962 cmd_arg_strings.append("shared_memory_id_") 6961 cmd_arg_strings.append("shared_memory_id_")
6963 cmd_arg_strings.append("shared_memory_offset_") 6962 cmd_arg_strings.append("shared_memory_offset_")
6964 6963
6965 self.WriteValidUnitTest(func, f, valid_test, { 6964 self.WriteValidUnitTest(func, f, valid_test, {
6966 'local_gl_args': ", ".join(gl_arg_strings), 6965 'local_gl_args': ", ".join(gl_arg_strings),
6967 'cmd_args': ", ".join(cmd_arg_strings), 6966 'cmd_args': ", ".join(cmd_arg_strings),
6968 'valid_pname': valid_pname, 6967 'valid_pname': valid_pname,
6969 }, *extras) 6968 }, *extras)
6970 6969
6971 if not func.IsUnsafe(): 6970 if not func.IsES3API():
6972 invalid_test = """ 6971 invalid_test = """
6973 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { 6972 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
6974 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); 6973 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
6975 SpecializedSetup<cmds::%(name)s, 0>(false); 6974 SpecializedSetup<cmds::%(name)s, 0>(false);
6976 cmds::%(name)s::Result* result = 6975 cmds::%(name)s::Result* result =
6977 static_cast<cmds::%(name)s::Result*>(shared_memory_address_); 6976 static_cast<cmds::%(name)s::Result*>(shared_memory_address_);
6978 result->size = 0; 6977 result->size = 0;
6979 cmds::%(name)s cmd; 6978 cmds::%(name)s cmd;
6980 cmd.Init(%(args)s); 6979 cmd.Init(%(args)s);
6981 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd)); 6980 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
7052 """Writes the service unit test for a command.""" 7051 """Writes the service unit test for a command."""
7053 valid_test = """ 7052 valid_test = """
7054 TEST_P(%(test_name)s, %(name)sValidArgs) { 7053 TEST_P(%(test_name)s, %(name)sValidArgs) {
7055 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>(); 7054 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
7056 SpecializedSetup<cmds::%(name)s, 0>(true); 7055 SpecializedSetup<cmds::%(name)s, 0>(true);
7057 %(data_type)s temp[%(data_count)s] = { %(data_value)s, }; 7056 %(data_type)s temp[%(data_count)s] = { %(data_value)s, };
7058 cmd.Init(%(gl_client_args)s, &temp[0]); 7057 cmd.Init(%(gl_client_args)s, &temp[0]);
7059 EXPECT_CALL( 7058 EXPECT_CALL(
7060 *gl_, 7059 *gl_,
7061 %(gl_func_name)s(%(gl_args)s, %(expectation)s));""" 7060 %(gl_func_name)s(%(gl_args)s, %(expectation)s));"""
7062 if func.IsUnsafe(): 7061 if func.IsES3API():
7063 valid_test += """ 7062 valid_test += """
7064 decoder_->set_unsafe_es3_apis_enabled(true);""" 7063 decoder_->set_es3_apis_enabled(true);"""
7065 valid_test += """ 7064 valid_test += """
7066 EXPECT_EQ(error::kNoError, 7065 EXPECT_EQ(error::kNoError,
7067 ExecuteImmediateCmd(cmd, sizeof(temp))); 7066 ExecuteImmediateCmd(cmd, sizeof(temp)));
7068 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 7067 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
7069 if func.IsUnsafe(): 7068 if func.IsES3API():
7070 valid_test += """ 7069 valid_test += """
7071 decoder_->set_unsafe_es3_apis_enabled(false); 7070 decoder_->set_es3_apis_enabled(false);
7072 EXPECT_EQ(error::kUnknownCommand, 7071 EXPECT_EQ(error::kUnknownCommand,
7073 ExecuteImmediateCmd(cmd, sizeof(temp)));""" 7072 ExecuteImmediateCmd(cmd, sizeof(temp)));"""
7074 valid_test += """ 7073 valid_test += """
7075 } 7074 }
7076 """ 7075 """
7077 gl_client_arg_strings = [ 7076 gl_client_arg_strings = [
7078 arg.GetValidArg(func) for arg in func.GetOriginalArgs()[0:-1] 7077 arg.GetValidArg(func) for arg in func.GetOriginalArgs()[0:-1]
7079 ] 7078 ]
7080 gl_arg_strings = [ 7079 gl_arg_strings = [
7081 arg.GetValidGLArg(func) for arg in func.GetOriginalArgs()[0:-1] 7080 arg.GetValidGLArg(func) for arg in func.GetOriginalArgs()[0:-1]
(...skipping 12 matching lines...) Expand all
7094 'data_value': func.GetInfo('data_value') or '0', 7093 'data_value': func.GetInfo('data_value') or '0',
7095 'gl_client_args': ", ".join(gl_client_arg_strings), 7094 'gl_client_args': ", ".join(gl_client_arg_strings),
7096 'gl_args': ", ".join(gl_arg_strings), 7095 'gl_args': ", ".join(gl_arg_strings),
7097 'gl_any_args': ", ".join(gl_any_strings), 7096 'gl_any_args': ", ".join(gl_any_strings),
7098 } 7097 }
7099 self.WriteValidUnitTest(func, f, valid_test, extra, *extras) 7098 self.WriteValidUnitTest(func, f, valid_test, extra, *extras)
7100 7099
7101 invalid_test = """ 7100 invalid_test = """
7102 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { 7101 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
7103 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();""" 7102 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();"""
7104 if func.IsUnsafe(): 7103 if func.IsES3API():
7105 invalid_test += """ 7104 invalid_test += """
7106 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(1); 7105 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(1);
7107 """ 7106 """
7108 else: 7107 else:
7109 invalid_test += """ 7108 invalid_test += """
7110 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0); 7109 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0);
7111 """ 7110 """
7112 invalid_test += """ 7111 invalid_test += """
7113 SpecializedSetup<cmds::%(name)s, 0>(false); 7112 SpecializedSetup<cmds::%(name)s, 0>(false);
7114 %(data_type)s temp[%(data_count)s] = { %(data_value)s, }; 7113 %(data_type)s temp[%(data_count)s] = { %(data_value)s, };
7115 cmd.Init(%(all_but_last_args)s, &temp[0]);""" 7114 cmd.Init(%(all_but_last_args)s, &temp[0]);"""
7116 if func.IsUnsafe(): 7115 if func.IsES3API():
7117 invalid_test += """ 7116 invalid_test += """
7118 decoder_->set_unsafe_es3_apis_enabled(true); 7117 decoder_->set_es3_apis_enabled(true);
7119 EXPECT_EQ(error::%(parse_result)s, 7118 EXPECT_EQ(error::%(parse_result)s,
7120 ExecuteImmediateCmd(cmd, sizeof(temp))); 7119 ExecuteImmediateCmd(cmd, sizeof(temp)));
7121 decoder_->set_unsafe_es3_apis_enabled(false); 7120 decoder_->set_es3_apis_enabled(false);
7122 } 7121 }
7123 """ 7122 """
7124 else: 7123 else:
7125 invalid_test += """ 7124 invalid_test += """
7126 EXPECT_EQ(error::%(parse_result)s, 7125 EXPECT_EQ(error::%(parse_result)s,
7127 ExecuteImmediateCmd(cmd, sizeof(temp))); 7126 ExecuteImmediateCmd(cmd, sizeof(temp)));
7128 %(gl_error_test)s 7127 %(gl_error_test)s
7129 } 7128 }
7130 """ 7129 """
7131 self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras) 7130 self.WriteInvalidUnitTest(func, f, invalid_test, extra, *extras)
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
7385 valid_test = """ 7384 valid_test = """
7386 TEST_P(%(test_name)s, %(name)sValidArgs) { 7385 TEST_P(%(test_name)s, %(name)sValidArgs) {
7387 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>(); 7386 cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
7388 SpecializedSetup<cmds::%(name)s, 0>(true); 7387 SpecializedSetup<cmds::%(name)s, 0>(true);
7389 %(data_type)s temp[%(data_count)s * 2] = { 0, }; 7388 %(data_type)s temp[%(data_count)s * 2] = { 0, };
7390 EXPECT_CALL( 7389 EXPECT_CALL(
7391 *gl_, 7390 *gl_,
7392 %(gl_func_name)s(%(gl_args)s, 7391 %(gl_func_name)s(%(gl_args)s,
7393 PointsToArray(temp, %(data_count)s))); 7392 PointsToArray(temp, %(data_count)s)));
7394 cmd.Init(%(args)s, &temp[0]);""" 7393 cmd.Init(%(args)s, &temp[0]);"""
7395 if func.IsUnsafe(): 7394 if func.IsES3API():
7396 valid_test += """ 7395 valid_test += """
7397 decoder_->set_unsafe_es3_apis_enabled(true);""" 7396 decoder_->set_es3_apis_enabled(true);"""
7398 valid_test += """ 7397 valid_test += """
7399 EXPECT_EQ(error::kNoError, 7398 EXPECT_EQ(error::kNoError,
7400 ExecuteImmediateCmd(cmd, sizeof(temp))); 7399 ExecuteImmediateCmd(cmd, sizeof(temp)));
7401 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 7400 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
7402 if func.IsUnsafe(): 7401 if func.IsES3API():
7403 valid_test += """ 7402 valid_test += """
7404 decoder_->set_unsafe_es3_apis_enabled(false); 7403 decoder_->set_es3_apis_enabled(false);
7405 EXPECT_EQ(error::kUnknownCommand, 7404 EXPECT_EQ(error::kUnknownCommand,
7406 ExecuteImmediateCmd(cmd, sizeof(temp)));""" 7405 ExecuteImmediateCmd(cmd, sizeof(temp)));"""
7407 valid_test += """ 7406 valid_test += """
7408 } 7407 }
7409 """ 7408 """
7410 gl_arg_strings = [] 7409 gl_arg_strings = []
7411 gl_any_strings = [] 7410 gl_any_strings = []
7412 arg_strings = [] 7411 arg_strings = []
7413 for arg in func.GetOriginalArgs()[0:-1]: 7412 for arg in func.GetOriginalArgs()[0:-1]:
7414 gl_arg_strings.append(arg.GetValidGLArg(func)) 7413 gl_arg_strings.append(arg.GetValidGLArg(func))
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
7920 test = """ 7919 test = """
7921 TEST_P(%(test_name)s, %(name)sValidArgs) { 7920 TEST_P(%(test_name)s, %(name)sValidArgs) {
7922 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); 7921 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
7923 const uint32_t kBucketId = 123; 7922 const uint32_t kBucketId = 123;
7924 const char kSource0[] = "hello"; 7923 const char kSource0[] = "hello";
7925 const char* kSource[] = { kSource0 }; 7924 const char* kSource[] = { kSource0 };
7926 const char kValidStrEnd = 0; 7925 const char kValidStrEnd = 0;
7927 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd); 7926 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd);
7928 cmds::%(name)s cmd; 7927 cmds::%(name)s cmd;
7929 cmd.Init(%(cmd_args)s); 7928 cmd.Init(%(cmd_args)s);
7930 decoder_->set_unsafe_es3_apis_enabled(true); 7929 decoder_->set_es3_apis_enabled(true);
7931 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));""" 7930 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));"""
7932 if func.IsUnsafe(): 7931 if func.IsES3API():
7933 test += """ 7932 test += """
7934 decoder_->set_unsafe_es3_apis_enabled(false); 7933 decoder_->set_es3_apis_enabled(false);
7935 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); 7934 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
7936 """ 7935 """
7937 test += """ 7936 test += """
7938 } 7937 }
7939 """ 7938 """
7940 self.WriteValidUnitTest(func, f, test, { 7939 self.WriteValidUnitTest(func, f, test, {
7941 'cmd_args': ", ".join(cmd_args), 7940 'cmd_args': ", ".join(cmd_args),
7942 'gl_args': ", ".join(gl_args), 7941 'gl_args': ", ".join(gl_args),
7943 }, *extras) 7942 }, *extras)
7944 7943
7945 test = """ 7944 test = """
7946 TEST_P(%(test_name)s, %(name)sInvalidArgs) { 7945 TEST_P(%(test_name)s, %(name)sInvalidArgs) {
7947 const uint32_t kBucketId = 123; 7946 const uint32_t kBucketId = 123;
7948 const char kSource0[] = "hello"; 7947 const char kSource0[] = "hello";
7949 const char* kSource[] = { kSource0 }; 7948 const char* kSource[] = { kSource0 };
7950 const char kValidStrEnd = 0; 7949 const char kValidStrEnd = 0;
7951 decoder_->set_unsafe_es3_apis_enabled(true); 7950 decoder_->set_es3_apis_enabled(true);
7952 cmds::%(name)s cmd; 7951 cmds::%(name)s cmd;
7953 // Test no bucket. 7952 // Test no bucket.
7954 cmd.Init(%(cmd_args)s); 7953 cmd.Init(%(cmd_args)s);
7955 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); 7954 EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
7956 // Test invalid client. 7955 // Test invalid client.
7957 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd); 7956 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd);
7958 cmd.Init(%(cmd_args_with_invalid_id)s); 7957 cmd.Init(%(cmd_args_with_invalid_id)s);
7959 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 7958 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
7960 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); 7959 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
7961 } 7960 }
7962 """ 7961 """
7963 self.WriteValidUnitTest(func, f, test, { 7962 self.WriteValidUnitTest(func, f, test, {
7964 'cmd_args': ", ".join(cmd_args), 7963 'cmd_args': ", ".join(cmd_args),
7965 'cmd_args_with_invalid_id': ", ".join(cmd_args_with_invalid_id), 7964 'cmd_args_with_invalid_id': ", ".join(cmd_args_with_invalid_id),
7966 }, *extras) 7965 }, *extras)
7967 7966
7968 test = """ 7967 test = """
7969 TEST_P(%(test_name)s, %(name)sInvalidHeader) { 7968 TEST_P(%(test_name)s, %(name)sInvalidHeader) {
7970 const uint32_t kBucketId = 123; 7969 const uint32_t kBucketId = 123;
7971 const char kSource0[] = "hello"; 7970 const char kSource0[] = "hello";
7972 const char* kSource[] = { kSource0 }; 7971 const char* kSource[] = { kSource0 };
7973 const char kValidStrEnd = 0; 7972 const char kValidStrEnd = 0;
7974 const GLsizei kCount = static_cast<GLsizei>(arraysize(kSource)); 7973 const GLsizei kCount = static_cast<GLsizei>(arraysize(kSource));
7975 const GLsizei kTests[] = { 7974 const GLsizei kTests[] = {
7976 kCount + 1, 7975 kCount + 1,
7977 0, 7976 0,
7978 std::numeric_limits<GLsizei>::max(), 7977 std::numeric_limits<GLsizei>::max(),
7979 -1, 7978 -1,
7980 }; 7979 };
7981 decoder_->set_unsafe_es3_apis_enabled(true); 7980 decoder_->set_es3_apis_enabled(true);
7982 for (size_t ii = 0; ii < arraysize(kTests); ++ii) { 7981 for (size_t ii = 0; ii < arraysize(kTests); ++ii) {
7983 SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd); 7982 SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd);
7984 cmds::%(name)s cmd; 7983 cmds::%(name)s cmd;
7985 cmd.Init(%(cmd_args)s); 7984 cmd.Init(%(cmd_args)s);
7986 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 7985 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
7987 } 7986 }
7988 } 7987 }
7989 """ 7988 """
7990 self.WriteValidUnitTest(func, f, test, { 7989 self.WriteValidUnitTest(func, f, test, {
7991 'cmd_args': ", ".join(cmd_args), 7990 'cmd_args': ", ".join(cmd_args),
7992 }, *extras) 7991 }, *extras)
7993 7992
7994 test = """ 7993 test = """
7995 TEST_P(%(test_name)s, %(name)sInvalidStringEnding) { 7994 TEST_P(%(test_name)s, %(name)sInvalidStringEnding) {
7996 const uint32_t kBucketId = 123; 7995 const uint32_t kBucketId = 123;
7997 const char kSource0[] = "hello"; 7996 const char kSource0[] = "hello";
7998 const char* kSource[] = { kSource0 }; 7997 const char* kSource[] = { kSource0 };
7999 const char kInvalidStrEnd = '*'; 7998 const char kInvalidStrEnd = '*';
8000 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kInvalidStrEnd); 7999 SetBucketAsCStrings(kBucketId, 1, kSource, 1, kInvalidStrEnd);
8001 cmds::%(name)s cmd; 8000 cmds::%(name)s cmd;
8002 cmd.Init(%(cmd_args)s); 8001 cmd.Init(%(cmd_args)s);
8003 decoder_->set_unsafe_es3_apis_enabled(true); 8002 decoder_->set_es3_apis_enabled(true);
8004 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); 8003 EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
8005 } 8004 }
8006 """ 8005 """
8007 self.WriteValidUnitTest(func, f, test, { 8006 self.WriteValidUnitTest(func, f, test, {
8008 'cmd_args': ", ".join(cmd_args), 8007 'cmd_args': ", ".join(cmd_args),
8009 }, *extras) 8008 }, *extras)
8010 8009
8011 8010
8012 class PUTXnHandler(ArrayArgTypeHandler): 8011 class PUTXnHandler(ArrayArgTypeHandler):
8013 """Handler for glUniform?f functions.""" 8012 """Handler for glUniform?f functions."""
(...skipping 20 matching lines...) Expand all
8034 }) 8033 })
8035 8034
8036 def WriteServiceUnitTest(self, func, f, *extras): 8035 def WriteServiceUnitTest(self, func, f, *extras):
8037 """Overrriden from TypeHandler.""" 8036 """Overrriden from TypeHandler."""
8038 valid_test = """ 8037 valid_test = """
8039 TEST_P(%(test_name)s, %(name)sValidArgs) { 8038 TEST_P(%(test_name)s, %(name)sValidArgs) {
8040 EXPECT_CALL(*gl_, %(name)sv(%(local_args)s)); 8039 EXPECT_CALL(*gl_, %(name)sv(%(local_args)s));
8041 SpecializedSetup<cmds::%(name)s, 0>(true); 8040 SpecializedSetup<cmds::%(name)s, 0>(true);
8042 cmds::%(name)s cmd; 8041 cmds::%(name)s cmd;
8043 cmd.Init(%(args)s);""" 8042 cmd.Init(%(args)s);"""
8044 if func.IsUnsafe(): 8043 if func.IsES3API():
8045 valid_test += """ 8044 valid_test += """
8046 decoder_->set_unsafe_es3_apis_enabled(true);""" 8045 decoder_->set_es3_apis_enabled(true);"""
8047 valid_test += """ 8046 valid_test += """
8048 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 8047 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
8049 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 8048 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
8050 if func.IsUnsafe(): 8049 if func.IsES3API():
8051 valid_test += """ 8050 valid_test += """
8052 decoder_->set_unsafe_es3_apis_enabled(false); 8051 decoder_->set_es3_apis_enabled(false);
8053 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));""" 8052 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
8054 valid_test += """ 8053 valid_test += """
8055 } 8054 }
8056 """ 8055 """
8057 args = func.GetOriginalArgs() 8056 args = func.GetOriginalArgs()
8058 local_args = "%s, 1, _" % args[0].GetValidGLArg(func) 8057 local_args = "%s, 1, _" % args[0].GetValidGLArg(func)
8059 self.WriteValidUnitTest(func, f, valid_test, { 8058 self.WriteValidUnitTest(func, f, valid_test, {
8060 'name': func.name, 8059 'name': func.name,
8061 'count': self.GetArrayCount(func), 8060 'count': self.GetArrayCount(func),
8062 'local_args': local_args, 8061 'local_args': local_args,
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
8240 func.passthrough_service_doer_args.append(Argument('result', 'uint32_t*')) 8239 func.passthrough_service_doer_args.append(Argument('result', 'uint32_t*'))
8241 8240
8242 def WriteServiceUnitTest(self, func, f, *extras): 8241 def WriteServiceUnitTest(self, func, f, *extras):
8243 """Overrriden from TypeHandler.""" 8242 """Overrriden from TypeHandler."""
8244 valid_test = """ 8243 valid_test = """
8245 TEST_P(%(test_name)s, %(name)sValidArgs) { 8244 TEST_P(%(test_name)s, %(name)sValidArgs) {
8246 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); 8245 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
8247 SpecializedSetup<cmds::%(name)s, 0>(true); 8246 SpecializedSetup<cmds::%(name)s, 0>(true);
8248 cmds::%(name)s cmd; 8247 cmds::%(name)s cmd;
8249 cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_);""" 8248 cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_);"""
8250 if func.IsUnsafe(): 8249 if func.IsES3API():
8251 valid_test += """ 8250 valid_test += """
8252 decoder_->set_unsafe_es3_apis_enabled(true);""" 8251 decoder_->set_es3_apis_enabled(true);"""
8253 valid_test += """ 8252 valid_test += """
8254 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 8253 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
8255 EXPECT_EQ(GL_NO_ERROR, GetGLError());""" 8254 EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
8256 if func.IsUnsafe(): 8255 if func.IsES3API():
8257 valid_test += """ 8256 valid_test += """
8258 decoder_->set_unsafe_es3_apis_enabled(false); 8257 decoder_->set_es3_apis_enabled(false);
8259 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));""" 8258 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
8260 valid_test += """ 8259 valid_test += """
8261 } 8260 }
8262 """ 8261 """
8263 comma = "" 8262 comma = ""
8264 if len(func.GetOriginalArgs()): 8263 if len(func.GetOriginalArgs()):
8265 comma =", " 8264 comma =", "
8266 self.WriteValidUnitTest(func, f, valid_test, { 8265 self.WriteValidUnitTest(func, f, valid_test, {
8267 'comma': comma, 8266 'comma': comma,
8268 }, *extras) 8267 }, *extras)
8269 8268
8270 invalid_test = """ 8269 invalid_test = """
8271 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { 8270 TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
8272 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); 8271 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
8273 SpecializedSetup<cmds::%(name)s, 0>(false); 8272 SpecializedSetup<cmds::%(name)s, 0>(false);
8274 cmds::%(name)s cmd; 8273 cmds::%(name)s cmd;
8275 cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_); 8274 cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_);
8276 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s 8275 EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s
8277 } 8276 }
8278 """ 8277 """
8279 self.WriteInvalidUnitTest(func, f, invalid_test, { 8278 self.WriteInvalidUnitTest(func, f, invalid_test, {
8280 'comma': comma, 8279 'comma': comma,
8281 }, *extras) 8280 }, *extras)
8282 8281
8283 invalid_test = """ 8282 invalid_test = """
8284 TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) { 8283 TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
8285 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); 8284 EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
8286 SpecializedSetup<cmds::%(name)s, 0>(false);""" 8285 SpecializedSetup<cmds::%(name)s, 0>(false);"""
8287 if func.IsUnsafe(): 8286 if func.IsES3API():
8288 invalid_test += """ 8287 invalid_test += """
8289 decoder_->set_unsafe_es3_apis_enabled(true);""" 8288 decoder_->set_es3_apis_enabled(true);"""
8290 invalid_test += """ 8289 invalid_test += """
8291 cmds::%(name)s cmd; 8290 cmds::%(name)s cmd;
8292 cmd.Init(%(args)s%(comma)skInvalidSharedMemoryId, shared_memory_offset_); 8291 cmd.Init(%(args)s%(comma)skInvalidSharedMemoryId, shared_memory_offset_);
8293 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 8292 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
8294 cmd.Init(%(args)s%(comma)sshared_memory_id_, kInvalidSharedMemoryOffset); 8293 cmd.Init(%(args)s%(comma)sshared_memory_id_, kInvalidSharedMemoryOffset);
8295 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));""" 8294 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));"""
8296 if func.IsUnsafe(): 8295 if func.IsES3API():
8297 invalid_test += """ 8296 invalid_test += """
8298 decoder_->set_unsafe_es3_apis_enabled(true);""" 8297 decoder_->set_es3_apis_enabled(true);"""
8299 invalid_test += """ 8298 invalid_test += """
8300 } 8299 }
8301 """ 8300 """
8302 self.WriteValidUnitTest(func, f, invalid_test, { 8301 self.WriteValidUnitTest(func, f, invalid_test, {
8303 'comma': comma, 8302 'comma': comma,
8304 }, *extras) 8303 }, *extras)
8305 8304
8306 def WriteServiceImplementation(self, func, f): 8305 def WriteServiceImplementation(self, func, f):
8307 """Overrriden from TypeHandler.""" 8306 """Overrriden from TypeHandler."""
8308 self.WriteServiceHandlerFunctionHeader(func, f) 8307 self.WriteServiceHandlerFunctionHeader(func, f)
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
9425 9424
9426 if self.return_arg: 9425 if self.return_arg:
9427 self.init_args.append(self.return_arg) 9426 self.init_args.append(self.return_arg)
9428 9427
9429 self.type_handler.InitFunction(self) 9428 self.type_handler.InitFunction(self)
9430 9429
9431 def IsImmediate(self): 9430 def IsImmediate(self):
9432 """Returns whether the function is immediate data function or not.""" 9431 """Returns whether the function is immediate data function or not."""
9433 return False 9432 return False
9434 9433
9435 def IsUnsafe(self): 9434 def IsES3API(self):
9436 """Returns whether the function has service side validation or not.""" 9435 """Returns whether the function has service side validation or not."""
9437 return self.GetInfo('unsafe', False) 9436 return self.GetInfo('es3api', False)
9438 9437
9439 def GetInfo(self, name, default = None): 9438 def GetInfo(self, name, default = None):
9440 """Returns a value from the function info for this function.""" 9439 """Returns a value from the function info for this function."""
9441 if name in self.info: 9440 if name in self.info:
9442 return self.info[name] 9441 return self.info[name]
9443 return default 9442 return default
9444 9443
9445 def GetValidArg(self, arg): 9444 def GetValidArg(self, arg):
9446 """Gets a valid argument value for the parameter arg from the function info 9445 """Gets a valid argument value for the parameter arg from the function info
9447 if one exists.""" 9446 if one exists."""
(...skipping 10 matching lines...) Expand all
9458 def AddInfo(self, name, value): 9457 def AddInfo(self, name, value):
9459 """Adds an info.""" 9458 """Adds an info."""
9460 self.info[name] = value 9459 self.info[name] = value
9461 9460
9462 def IsExtension(self): 9461 def IsExtension(self):
9463 return self.GetInfo('extension') or self.GetInfo('extension_flag') 9462 return self.GetInfo('extension') or self.GetInfo('extension_flag')
9464 9463
9465 def IsCoreGLFunction(self): 9464 def IsCoreGLFunction(self):
9466 return (not self.IsExtension() and 9465 return (not self.IsExtension() and
9467 not self.GetInfo('pepper_interface') and 9466 not self.GetInfo('pepper_interface') and
9468 not self.IsUnsafe()) 9467 not self.IsES3API())
9469 9468
9470 def InPepperInterface(self, interface): 9469 def InPepperInterface(self, interface):
9471 ext = self.GetInfo('pepper_interface') 9470 ext = self.GetInfo('pepper_interface')
9472 if not interface.GetName(): 9471 if not interface.GetName():
9473 return self.IsCoreGLFunction() 9472 return self.IsCoreGLFunction()
9474 return ext == interface.GetName() 9473 return ext == interface.GetName()
9475 9474
9476 def InAnyPepperExtension(self): 9475 def InAnyPepperExtension(self):
9477 return self.IsCoreGLFunction() or self.GetInfo('pepper_interface') 9476 return self.IsCoreGLFunction() or self.GetInfo('pepper_interface')
9478 9477
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
11346 Format(gen.generated_cpp_filenames) 11345 Format(gen.generated_cpp_filenames)
11347 11346
11348 if gen.errors > 0: 11347 if gen.errors > 0:
11349 print "%d errors" % gen.errors 11348 print "%d errors" % gen.errors
11350 return 1 11349 return 1
11351 return 0 11350 return 0
11352 11351
11353 11352
11354 if __name__ == '__main__': 11353 if __name__ == '__main__':
11355 sys.exit(main(sys.argv[1:])) 11354 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698