| Index: gpu/command_buffer/build_gles2_cmd_buffer.py
|
| diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| index 30ac3c8d90d02d358858ac0c9d48c074ced12246..35dfcf3e24402948c053b04b08d2261ce934a74d 100755
|
| --- a/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| @@ -2375,10 +2375,9 @@ _PEPPER_INTERFACES = [
|
| # the corresponding feature info flag is enabled. Implies
|
| # 'extension': True.
|
| # not_shared: For GENn types, True if objects can't be shared between contexts
|
| -# unsafe: True = no validation is implemented on the service side and the
|
| -# command is only available with --enable-unsafe-es3-apis.
|
| +# es3: ES3 API. True if the function requires an ES3 or WebGL2 context.
|
| # id_mapping: A list of resource type names whose client side IDs need to be
|
| -# mapped to service side IDs. This is only used for unsafe APIs.
|
| +# mapped to service side IDs. This is only used for ES3 APIs.
|
|
|
| _FUNCTION_INFO = {
|
| 'ActiveTexture': {
|
| @@ -2410,7 +2409,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoBindBufferBase',
|
| 'gen_func': 'GenBuffersARB',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'BindBufferRange': {
|
| 'type': 'Bind',
|
| @@ -2421,7 +2420,7 @@ _FUNCTION_INFO = {
|
| '3': '4',
|
| '4': '4'
|
| },
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'BindFramebuffer': {
|
| 'type': 'Bind',
|
| @@ -2439,7 +2438,7 @@ _FUNCTION_INFO = {
|
| 'BindSampler': {
|
| 'type': 'Bind',
|
| 'decoder_func': 'DoBindSampler',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'BindTexture': {
|
| 'type': 'Bind',
|
| @@ -2453,7 +2452,7 @@ _FUNCTION_INFO = {
|
| 'BindTransformFeedback': {
|
| 'type': 'Bind',
|
| 'decoder_func': 'DoBindTransformFeedback',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'unit_test': False,
|
| },
|
| 'BlitFramebufferCHROMIUM': {
|
| @@ -2499,7 +2498,7 @@ _FUNCTION_INFO = {
|
| 'count': 4,
|
| 'decoder_func': 'DoClearBufferiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 2,
|
| },
|
| 'ClearBufferuiv': {
|
| @@ -2507,7 +2506,7 @@ _FUNCTION_INFO = {
|
| 'count': 4,
|
| 'decoder_func': 'DoClearBufferuiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 2,
|
| },
|
| 'ClearBufferfv': {
|
| @@ -2516,11 +2515,11 @@ _FUNCTION_INFO = {
|
| 'count': 4,
|
| 'decoder_func': 'DoClearBufferfv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 2,
|
| },
|
| 'ClearBufferfi': {
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoClearBufferfi',
|
| 'unit_test': False,
|
| 'trace_level': 2,
|
| @@ -2543,7 +2542,7 @@ _FUNCTION_INFO = {
|
| 'data_transfer_methods': ['shm'],
|
| 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, '
|
| 'GLuint64 timeout, GLenum* result',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'result': ['GLenum'],
|
| 'trace_level': 2,
|
| },
|
| @@ -2566,7 +2565,7 @@ _FUNCTION_INFO = {
|
| 'CopyBufferSubData': {
|
| 'decoder_func': 'DoCopyBufferSubData',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'CoverageModulationCHROMIUM': {
|
| 'type': 'StateSet',
|
| @@ -2628,21 +2627,21 @@ _FUNCTION_INFO = {
|
| 'type': 'Data',
|
| 'data_transfer_methods': ['bucket', 'shm'],
|
| 'decoder_func': 'DoCompressedTexImage3D',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'CompressedTexSubImage3D': {
|
| 'type': 'Data',
|
| 'data_transfer_methods': ['bucket', 'shm'],
|
| 'decoder_func': 'DoCompressedTexSubImage3D',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'CopyTexSubImage3D': {
|
| 'decoder_func': 'DoCopyTexSubImage3D',
|
| 'unit_test': False,
|
| 'defer_reads': True,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'CreateImageCHROMIUM': {
|
| @@ -2780,14 +2779,14 @@ _FUNCTION_INFO = {
|
| 'type': 'DELn',
|
| 'resource_type': 'Sampler',
|
| 'resource_types': 'Samplers',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'DeleteShader': { 'type': 'Delete' },
|
| 'DeleteSync': {
|
| 'type': 'Delete',
|
| 'cmd_args': 'GLuint sync',
|
| 'resource_type': 'Sync',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'DeleteTextures': {
|
| 'type': 'DELn',
|
| @@ -2798,7 +2797,7 @@ _FUNCTION_INFO = {
|
| 'type': 'DELn',
|
| 'resource_type': 'TransformFeedback',
|
| 'resource_types': 'TransformFeedbacks',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'unit_test': False,
|
| },
|
| 'DepthRangef': {
|
| @@ -2839,7 +2838,7 @@ _FUNCTION_INFO = {
|
| },
|
| 'DrawRangeElements': {
|
| 'type': 'NoCommand',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Enable': {
|
| 'decoder_func': 'DoEnable',
|
| @@ -2854,7 +2853,7 @@ _FUNCTION_INFO = {
|
| 'type': 'Create',
|
| 'client_test': False,
|
| 'decoder_func': 'DoFenceSync',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'Finish': {
|
| @@ -2873,7 +2872,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoFlushMappedBufferRange',
|
| 'trace_level': 1,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'FramebufferRenderbuffer': {
|
| 'decoder_func': 'DoFramebufferRenderbuffer',
|
| @@ -2896,7 +2895,7 @@ _FUNCTION_INFO = {
|
| },
|
| 'FramebufferTextureLayer': {
|
| 'decoder_func': 'DoFramebufferTextureLayer',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'unit_test': False,
|
| 'trace_level': 1,
|
| },
|
| @@ -2931,7 +2930,7 @@ _FUNCTION_INFO = {
|
| 'gl_test_func': 'glGenSamplers',
|
| 'resource_type': 'Sampler',
|
| 'resource_types': 'Samplers',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GenTextures': {
|
| 'type': 'GENn',
|
| @@ -2944,7 +2943,7 @@ _FUNCTION_INFO = {
|
| 'gl_test_func': 'glGenTransformFeedbacks',
|
| 'resource_type': 'TransformFeedback',
|
| 'resource_types': 'TransformFeedbacks',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetActiveAttrib': {
|
| 'type': 'Custom',
|
| @@ -2974,7 +2973,7 @@ _FUNCTION_INFO = {
|
| 'type': 'Custom',
|
| 'data_transfer_methods': ['shm'],
|
| 'result': ['SizedResult<GLint>'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetActiveUniformBlockName': {
|
| 'type': 'Custom',
|
| @@ -2983,7 +2982,7 @@ _FUNCTION_INFO = {
|
| 'GLidProgram program, GLuint index, uint32_t name_bucket_id, '
|
| 'void* result',
|
| 'result': ['int32_t'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetActiveUniformsiv': {
|
| 'type': 'Custom',
|
| @@ -2992,7 +2991,7 @@ _FUNCTION_INFO = {
|
| 'GLidProgram program, uint32_t indices_bucket_id, GLenum pname, '
|
| 'GLint* params',
|
| 'result': ['SizedResult<GLint>'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetAttachedShaders': {
|
| 'type': 'Custom',
|
| @@ -3014,7 +3013,7 @@ _FUNCTION_INFO = {
|
| 'cmd_args': 'GLenumBufferTarget target, GLintptrNotNegative offset, '
|
| 'GLsizeiptr size, '
|
| 'uint32_t data_shm_id, uint32_t data_shm_offset',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'impl_func': False,
|
| 'client_test': False,
|
| 'trace_level': 1,
|
| @@ -3036,7 +3035,7 @@ _FUNCTION_INFO = {
|
| 'GLidProgram program, uint32_t name_bucket_id, GLint* location',
|
| 'result': ['GLint'],
|
| 'error_return': -1,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetBooleanv': {
|
| 'type': 'GETn',
|
| @@ -3050,7 +3049,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoGetBufferParameteri64v',
|
| 'expectation': False,
|
| 'shadowed': True,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetBufferParameteriv': {
|
| 'type': 'GETn',
|
| @@ -3089,7 +3088,7 @@ _FUNCTION_INFO = {
|
| 'client_test': False,
|
| 'decoder_func': 'DoGetInteger64v',
|
| 'gl_test_func': 'glGetIntegerv',
|
| - 'unsafe': True
|
| + 'es3': True
|
| },
|
| 'GetIntegerv': {
|
| 'type': 'GETn',
|
| @@ -3104,7 +3103,7 @@ _FUNCTION_INFO = {
|
| 'shadowed': True,
|
| 'client_test': False,
|
| 'unit_test': False,
|
| - 'unsafe': True
|
| + 'es3': True
|
| },
|
| 'GetIntegeri_v': {
|
| 'type': 'GETn',
|
| @@ -3113,7 +3112,7 @@ _FUNCTION_INFO = {
|
| 'shadowed': True,
|
| 'client_test': False,
|
| 'unit_test': False,
|
| - 'unsafe': True
|
| + 'es3': True
|
| },
|
| 'GetInternalformativ': {
|
| 'type': 'Custom',
|
| @@ -3122,7 +3121,7 @@ _FUNCTION_INFO = {
|
| 'cmd_args':
|
| 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, '
|
| 'GLenumInternalFormatParameter pname, GLint* params',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetMaxValueInBufferCHROMIUM': {
|
| 'type': 'Is',
|
| @@ -3165,13 +3164,13 @@ _FUNCTION_INFO = {
|
| 'type': 'GETn',
|
| 'decoder_func': 'DoGetSamplerParameterfv',
|
| 'result': ['SizedResult<GLfloat>'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetSamplerParameteriv': {
|
| 'type': 'GETn',
|
| 'decoder_func': 'DoGetSamplerParameteriv',
|
| 'result': ['SizedResult<GLint>'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetShaderiv': {
|
| 'type': 'GETn',
|
| @@ -3211,14 +3210,14 @@ _FUNCTION_INFO = {
|
| },
|
| 'GetStringi': {
|
| 'type': 'NoCommand',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetSynciv': {
|
| 'type': 'GETn',
|
| 'cmd_args': 'GLuint sync, GLenumSyncParameter pname, void* values',
|
| 'result': ['SizedResult<GLint>'],
|
| 'id_mapping': ['Sync'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetTexParameterfv': {
|
| 'type': 'GETn',
|
| @@ -3244,7 +3243,7 @@ _FUNCTION_INFO = {
|
| 'GLidProgram program, uint32_t name_bucket_id, GLuint* index',
|
| 'result': ['GLuint'],
|
| 'error_return': 'GL_INVALID_INDEX',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetUniformBlocksCHROMIUM': {
|
| 'type': 'Custom',
|
| @@ -3253,7 +3252,7 @@ _FUNCTION_INFO = {
|
| 'client_test': False,
|
| 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
|
| 'result': ['uint32_t'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetUniformsES3CHROMIUM': {
|
| 'type': 'Custom',
|
| @@ -3262,7 +3261,7 @@ _FUNCTION_INFO = {
|
| 'client_test': False,
|
| 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
|
| 'result': ['uint32_t'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetTransformFeedbackVarying': {
|
| 'type': 'Custom',
|
| @@ -3275,7 +3274,7 @@ _FUNCTION_INFO = {
|
| 'int32_t size',
|
| 'uint32_t type',
|
| ],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetTransformFeedbackVaryingsCHROMIUM': {
|
| 'type': 'Custom',
|
| @@ -3284,7 +3283,7 @@ _FUNCTION_INFO = {
|
| 'client_test': False,
|
| 'cmd_args': 'GLidProgram program, uint32_t bucket_id',
|
| 'result': ['uint32_t'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetUniformfv': {
|
| 'type': 'Custom',
|
| @@ -3300,7 +3299,7 @@ _FUNCTION_INFO = {
|
| 'type': 'Custom',
|
| 'data_transfer_methods': ['shm'],
|
| 'result': ['SizedResult<GLuint>'],
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetUniformIndices': {
|
| 'type': 'Custom',
|
| @@ -3308,7 +3307,7 @@ _FUNCTION_INFO = {
|
| 'result': ['SizedResult<GLuint>'],
|
| 'cmd_args': 'GLidProgram program, uint32_t names_bucket_id, '
|
| 'GLuint* indices',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetUniformLocation': {
|
| 'type': 'Custom',
|
| @@ -3341,7 +3340,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoGetVertexAttribIiv',
|
| 'expectation': False,
|
| 'client_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetVertexAttribIuiv': {
|
| 'type': 'GETn',
|
| @@ -3350,7 +3349,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoGetVertexAttribIuiv',
|
| 'expectation': False,
|
| 'client_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetVertexAttribPointerv': {
|
| 'type': 'Custom',
|
| @@ -3364,7 +3363,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoInvalidateFramebuffer',
|
| 'client_test': False,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'InvalidateSubFramebuffer': {
|
| 'type': 'PUTn',
|
| @@ -3372,7 +3371,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoInvalidateSubFramebuffer',
|
| 'client_test': False,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'IsBuffer': {
|
| 'type': 'Is',
|
| @@ -3410,7 +3409,7 @@ _FUNCTION_INFO = {
|
| 'type': 'Is',
|
| 'decoder_func': 'DoIsSampler',
|
| 'expectation': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'IsSync': {
|
| 'type': 'Is',
|
| @@ -3418,7 +3417,7 @@ _FUNCTION_INFO = {
|
| 'cmd_args': 'GLuint sync',
|
| 'decoder_func': 'DoIsSync',
|
| 'expectation': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'IsTexture': {
|
| 'type': 'Is',
|
| @@ -3429,7 +3428,7 @@ _FUNCTION_INFO = {
|
| 'type': 'Is',
|
| 'decoder_func': 'DoIsTransformFeedback',
|
| 'expectation': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'GetLastFlushIdCHROMIUM': {
|
| 'type': 'NoCommand',
|
| @@ -3466,14 +3465,14 @@ _FUNCTION_INFO = {
|
| 'GLsizeiptr size, GLbitfieldMapBufferAccess access, '
|
| 'uint32_t data_shm_id, uint32_t data_shm_offset, '
|
| 'uint32_t result_shm_id, uint32_t result_shm_offset',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'result': ['uint32_t'],
|
| 'trace_level': 1,
|
| },
|
| 'PauseTransformFeedback': {
|
| 'decoder_func': 'DoPauseTransformFeedback',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'PixelStorei': {
|
| 'type': 'Custom',
|
| @@ -3534,7 +3533,7 @@ _FUNCTION_INFO = {
|
| 'trace_level': 1,
|
| },
|
| 'ReadBuffer': {
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoReadBuffer',
|
| 'trace_level': 1,
|
| },
|
| @@ -3569,14 +3568,14 @@ _FUNCTION_INFO = {
|
| 'ResumeTransformFeedback': {
|
| 'decoder_func': 'DoResumeTransformFeedback',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'SamplerParameterf': {
|
| 'valid_args': {
|
| '2': 'GL_NEAREST'
|
| },
|
| 'decoder_func': 'DoSamplerParameterf',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'SamplerParameterfv': {
|
| 'type': 'PUT',
|
| @@ -3585,14 +3584,14 @@ _FUNCTION_INFO = {
|
| 'gl_test_func': 'glSamplerParameterf',
|
| 'decoder_func': 'DoSamplerParameterfv',
|
| 'first_element_only': True,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'SamplerParameteri': {
|
| 'valid_args': {
|
| '2': 'GL_NEAREST'
|
| },
|
| 'decoder_func': 'DoSamplerParameteri',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'SamplerParameteriv': {
|
| 'type': 'PUT',
|
| @@ -3601,7 +3600,7 @@ _FUNCTION_INFO = {
|
| 'gl_test_func': 'glSamplerParameteri',
|
| 'decoder_func': 'DoSamplerParameteriv',
|
| 'first_element_only': True,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'ShaderBinary': {
|
| 'type': 'Custom',
|
| @@ -3663,7 +3662,7 @@ _FUNCTION_INFO = {
|
| 'impl_func': False,
|
| 'data_transfer_methods': ['shm'],
|
| 'client_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 2,
|
| },
|
| 'TexParameterf': {
|
| @@ -3695,7 +3694,7 @@ _FUNCTION_INFO = {
|
| 'first_element_only': True,
|
| },
|
| 'TexStorage3D': {
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'unit_test': False,
|
| 'decoder_func': 'DoTexStorage3D',
|
| 'trace_level': 2,
|
| @@ -3723,7 +3722,7 @@ _FUNCTION_INFO = {
|
| 'GLsizei width, GLsizei height, GLsizei depth, '
|
| 'GLenumTextureFormat format, GLenumPixelType type, '
|
| 'const void* pixels, GLboolean internal',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'TransformFeedbackVaryings': {
|
| 'type': 'PUTSTR',
|
| @@ -3732,7 +3731,7 @@ _FUNCTION_INFO = {
|
| 'cmd_args':
|
| 'GLuint program, const char** varyings, GLenum buffermode',
|
| 'expectation': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform1f': {'type': 'PUTXn', 'count': 1},
|
| 'Uniform1fv': {
|
| @@ -3751,14 +3750,14 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTXn',
|
| 'count': 1,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform1uiv': {
|
| 'type': 'PUTn',
|
| 'count': 1,
|
| 'decoder_func': 'DoUniform1uiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform2i': {'type': 'PUTXn', 'count': 2},
|
| 'Uniform2f': {'type': 'PUTXn', 'count': 2},
|
| @@ -3776,14 +3775,14 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTXn',
|
| 'count': 2,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform2uiv': {
|
| 'type': 'PUTn',
|
| 'count': 2,
|
| 'decoder_func': 'DoUniform2uiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform3i': {'type': 'PUTXn', 'count': 3},
|
| 'Uniform3f': {'type': 'PUTXn', 'count': 3},
|
| @@ -3801,14 +3800,14 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTXn',
|
| 'count': 3,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform3uiv': {
|
| 'type': 'PUTn',
|
| 'count': 3,
|
| 'decoder_func': 'DoUniform3uiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform4i': {'type': 'PUTXn', 'count': 4},
|
| 'Uniform4f': {'type': 'PUTXn', 'count': 4},
|
| @@ -3826,14 +3825,14 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTXn',
|
| 'count': 4,
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'Uniform4uiv': {
|
| 'type': 'PUTn',
|
| 'count': 4,
|
| 'decoder_func': 'DoUniform4uiv',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix2fv': {
|
| 'type': 'PUTn',
|
| @@ -3845,13 +3844,13 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTn',
|
| 'count': 6,
|
| 'decoder_func': 'DoUniformMatrix2x3fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix2x4fv': {
|
| 'type': 'PUTn',
|
| 'count': 8,
|
| 'decoder_func': 'DoUniformMatrix2x4fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix3fv': {
|
| 'type': 'PUTn',
|
| @@ -3863,13 +3862,13 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTn',
|
| 'count': 6,
|
| 'decoder_func': 'DoUniformMatrix3x2fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix3x4fv': {
|
| 'type': 'PUTn',
|
| 'count': 12,
|
| 'decoder_func': 'DoUniformMatrix3x4fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix4fv': {
|
| 'type': 'PUTn',
|
| @@ -3889,18 +3888,18 @@ _FUNCTION_INFO = {
|
| 'type': 'PUTn',
|
| 'count': 8,
|
| 'decoder_func': 'DoUniformMatrix4x2fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformMatrix4x3fv': {
|
| 'type': 'PUTn',
|
| 'count': 12,
|
| 'decoder_func': 'DoUniformMatrix4x3fv',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UniformBlockBinding': {
|
| 'type': 'Custom',
|
| 'impl_func': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'UnmapBufferCHROMIUM': {
|
| 'type': 'NoCommand',
|
| @@ -3915,7 +3914,7 @@ _FUNCTION_INFO = {
|
| },
|
| 'UnmapBuffer': {
|
| 'type': 'Custom',
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'UnmapTexSubImage2DCHROMIUM': {
|
| @@ -3954,23 +3953,23 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoVertexAttrib4fv',
|
| },
|
| 'VertexAttribI4i': {
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoVertexAttribI4i',
|
| },
|
| 'VertexAttribI4iv': {
|
| 'type': 'PUT',
|
| 'count': 4,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoVertexAttribI4iv',
|
| },
|
| 'VertexAttribI4ui': {
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoVertexAttribI4ui',
|
| },
|
| 'VertexAttribI4uiv': {
|
| 'type': 'PUT',
|
| 'count': 4,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'decoder_func': 'DoVertexAttribI4uiv',
|
| },
|
| 'VertexAttribIPointer': {
|
| @@ -3980,7 +3979,7 @@ _FUNCTION_INFO = {
|
| 'GLenumVertexAttribIType type, GLsizei stride, '
|
| 'GLuint offset',
|
| 'client_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'VertexAttribPointer': {
|
| 'type': 'Custom',
|
| @@ -3996,7 +3995,7 @@ _FUNCTION_INFO = {
|
| 'GLuint64 timeout',
|
| 'impl_func': False,
|
| 'client_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| 'trace_level': 1,
|
| },
|
| 'Scissor': {
|
| @@ -4125,7 +4124,7 @@ _FUNCTION_INFO = {
|
| 'BeginTransformFeedback': {
|
| 'decoder_func': 'DoBeginTransformFeedback',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'EndQueryEXT': {
|
| 'type': 'Custom',
|
| @@ -4139,7 +4138,7 @@ _FUNCTION_INFO = {
|
| 'EndTransformFeedback': {
|
| 'decoder_func': 'DoEndTransformFeedback',
|
| 'unit_test': False,
|
| - 'unsafe': True,
|
| + 'es3': True,
|
| },
|
| 'FlushDriverCachesCHROMIUM': {
|
| 'decoder_func': 'DoFlushDriverCachesCHROMIUM',
|
| @@ -4779,7 +4778,7 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
|
|
|
| def WriteHandlerImplementation(self, func, f):
|
| """Writes the handler implementation for this command."""
|
| - if func.IsUnsafe() and func.GetInfo('id_mapping'):
|
| + if func.IsES3() and func.GetInfo('id_mapping'):
|
| code_no_gen = """ if (!group_->Get%(type)sServiceId(
|
| %(var)s, &%(service_var)s)) {
|
| LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "%(func)s", "invalid %(var)s id");
|
| @@ -4878,7 +4877,7 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
|
|
|
| def __WriteIdMapping(self, func, f):
|
| """Writes client side / service side ID mapping."""
|
| - if not func.IsUnsafe() or not func.GetInfo('id_mapping'):
|
| + if not func.IsES3() or not func.GetInfo('id_mapping'):
|
| return
|
| for id_type in func.GetInfo('id_mapping'):
|
| f.write(" group_->Get%sServiceId(%s, &%s);\n" %
|
| @@ -4901,8 +4900,8 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
|
| f.write("""error::Error GLES2DecoderImpl::Handle%(name)s(
|
| uint32_t immediate_data_size, const volatile void* cmd_data) {
|
| """ % {'name': func.name})
|
| - if func.IsUnsafe():
|
| - f.write("""if (!unsafe_es3_apis_enabled())
|
| + if func.IsES3():
|
| + f.write("""if (!feature_info_->IsWebGL2OrES3Context())
|
| return error::kUnknownCommand;
|
| """)
|
| if func.GetCmdArgs():
|
| @@ -5068,7 +5067,7 @@ static_assert(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d,
|
|
|
| def WriteInvalidUnitTest(self, func, f, test, *extras):
|
| """Writes an invalid unit test for the service implementation."""
|
| - if func.IsUnsafe():
|
| + if func.IsES3():
|
| return
|
| for invalid_arg_index, invalid_arg in enumerate(func.GetOriginalArgs()):
|
| # Service implementation does not test constants, as they are not part of
|
| @@ -5137,24 +5136,14 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| cmd.Init(%(args)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| -}
|
| -"""
|
| - else:
|
| - valid_test += """
|
| + valid_test += """
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| self.WriteValidUnitTest(func, f, valid_test, *extras)
|
|
|
| - if not func.IsUnsafe():
|
| + if not func.IsES3():
|
| invalid_test = """
|
| TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
|
| @@ -5810,18 +5799,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| -}
|
| -"""
|
| - else:
|
| - valid_test += """
|
| + cmd.Init(%(args)s);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| @@ -5850,18 +5828,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| -}
|
| -"""
|
| - else:
|
| - valid_test += """
|
| + cmd.Init(%(args)s);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| @@ -5875,19 +5842,7 @@ TEST_P(%(test_name)s, %(name)sValidArgsNewId) {
|
| .WillOnce(SetArgumentPointee<1>(kNewServiceId));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args_with_new_id)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL);
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| -}
|
| -"""
|
| - else:
|
| - valid_test += """
|
| + cmd.Init(%(args_with_new_id)s);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| EXPECT_TRUE(Get%(resource_type)s(kNewClientId) != NULL);
|
| @@ -5968,7 +5923,7 @@ TEST_F(GLES2ImplementationTest, %(name)s) {
|
|
|
| gl_->%(name)s(%(args)s);
|
| EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));"""
|
| - if not func.IsUnsafe():
|
| + if not func.IsES3():
|
| code += """
|
| ClearCommands();
|
| gl_->%(name)s(%(args)s);
|
| @@ -6106,11 +6061,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| .WillOnce(SetArgumentPointee<1>(kNewServiceId));
|
| cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
|
| GLuint temp = kNewClientId;
|
| - SpecializedSetup<cmds::%(name)s, 0>(true);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmd->Init(1, &temp);
|
| EXPECT_EQ(error::kNoError,
|
| ExecuteImmediateCmd(*cmd, sizeof(temp)));
|
| @@ -6126,11 +6077,7 @@ TEST_P(%(test_name)s, %(name)sDuplicateOrNullIds) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0);
|
| cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
|
| GLuint temp[3] = {kNewClientId, kNewClientId + 1, kNewClientId};
|
| - SpecializedSetup<cmds::%(name)s, 1>(true);"""
|
| - if func.IsUnsafe():
|
| - duplicate_id_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - duplicate_id_test += """
|
| + SpecializedSetup<cmds::%(name)s, 1>(true);
|
| cmd->Init(3, temp);
|
| EXPECT_EQ(error::kInvalidArguments,
|
| ExecuteImmediateCmd(*cmd, sizeof(temp)));
|
| @@ -6151,17 +6098,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0);
|
| cmds::%(name)s* cmd = GetImmediateAs<cmds::%(name)s>();
|
| SpecializedSetup<cmds::%(name)s, 0>(false);
|
| - cmd->Init(1, &client_%(resource_name)s_id_);"""
|
| - if func.IsUnsafe():
|
| - invalid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kInvalidArguments,
|
| - ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_)));
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| -}
|
| -"""
|
| - else:
|
| - invalid_test += """
|
| + cmd->Init(1, &client_%(resource_name)s_id_);
|
| EXPECT_EQ(error::kInvalidArguments,
|
| ExecuteImmediateCmd(*cmd, sizeof(&client_%(resource_name)s_id_)));
|
| }
|
| @@ -6283,20 +6220,14 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| .WillOnce(Return(%(const_service_id)s));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args)s%(comma)skNewClientId);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(%(args)s%(comma)skNewClientId);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| + if func.IsES3():
|
| valid_test += """
|
| %(return_type)s service_id = 0;
|
| EXPECT_TRUE(Get%(resource_type)sServiceId(kNewClientId, &service_id));
|
| EXPECT_EQ(%(const_service_id)s, service_id);
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
| """
|
| else:
|
| @@ -6340,7 +6271,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
|
|
| def WriteHandlerImplementation (self, func, f):
|
| """Overrriden from TypeHandler."""
|
| - if func.IsUnsafe():
|
| + if func.IsES3():
|
| code = """ uint32_t client_id = c.client_id;
|
| %(return_type)s service_id = 0;
|
| if (group_->Get%(resource_name)sServiceId(client_id, &service_id)) {
|
| @@ -6406,7 +6337,7 @@ class DeleteHandler(TypeHandler):
|
|
|
| def WriteServiceImplementation(self, func, f):
|
| """Overrriden from TypeHandler."""
|
| - if func.IsUnsafe():
|
| + if func.IsES3():
|
| TypeHandler.WriteServiceImplementation(self, func, f)
|
| # HandleDeleteShader and HandleDeleteProgram are manually written.
|
| pass
|
| @@ -6512,11 +6443,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| .Times(1);
|
| cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| - cmd.Init(1, &client_%(resource_name)s_id_);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(1, &client_%(resource_name)s_id_);
|
| EXPECT_EQ(error::kNoError,
|
| ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_)));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| @@ -6533,19 +6460,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
|
| cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();
|
| SpecializedSetup<cmds::%(name)s, 0>(false);
|
| GLuint temp = kInvalidClientId;
|
| - cmd.Init(1, &temp);"""
|
| - if func.IsUnsafe():
|
| - invalid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::kNoError,
|
| - ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand,
|
| - ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| -}
|
| -"""
|
| - else:
|
| - invalid_test += """
|
| + cmd.Init(1, &temp);
|
| EXPECT_EQ(error::kNoError,
|
| ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| }
|
| @@ -6923,21 +6838,12 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(local_gl_args)s));
|
| result->size = 0;
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(cmd_args)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(%(cmd_args)s);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned(
|
| %(valid_pname)s),
|
| result->GetNumResults());
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
|
| - valid_test += """
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| gl_arg_strings = []
|
| @@ -6976,7 +6882,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| 'valid_pname': valid_pname,
|
| }, *extras)
|
|
|
| - if not func.IsUnsafe():
|
| + if not func.IsES3():
|
| invalid_test = """
|
| TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
|
| @@ -7066,20 +6972,10 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| cmd.Init(%(gl_client_args)s, &temp[0]);
|
| EXPECT_CALL(
|
| *gl_,
|
| - %(gl_func_name)s(%(gl_args)s, %(expectation)s));"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + %(gl_func_name)s(%(gl_args)s, %(expectation)s));
|
| EXPECT_EQ(error::kNoError,
|
| ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand,
|
| - ExecuteImmediateCmd(cmd, sizeof(temp)));"""
|
| - valid_test += """
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| gl_client_arg_strings = [
|
| @@ -7109,7 +7005,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| invalid_test = """
|
| TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
| cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(name)s>();"""
|
| - if func.IsUnsafe():
|
| + if func.IsES3():
|
| invalid_test += """
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(1);
|
| """
|
| @@ -7120,17 +7016,7 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
| invalid_test += """
|
| SpecializedSetup<cmds::%(name)s, 0>(false);
|
| %(data_type)s temp[%(data_count)s] = { %(data_value)s, };
|
| - cmd.Init(%(all_but_last_args)s, &temp[0]);"""
|
| - if func.IsUnsafe():
|
| - invalid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| - EXPECT_EQ(error::%(parse_result)s,
|
| - ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| -}
|
| -"""
|
| - else:
|
| - invalid_test += """
|
| + cmd.Init(%(all_but_last_args)s, &temp[0]);
|
| EXPECT_EQ(error::%(parse_result)s,
|
| ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| %(gl_error_test)s
|
| @@ -7399,20 +7285,10 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| *gl_,
|
| %(gl_func_name)s(%(gl_args)s,
|
| PointsToArray(temp, %(data_count)s)));
|
| - cmd.Init(%(args)s, &temp[0]);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(%(args)s, &temp[0]);
|
| EXPECT_EQ(error::kNoError,
|
| ExecuteImmediateCmd(cmd, sizeof(temp)));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand,
|
| - ExecuteImmediateCmd(cmd, sizeof(temp)));"""
|
| - valid_test += """
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| gl_arg_strings = []
|
| @@ -7935,13 +7811,7 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| SetBucketAsCStrings(kBucketId, 1, kSource, 1, kValidStrEnd);
|
| cmds::%(name)s cmd;
|
| cmd.Init(%(cmd_args)s);
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));"""
|
| - if func.IsUnsafe():
|
| - test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| -"""
|
| test += """
|
| }
|
| """
|
| @@ -7956,7 +7826,6 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs) {
|
| const char kSource0[] = "hello";
|
| const char* kSource[] = { kSource0 };
|
| const char kValidStrEnd = 0;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| cmds::%(name)s cmd;
|
| // Test no bucket.
|
| cmd.Init(%(cmd_args)s);
|
| @@ -7986,7 +7855,6 @@ TEST_P(%(test_name)s, %(name)sInvalidHeader) {
|
| std::numeric_limits<GLsizei>::max(),
|
| -1,
|
| };
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| for (size_t ii = 0; ii < arraysize(kTests); ++ii) {
|
| SetBucketAsCStrings(kBucketId, 1, kSource, kTests[ii], kValidStrEnd);
|
| cmds::%(name)s cmd;
|
| @@ -8008,7 +7876,6 @@ TEST_P(%(test_name)s, %(name)sInvalidStringEnding) {
|
| SetBucketAsCStrings(kBucketId, 1, kSource, 1, kInvalidStrEnd);
|
| cmds::%(name)s cmd;
|
| cmd.Init(%(cmd_args)s);
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd));
|
| }
|
| """
|
| @@ -8048,18 +7915,9 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| EXPECT_CALL(*gl_, %(name)sv(%(local_args)s));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args)s);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(%(args)s);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
|
| - valid_test += """
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| args = func.GetOriginalArgs()
|
| @@ -8254,18 +8112,9 @@ TEST_P(%(test_name)s, %(name)sValidArgs) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s));
|
| SpecializedSetup<cmds::%(name)s, 0>(true);
|
| cmds::%(name)s cmd;
|
| - cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_);"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - valid_test += """
|
| + cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_NO_ERROR, GetGLError());"""
|
| - if func.IsUnsafe():
|
| - valid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));"""
|
| - valid_test += """
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
| """
|
| comma = ""
|
| @@ -8291,20 +8140,12 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
|
| invalid_test = """
|
| TEST_P(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
|
| EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0);
|
| - SpecializedSetup<cmds::%(name)s, 0>(false);"""
|
| - if func.IsUnsafe():
|
| - invalid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - invalid_test += """
|
| + SpecializedSetup<cmds::%(name)s, 0>(false);
|
| cmds::%(name)s cmd;
|
| cmd.Init(%(args)s%(comma)skInvalidSharedMemoryId, shared_memory_offset_);
|
| EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
|
| cmd.Init(%(args)s%(comma)sshared_memory_id_, kInvalidSharedMemoryOffset);
|
| - EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));"""
|
| - if func.IsUnsafe():
|
| - invalid_test += """
|
| - decoder_->set_unsafe_es3_apis_enabled(true);"""
|
| - invalid_test += """
|
| + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
|
| }
|
| """
|
| self.WriteValidUnitTest(func, f, invalid_test, {
|
| @@ -9440,9 +9281,9 @@ class Function(object):
|
| """Returns whether the function is immediate data function or not."""
|
| return False
|
|
|
| - def IsUnsafe(self):
|
| - """Returns whether the function has service side validation or not."""
|
| - return self.GetInfo('unsafe', False)
|
| + def IsES3(self):
|
| + """Returns whether the function requires an ES3 context or not."""
|
| + return self.GetInfo('es3', False)
|
|
|
| def GetInfo(self, name, default = None):
|
| """Returns a value from the function info for this function."""
|
| @@ -9473,7 +9314,7 @@ class Function(object):
|
| def IsCoreGLFunction(self):
|
| return (not self.IsExtension() and
|
| not self.GetInfo('pepper_interface') and
|
| - not self.IsUnsafe())
|
| + not self.IsES3())
|
|
|
| def InPepperInterface(self, interface):
|
| ext = self.GetInfo('pepper_interface')
|
| @@ -10611,12 +10452,14 @@ namespace gles2 {
|
| comment = "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" \
|
| % count
|
| with CHeaderWriter(filename, comment) as f:
|
| - test_name = 'GLES2DecoderTest%d' % count
|
| end = test_num + FUNCTIONS_PER_FILE
|
| if end > num_tests:
|
| end = num_tests
|
| for idx in range(test_num, end):
|
| func = self.functions[idx]
|
| + test_name = 'GLES2DecoderTest%d' % count
|
| + if func.IsES3():
|
| + test_name = 'GLES3DecoderTest%d' % count
|
|
|
| # Do any filtering of the functions here, so that the functions
|
| # will not move between the numbered files if filtering properties
|
| @@ -10735,8 +10578,11 @@ void GLES2DecoderTestBase::SetupInitStateExpectations(bool es3_capable) {
|
| if func.GetInfo('unit_test') != False:
|
| extension = ToCamelCase(
|
| ToGLExtensionString(func.GetInfo('extension_flag')))
|
| + test_name = 'GLES2DecoderTestWith%s' % extension
|
| + if func.IsES3():
|
| + test_name = 'GLES3DecoderTestWith%s' % extension
|
| func.WriteServiceUnitTest(f, {
|
| - 'test_name': 'GLES2DecoderTestWith%s' % extension
|
| + 'test_name': test_name
|
| })
|
| self.generated_cpp_filenames.append(filename)
|
|
|
|
|