diff options
author | erikchen <erikchen@chromium.org> | 2016-01-06 11:35:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-06 19:36:22 +0000 |
commit | 50b7660fa4b9aeb05d7e9b8919febeea5ccc1374 (patch) | |
tree | 20cbe7a30cc6ab370670a673bcb4a178ea488629 /gpu | |
parent | 8d8895cc227d9247c1172f235603c23d0be15ab4 (diff) | |
download | chromium_src-50b7660fa4b9aeb05d7e9b8919febeea5ccc1374.zip chromium_src-50b7660fa4b9aeb05d7e9b8919febeea5ccc1374.tar.gz chromium_src-50b7660fa4b9aeb05d7e9b8919febeea5ccc1374.tar.bz2 |
Remove the "target" argument from CopyTextureChromium.
The argument is meaningless, since the function also takes a source_id and
dest_id, each of which is already bound to a target. This is a refactor and has
no intended behavior change.
BUG=533617
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1551143002
Cr-Commit-Position: refs/heads/master@{#367878}
Diffstat (limited to 'gpu')
20 files changed, 231 insertions, 284 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt index 101c0f6..5e15d3a 100644 --- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt @@ -33,7 +33,7 @@ New Procedures and Functions The command - void glCopyTextureCHROMIUM (GLenum target, GLenum source_id, + void glCopyTextureCHROMIUM (GLenum source_id, GLenum dest_id, GLint internal_format, GLenum dest_type, GLboolean unpack_flip_y, @@ -70,8 +70,6 @@ New Procedures and Functions The format type of the destination texture is converted to that specified by <dest_type>. - <target> uses the same parameters as TexImage2D. - If <flip_y> is true, vertically flip texture image data. If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true, @@ -84,8 +82,6 @@ New Procedures and Functions INVALID_OPERATION is generated if the internal format of <source_id> is not one of formats from the table above. - INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D. - INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture objects. @@ -100,7 +96,7 @@ New Procedures and Functions The command - void glCopySubTextureCHROMIUM (GLenum target, GLenum source_id, + void glCopySubTextureCHROMIUM (GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, @@ -112,7 +108,7 @@ New Procedures and Functions Copies the sub contents of texture referred to by <source_id> to <dest_id> texture without redefining <dest_id> texture. - See CopyTextureCHROMIUM for the interpretation of the <target>, <flip_y>, + See CopyTextureCHROMIUM for the interpretation of the <flip_y>, <premultiply_alpha>, and <unmultiply_alpha> arguments. <xoffset> and <yoffset> specify a texel offset in the x and y direction @@ -128,8 +124,6 @@ New Procedures and Functions INVALID_OPERATION is generated if source internal_format and destination internal_format are not one of the valid formats described above. - INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D. - INVALID_OPERATION is generated if the destination texture has not been defined. @@ -170,3 +164,4 @@ Revision History 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and unpack_unmultiply_alpha to both commands. + 4/1/2016 Removed the argument target. diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 2d8a449..a7b5e05 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h @@ -367,7 +367,6 @@ typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERCHROMIUMPROC) (GLint srcX0, GLint #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint internalformat, @@ -377,7 +376,6 @@ GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM( GLboolean unpack_unmultiply_alpha); GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, @@ -391,7 +389,6 @@ GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM( GLboolean unpack_unmultiply_alpha); #endif typedef void(GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC)( - GLenum target, GLenum source_id, GLenum dest_id, GLint internalformat, @@ -401,7 +398,6 @@ typedef void(GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC)( GLboolean unpack_unmultiply_alpha); typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)( - GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc index eec0300..5883701 100644 --- a/gpu/blink/webgraphicscontext3d_impl.cc +++ b/gpu/blink/webgraphicscontext3d_impl.cc @@ -875,9 +875,8 @@ DELEGATE_TO_GL_3(getQueryObjectui64vEXT, WGC3Denum, WGC3Duint64*) -DELEGATE_TO_GL_8(copyTextureCHROMIUM, +DELEGATE_TO_GL_7(copyTextureCHROMIUM, CopyTextureCHROMIUM, - WGC3Denum, WebGLId, WebGLId, WGC3Denum, @@ -886,9 +885,8 @@ DELEGATE_TO_GL_8(copyTextureCHROMIUM, WGC3Dboolean, WGC3Dboolean); -DELEGATE_TO_GL_12(copySubTextureCHROMIUM, +DELEGATE_TO_GL_11(copySubTextureCHROMIUM, CopySubTextureCHROMIUM, - WGC3Denum, WebGLId, WebGLId, WGC3Dint, diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h index b3c1dea..b468ca0 100644 --- a/gpu/blink/webgraphicscontext3d_impl.h +++ b/gpu/blink/webgraphicscontext3d_impl.h @@ -545,7 +545,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl blink::WGC3Duint64* params) override; void copyTextureCHROMIUM( - blink::WGC3Denum target, blink::WebGLId source_id, blink::WebGLId dest_id, blink::WGC3Denum internal_format, @@ -555,7 +554,6 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl blink::WGC3Dboolean unpack_unmultiply_alpha) override; void copySubTextureCHROMIUM( - blink::WGC3Denum target, blink::WebGLId source_id, blink::WebGLId dest_id, blink::WGC3Dint xoffset, diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index c866225..0feb120 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -1334,8 +1334,7 @@ void GL_APIENTRY GLES2TexImageIOSurface2DCHROMIUM(GLenum target, gles2::GetGLContext()->TexImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane); } -void GL_APIENTRY GLES2CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +void GL_APIENTRY GLES2CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, @@ -1343,12 +1342,11 @@ void GL_APIENTRY GLES2CopyTextureCHROMIUM(GLenum target, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) { gles2::GetGLContext()->CopyTextureCHROMIUM( - target, source_id, dest_id, internalformat, dest_type, unpack_flip_y, + source_id, dest_id, internalformat, dest_type, unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); } void GL_APIENTRY -GLES2CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +GLES2CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, @@ -1360,8 +1358,8 @@ GLES2CopySubTextureCHROMIUM(GLenum target, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) { gles2::GetGLContext()->CopySubTextureCHROMIUM( - target, source_id, dest_id, xoffset, yoffset, x, y, width, height, - unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); + source_id, dest_id, xoffset, yoffset, x, y, width, height, unpack_flip_y, + unpack_premultiply_alpha, unpack_unmultiply_alpha); } void GL_APIENTRY GLES2CompressedCopyTextureCHROMIUM(GLenum target, GLenum source_id, diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index 3d7daa58..ba82b35 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h @@ -2491,8 +2491,7 @@ void TexImageIOSurface2DCHROMIUM(GLenum target, } } -void CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, @@ -2502,13 +2501,12 @@ void CopyTextureCHROMIUM(GLenum target, gles2::cmds::CopyTextureCHROMIUM* c = GetCmdSpace<gles2::cmds::CopyTextureCHROMIUM>(); if (c) { - c->Init(target, source_id, dest_id, internalformat, dest_type, - unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); + c->Init(source_id, dest_id, internalformat, dest_type, unpack_flip_y, + unpack_premultiply_alpha, unpack_unmultiply_alpha); } } -void CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, @@ -2522,7 +2520,7 @@ void CopySubTextureCHROMIUM(GLenum target, gles2::cmds::CopySubTextureCHROMIUM* c = GetCmdSpace<gles2::cmds::CopySubTextureCHROMIUM>(); if (c) { - c->Init(target, source_id, dest_id, xoffset, yoffset, x, y, width, height, + c->Init(source_id, dest_id, xoffset, yoffset, x, y, width, height, unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); } } diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index b2fa97c..d7be9a0 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -927,8 +927,7 @@ void TexImageIOSurface2DCHROMIUM(GLenum target, GLuint ioSurfaceId, GLuint plane) override; -void CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, @@ -936,8 +935,7 @@ void CopyTextureCHROMIUM(GLenum target, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) override; -void CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h index 0d091536..559e480 100644 --- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h @@ -3171,7 +3171,6 @@ void GLES2Implementation::TexImageIOSurface2DCHROMIUM(GLenum target, } void GLES2Implementation::CopyTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint internalformat, @@ -3182,21 +3181,19 @@ void GLES2Implementation::CopyTextureCHROMIUM( GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG( "[" << GetLogPrefix() << "] glCopyTextureCHROMIUM(" - << GLES2Util::GetStringEnum(target) << ", " << GLES2Util::GetStringEnum(source_id) << ", " << GLES2Util::GetStringEnum(dest_id) << ", " << internalformat << ", " << GLES2Util::GetStringPixelType(dest_type) << ", " << GLES2Util::GetStringBool(unpack_flip_y) << ", " << GLES2Util::GetStringBool(unpack_premultiply_alpha) << ", " << GLES2Util::GetStringBool(unpack_unmultiply_alpha) << ")"); - helper_->CopyTextureCHROMIUM( - target, source_id, dest_id, internalformat, dest_type, unpack_flip_y, - unpack_premultiply_alpha, unpack_unmultiply_alpha); + helper_->CopyTextureCHROMIUM(source_id, dest_id, internalformat, dest_type, + unpack_flip_y, unpack_premultiply_alpha, + unpack_unmultiply_alpha); CheckGLError(); } void GLES2Implementation::CopySubTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, @@ -3211,7 +3208,6 @@ void GLES2Implementation::CopySubTextureCHROMIUM( GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG( "[" << GetLogPrefix() << "] glCopySubTextureCHROMIUM(" - << GLES2Util::GetStringEnum(target) << ", " << GLES2Util::GetStringEnum(source_id) << ", " << GLES2Util::GetStringEnum(dest_id) << ", " << xoffset << ", " << yoffset << ", " << x << ", " << y << ", " << width << ", " @@ -3227,8 +3223,8 @@ void GLES2Implementation::CopySubTextureCHROMIUM( return; } helper_->CopySubTextureCHROMIUM( - target, source_id, dest_id, xoffset, yoffset, x, y, width, height, - unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); + source_id, dest_id, xoffset, yoffset, x, y, width, height, unpack_flip_y, + unpack_premultiply_alpha, unpack_unmultiply_alpha); CheckGLError(); } diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h index 604425c..0015c46 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h @@ -2814,10 +2814,9 @@ TEST_F(GLES2ImplementationTest, CopyTextureCHROMIUM) { cmds::CopyTextureCHROMIUM cmd; }; Cmds expected; - expected.cmd.Init(1, 2, 3, GL_ALPHA, GL_UNSIGNED_BYTE, true, true, true); + expected.cmd.Init(1, 2, GL_ALPHA, GL_UNSIGNED_BYTE, true, true, true); - gl_->CopyTextureCHROMIUM(1, 2, 3, GL_ALPHA, GL_UNSIGNED_BYTE, true, true, - true); + gl_->CopyTextureCHROMIUM(1, 2, GL_ALPHA, GL_UNSIGNED_BYTE, true, true, true); EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); } @@ -2826,9 +2825,9 @@ TEST_F(GLES2ImplementationTest, CopySubTextureCHROMIUM) { cmds::CopySubTextureCHROMIUM cmd; }; Cmds expected; - expected.cmd.Init(1, 2, 3, 4, 5, 6, 7, 8, 9, true, true, true); + expected.cmd.Init(1, 2, 3, 4, 5, 6, 7, 8, true, true, true); - gl_->CopySubTextureCHROMIUM(1, 2, 3, 4, 5, 6, 7, 8, 9, true, true, true); + gl_->CopySubTextureCHROMIUM(1, 2, 3, 4, 5, 6, 7, 8, true, true, true); EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); } diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 568f180..56b1c0b 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h @@ -688,16 +688,14 @@ virtual void TexImageIOSurface2DCHROMIUM(GLenum target, GLsizei height, GLuint ioSurfaceId, GLuint plane) = 0; -virtual void CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +virtual void CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) = 0; -virtual void CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +virtual void CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 59c264c..aed6e72 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h @@ -667,16 +667,14 @@ void TexImageIOSurface2DCHROMIUM(GLenum target, GLsizei height, GLuint ioSurfaceId, GLuint plane) override; -void CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) override; -void CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index 9033928..6babece 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h @@ -912,7 +912,6 @@ void GLES2InterfaceStub::TexImageIOSurface2DCHROMIUM(GLenum /* target */, GLuint /* ioSurfaceId */, GLuint /* plane */) {} void GLES2InterfaceStub::CopyTextureCHROMIUM( - GLenum /* target */, GLenum /* source_id */, GLenum /* dest_id */, GLint /* internalformat */, @@ -921,7 +920,6 @@ void GLES2InterfaceStub::CopyTextureCHROMIUM( GLboolean /* unpack_premultiply_alpha */, GLboolean /* unpack_unmultiply_alpha */) {} void GLES2InterfaceStub::CopySubTextureCHROMIUM( - GLenum /* target */, GLenum /* source_id */, GLenum /* dest_id */, GLint /* xoffset */, diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index 129bc2a..9c9f936 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h @@ -667,16 +667,14 @@ void TexImageIOSurface2DCHROMIUM(GLenum target, GLsizei height, GLuint ioSurfaceId, GLuint plane) override; -void CopyTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopyTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint internalformat, GLenum dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) override; -void CopySubTextureCHROMIUM(GLenum target, - GLenum source_id, +void CopySubTextureCHROMIUM(GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index 32d9cf5..3f84d11 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h @@ -1940,7 +1940,6 @@ void GLES2TraceImplementation::TexImageIOSurface2DCHROMIUM(GLenum target, } void GLES2TraceImplementation::CopyTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint internalformat, @@ -1949,13 +1948,12 @@ void GLES2TraceImplementation::CopyTextureCHROMIUM( GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CopyTextureCHROMIUM"); - gl_->CopyTextureCHROMIUM(target, source_id, dest_id, internalformat, - dest_type, unpack_flip_y, unpack_premultiply_alpha, + gl_->CopyTextureCHROMIUM(source_id, dest_id, internalformat, dest_type, + unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); } void GLES2TraceImplementation::CopySubTextureCHROMIUM( - GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, @@ -1968,9 +1966,9 @@ void GLES2TraceImplementation::CopySubTextureCHROMIUM( GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CopySubTextureCHROMIUM"); - gl_->CopySubTextureCHROMIUM( - target, source_id, dest_id, xoffset, yoffset, x, y, width, height, - unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); + gl_->CopySubTextureCHROMIUM(source_id, dest_id, xoffset, yoffset, x, y, width, + height, unpack_flip_y, unpack_premultiply_alpha, + unpack_unmultiply_alpha); } void GLES2TraceImplementation::CompressedCopyTextureCHROMIUM(GLenum target, diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index dce7a56..2d78a73 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt @@ -278,8 +278,8 @@ GL_APICALL GLuint GL_APIENTRY glCreateGpuMemoryBufferImageCHROMIUM (GLsize GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLidShader shader, GLsizeiNotNegative bufsize, GLsizeiOptional* length, char* source); GL_APICALL void GL_APIENTRY glPostSubBufferCHROMIUM (GLint x, GLint y, GLint width, GLint height); GL_APICALL void GL_APIENTRY glTexImageIOSurface2DCHROMIUM (GLenumTextureBindTarget target, GLsizei width, GLsizei height, GLuint ioSurfaceId, GLuint plane); -GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLintTextureInternalFormat internalformat, GLenumPixelType dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha); -GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha); +GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM (GLenum source_id, GLenum dest_id, GLintTextureInternalFormat internalformat, GLenumPixelType dest_type, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha); +GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM (GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, GLboolean unpack_flip_y, GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha); GL_APICALL void GL_APIENTRY glCompressedCopyTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id); GL_APICALL void GL_APIENTRY glCompressedCopySubTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenumDrawMode mode, GLint first, GLsizei count, GLsizei primcount); diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index d6c853d..3419f6c 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -12332,8 +12332,7 @@ struct CopyTextureCHROMIUM { void SetHeader() { header.SetCmd<ValueType>(); } - void Init(GLenum _target, - GLenum _source_id, + void Init(GLenum _source_id, GLenum _dest_id, GLint _internalformat, GLenum _dest_type, @@ -12341,7 +12340,6 @@ struct CopyTextureCHROMIUM { GLboolean _unpack_premultiply_alpha, GLboolean _unpack_unmultiply_alpha) { SetHeader(); - target = _target; source_id = _source_id; dest_id = _dest_id; internalformat = _internalformat; @@ -12352,7 +12350,6 @@ struct CopyTextureCHROMIUM { } void* Set(void* cmd, - GLenum _target, GLenum _source_id, GLenum _dest_id, GLint _internalformat, @@ -12361,13 +12358,12 @@ struct CopyTextureCHROMIUM { GLboolean _unpack_premultiply_alpha, GLboolean _unpack_unmultiply_alpha) { static_cast<ValueType*>(cmd)->Init( - _target, _source_id, _dest_id, _internalformat, _dest_type, - _unpack_flip_y, _unpack_premultiply_alpha, _unpack_unmultiply_alpha); + _source_id, _dest_id, _internalformat, _dest_type, _unpack_flip_y, + _unpack_premultiply_alpha, _unpack_unmultiply_alpha); return NextCmdAddress<ValueType>(cmd); } gpu::CommandHeader header; - uint32_t target; uint32_t source_id; uint32_t dest_id; int32_t internalformat; @@ -12377,28 +12373,26 @@ struct CopyTextureCHROMIUM { uint32_t unpack_unmultiply_alpha; }; -static_assert(sizeof(CopyTextureCHROMIUM) == 36, - "size of CopyTextureCHROMIUM should be 36"); +static_assert(sizeof(CopyTextureCHROMIUM) == 32, + "size of CopyTextureCHROMIUM should be 32"); static_assert(offsetof(CopyTextureCHROMIUM, header) == 0, "offset of CopyTextureCHROMIUM header should be 0"); -static_assert(offsetof(CopyTextureCHROMIUM, target) == 4, - "offset of CopyTextureCHROMIUM target should be 4"); -static_assert(offsetof(CopyTextureCHROMIUM, source_id) == 8, - "offset of CopyTextureCHROMIUM source_id should be 8"); -static_assert(offsetof(CopyTextureCHROMIUM, dest_id) == 12, - "offset of CopyTextureCHROMIUM dest_id should be 12"); -static_assert(offsetof(CopyTextureCHROMIUM, internalformat) == 16, - "offset of CopyTextureCHROMIUM internalformat should be 16"); -static_assert(offsetof(CopyTextureCHROMIUM, dest_type) == 20, - "offset of CopyTextureCHROMIUM dest_type should be 20"); -static_assert(offsetof(CopyTextureCHROMIUM, unpack_flip_y) == 24, - "offset of CopyTextureCHROMIUM unpack_flip_y should be 24"); -static_assert( - offsetof(CopyTextureCHROMIUM, unpack_premultiply_alpha) == 28, - "offset of CopyTextureCHROMIUM unpack_premultiply_alpha should be 28"); -static_assert( - offsetof(CopyTextureCHROMIUM, unpack_unmultiply_alpha) == 32, - "offset of CopyTextureCHROMIUM unpack_unmultiply_alpha should be 32"); +static_assert(offsetof(CopyTextureCHROMIUM, source_id) == 4, + "offset of CopyTextureCHROMIUM source_id should be 4"); +static_assert(offsetof(CopyTextureCHROMIUM, dest_id) == 8, + "offset of CopyTextureCHROMIUM dest_id should be 8"); +static_assert(offsetof(CopyTextureCHROMIUM, internalformat) == 12, + "offset of CopyTextureCHROMIUM internalformat should be 12"); +static_assert(offsetof(CopyTextureCHROMIUM, dest_type) == 16, + "offset of CopyTextureCHROMIUM dest_type should be 16"); +static_assert(offsetof(CopyTextureCHROMIUM, unpack_flip_y) == 20, + "offset of CopyTextureCHROMIUM unpack_flip_y should be 20"); +static_assert( + offsetof(CopyTextureCHROMIUM, unpack_premultiply_alpha) == 24, + "offset of CopyTextureCHROMIUM unpack_premultiply_alpha should be 24"); +static_assert( + offsetof(CopyTextureCHROMIUM, unpack_unmultiply_alpha) == 28, + "offset of CopyTextureCHROMIUM unpack_unmultiply_alpha should be 28"); struct CopySubTextureCHROMIUM { typedef CopySubTextureCHROMIUM ValueType; @@ -12412,8 +12406,7 @@ struct CopySubTextureCHROMIUM { void SetHeader() { header.SetCmd<ValueType>(); } - void Init(GLenum _target, - GLenum _source_id, + void Init(GLenum _source_id, GLenum _dest_id, GLint _xoffset, GLint _yoffset, @@ -12425,7 +12418,6 @@ struct CopySubTextureCHROMIUM { GLboolean _unpack_premultiply_alpha, GLboolean _unpack_unmultiply_alpha) { SetHeader(); - target = _target; source_id = _source_id; dest_id = _dest_id; xoffset = _xoffset; @@ -12440,7 +12432,6 @@ struct CopySubTextureCHROMIUM { } void* Set(void* cmd, - GLenum _target, GLenum _source_id, GLenum _dest_id, GLint _xoffset, @@ -12452,15 +12443,13 @@ struct CopySubTextureCHROMIUM { GLboolean _unpack_flip_y, GLboolean _unpack_premultiply_alpha, GLboolean _unpack_unmultiply_alpha) { - static_cast<ValueType*>(cmd) - ->Init(_target, _source_id, _dest_id, _xoffset, _yoffset, _x, _y, - _width, _height, _unpack_flip_y, _unpack_premultiply_alpha, - _unpack_unmultiply_alpha); + static_cast<ValueType*>(cmd)->Init( + _source_id, _dest_id, _xoffset, _yoffset, _x, _y, _width, _height, + _unpack_flip_y, _unpack_premultiply_alpha, _unpack_unmultiply_alpha); return NextCmdAddress<ValueType>(cmd); } gpu::CommandHeader header; - uint32_t target; uint32_t source_id; uint32_t dest_id; int32_t xoffset; @@ -12474,36 +12463,34 @@ struct CopySubTextureCHROMIUM { uint32_t unpack_unmultiply_alpha; }; -static_assert(sizeof(CopySubTextureCHROMIUM) == 52, - "size of CopySubTextureCHROMIUM should be 52"); +static_assert(sizeof(CopySubTextureCHROMIUM) == 48, + "size of CopySubTextureCHROMIUM should be 48"); static_assert(offsetof(CopySubTextureCHROMIUM, header) == 0, "offset of CopySubTextureCHROMIUM header should be 0"); -static_assert(offsetof(CopySubTextureCHROMIUM, target) == 4, - "offset of CopySubTextureCHROMIUM target should be 4"); -static_assert(offsetof(CopySubTextureCHROMIUM, source_id) == 8, - "offset of CopySubTextureCHROMIUM source_id should be 8"); -static_assert(offsetof(CopySubTextureCHROMIUM, dest_id) == 12, - "offset of CopySubTextureCHROMIUM dest_id should be 12"); -static_assert(offsetof(CopySubTextureCHROMIUM, xoffset) == 16, - "offset of CopySubTextureCHROMIUM xoffset should be 16"); -static_assert(offsetof(CopySubTextureCHROMIUM, yoffset) == 20, - "offset of CopySubTextureCHROMIUM yoffset should be 20"); -static_assert(offsetof(CopySubTextureCHROMIUM, x) == 24, - "offset of CopySubTextureCHROMIUM x should be 24"); -static_assert(offsetof(CopySubTextureCHROMIUM, y) == 28, - "offset of CopySubTextureCHROMIUM y should be 28"); -static_assert(offsetof(CopySubTextureCHROMIUM, width) == 32, - "offset of CopySubTextureCHROMIUM width should be 32"); -static_assert(offsetof(CopySubTextureCHROMIUM, height) == 36, - "offset of CopySubTextureCHROMIUM height should be 36"); -static_assert(offsetof(CopySubTextureCHROMIUM, unpack_flip_y) == 40, - "offset of CopySubTextureCHROMIUM unpack_flip_y should be 40"); -static_assert( - offsetof(CopySubTextureCHROMIUM, unpack_premultiply_alpha) == 44, - "offset of CopySubTextureCHROMIUM unpack_premultiply_alpha should be 44"); -static_assert( - offsetof(CopySubTextureCHROMIUM, unpack_unmultiply_alpha) == 48, - "offset of CopySubTextureCHROMIUM unpack_unmultiply_alpha should be 48"); +static_assert(offsetof(CopySubTextureCHROMIUM, source_id) == 4, + "offset of CopySubTextureCHROMIUM source_id should be 4"); +static_assert(offsetof(CopySubTextureCHROMIUM, dest_id) == 8, + "offset of CopySubTextureCHROMIUM dest_id should be 8"); +static_assert(offsetof(CopySubTextureCHROMIUM, xoffset) == 12, + "offset of CopySubTextureCHROMIUM xoffset should be 12"); +static_assert(offsetof(CopySubTextureCHROMIUM, yoffset) == 16, + "offset of CopySubTextureCHROMIUM yoffset should be 16"); +static_assert(offsetof(CopySubTextureCHROMIUM, x) == 20, + "offset of CopySubTextureCHROMIUM x should be 20"); +static_assert(offsetof(CopySubTextureCHROMIUM, y) == 24, + "offset of CopySubTextureCHROMIUM y should be 24"); +static_assert(offsetof(CopySubTextureCHROMIUM, width) == 28, + "offset of CopySubTextureCHROMIUM width should be 28"); +static_assert(offsetof(CopySubTextureCHROMIUM, height) == 32, + "offset of CopySubTextureCHROMIUM height should be 32"); +static_assert(offsetof(CopySubTextureCHROMIUM, unpack_flip_y) == 36, + "offset of CopySubTextureCHROMIUM unpack_flip_y should be 36"); +static_assert( + offsetof(CopySubTextureCHROMIUM, unpack_premultiply_alpha) == 40, + "offset of CopySubTextureCHROMIUM unpack_premultiply_alpha should be 40"); +static_assert( + offsetof(CopySubTextureCHROMIUM, unpack_unmultiply_alpha) == 44, + "offset of CopySubTextureCHROMIUM unpack_unmultiply_alpha should be 44"); struct CompressedCopyTextureCHROMIUM { typedef CompressedCopyTextureCHROMIUM ValueType; diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index 8b9c540..f8ebe0f 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -4143,20 +4143,19 @@ TEST_F(GLES2FormatTest, CopyTextureCHROMIUM) { cmds::CopyTextureCHROMIUM& cmd = *GetBufferAs<cmds::CopyTextureCHROMIUM>(); void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11), static_cast<GLenum>(12), - static_cast<GLenum>(13), static_cast<GLint>(14), - static_cast<GLenum>(15), static_cast<GLboolean>(16), - static_cast<GLboolean>(17), static_cast<GLboolean>(18)); + static_cast<GLint>(13), static_cast<GLenum>(14), + static_cast<GLboolean>(15), static_cast<GLboolean>(16), + static_cast<GLboolean>(17)); EXPECT_EQ(static_cast<uint32_t>(cmds::CopyTextureCHROMIUM::kCmdId), cmd.header.command); EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); - EXPECT_EQ(static_cast<GLenum>(11), cmd.target); - EXPECT_EQ(static_cast<GLenum>(12), cmd.source_id); - EXPECT_EQ(static_cast<GLenum>(13), cmd.dest_id); - EXPECT_EQ(static_cast<GLint>(14), cmd.internalformat); - EXPECT_EQ(static_cast<GLenum>(15), cmd.dest_type); - EXPECT_EQ(static_cast<GLboolean>(16), cmd.unpack_flip_y); - EXPECT_EQ(static_cast<GLboolean>(17), cmd.unpack_premultiply_alpha); - EXPECT_EQ(static_cast<GLboolean>(18), cmd.unpack_unmultiply_alpha); + EXPECT_EQ(static_cast<GLenum>(11), cmd.source_id); + EXPECT_EQ(static_cast<GLenum>(12), cmd.dest_id); + EXPECT_EQ(static_cast<GLint>(13), cmd.internalformat); + EXPECT_EQ(static_cast<GLenum>(14), cmd.dest_type); + EXPECT_EQ(static_cast<GLboolean>(15), cmd.unpack_flip_y); + EXPECT_EQ(static_cast<GLboolean>(16), cmd.unpack_premultiply_alpha); + EXPECT_EQ(static_cast<GLboolean>(17), cmd.unpack_unmultiply_alpha); CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } @@ -4165,25 +4164,24 @@ TEST_F(GLES2FormatTest, CopySubTextureCHROMIUM) { *GetBufferAs<cmds::CopySubTextureCHROMIUM>(); void* next_cmd = cmd.Set( &cmd, static_cast<GLenum>(11), static_cast<GLenum>(12), - static_cast<GLenum>(13), static_cast<GLint>(14), static_cast<GLint>(15), - static_cast<GLint>(16), static_cast<GLint>(17), static_cast<GLsizei>(18), - static_cast<GLsizei>(19), static_cast<GLboolean>(20), - static_cast<GLboolean>(21), static_cast<GLboolean>(22)); + static_cast<GLint>(13), static_cast<GLint>(14), static_cast<GLint>(15), + static_cast<GLint>(16), static_cast<GLsizei>(17), + static_cast<GLsizei>(18), static_cast<GLboolean>(19), + static_cast<GLboolean>(20), static_cast<GLboolean>(21)); EXPECT_EQ(static_cast<uint32_t>(cmds::CopySubTextureCHROMIUM::kCmdId), cmd.header.command); EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); - EXPECT_EQ(static_cast<GLenum>(11), cmd.target); - EXPECT_EQ(static_cast<GLenum>(12), cmd.source_id); - EXPECT_EQ(static_cast<GLenum>(13), cmd.dest_id); - EXPECT_EQ(static_cast<GLint>(14), cmd.xoffset); - EXPECT_EQ(static_cast<GLint>(15), cmd.yoffset); - EXPECT_EQ(static_cast<GLint>(16), cmd.x); - EXPECT_EQ(static_cast<GLint>(17), cmd.y); - EXPECT_EQ(static_cast<GLsizei>(18), cmd.width); - EXPECT_EQ(static_cast<GLsizei>(19), cmd.height); - EXPECT_EQ(static_cast<GLboolean>(20), cmd.unpack_flip_y); - EXPECT_EQ(static_cast<GLboolean>(21), cmd.unpack_premultiply_alpha); - EXPECT_EQ(static_cast<GLboolean>(22), cmd.unpack_unmultiply_alpha); + EXPECT_EQ(static_cast<GLenum>(11), cmd.source_id); + EXPECT_EQ(static_cast<GLenum>(12), cmd.dest_id); + EXPECT_EQ(static_cast<GLint>(13), cmd.xoffset); + EXPECT_EQ(static_cast<GLint>(14), cmd.yoffset); + EXPECT_EQ(static_cast<GLint>(15), cmd.x); + EXPECT_EQ(static_cast<GLint>(16), cmd.y); + EXPECT_EQ(static_cast<GLsizei>(17), cmd.width); + EXPECT_EQ(static_cast<GLsizei>(18), cmd.height); + EXPECT_EQ(static_cast<GLboolean>(19), cmd.unpack_flip_y); + EXPECT_EQ(static_cast<GLboolean>(20), cmd.unpack_premultiply_alpha); + EXPECT_EQ(static_cast<GLboolean>(21), cmd.unpack_unmultiply_alpha); CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 24fedca..cb76d44 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -940,8 +940,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { GLuint io_surface_id, GLuint plane); - void DoCopyTextureCHROMIUM(GLenum target, - GLuint source_id, + void DoCopyTextureCHROMIUM(GLuint source_id, GLuint dest_id, GLenum internal_format, GLenum dest_type, @@ -949,8 +948,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { GLboolean unpack_premultiply_alpha, GLboolean unpack_unmultiply_alpha); - void DoCopySubTextureCHROMIUM(GLenum target, - GLuint source_id, + void DoCopySubTextureCHROMIUM(GLuint source_id, GLuint dest_id, GLint xoffset, GLint yoffset, @@ -1810,11 +1808,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, Texture* texture); - bool ValidateCopyTextureCHROMIUM(const char* function_name, - GLenum target, - TextureRef* source_texture_ref, - TextureRef* dest_texture_ref, - GLenum dest_internal_format); + bool ValidateCopyTextureCHROMIUMTextures(const char* function_name, + TextureRef* source_texture_ref, + TextureRef* dest_texture_ref); + bool ValidateCopyTextureCHROMIUMInternalFormats( + const char* function_name, + TextureRef* source_texture_ref, + GLenum dest_internal_format); bool ValidateCompressedCopyTextureCHROMIUM(const char* function_name, GLenum target, TextureRef* source_texture_ref, @@ -13070,23 +13070,15 @@ void GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM( #endif } -bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUM( +bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMTextures( const char* function_name, - GLenum target, TextureRef* source_texture_ref, - TextureRef* dest_texture_ref, - GLenum dest_internal_format) { + TextureRef* dest_texture_ref) { if (!source_texture_ref || !dest_texture_ref) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, "unknown texture id"); return false; } - if (GL_TEXTURE_2D != target) { - LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name, - "invalid texture target"); - return false; - } - Texture* source_texture = source_texture_ref->texture(); Texture* dest_texture = dest_texture_ref->texture(); if (source_texture == dest_texture) { @@ -13103,9 +13095,16 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUM( "invalid texture target binding"); return false; } + return true; +} +bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMInternalFormats( + const char* function_name, + TextureRef* source_texture_ref, + GLenum dest_internal_format) { GLenum source_type = 0; GLenum source_internal_format = 0; + Texture* source_texture = source_texture_ref->texture(); source_texture->GetLevelType(source_texture->target(), 0, &source_type, &source_internal_format); @@ -13185,7 +13184,6 @@ bool GLES2DecoderImpl::ValidateCompressedCopyTextureCHROMIUM( } void GLES2DecoderImpl::DoCopyTextureCHROMIUM( - GLenum target, GLuint source_id, GLuint dest_id, GLenum internal_format, @@ -13198,18 +13196,24 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( TextureRef* source_texture_ref = GetTexture(source_id); TextureRef* dest_texture_ref = GetTexture(dest_id); - if (!source_texture_ref || !dest_texture_ref) { - LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", - "unknown texture ids"); + if (!ValidateCopyTextureCHROMIUMTextures( + "glCopyTextureCHROMIUM", source_texture_ref, dest_texture_ref)) { + return; + } + + if (!ValidateCopyTextureCHROMIUMInternalFormats( + "glCopyTextureCHROMIUM", source_texture_ref, internal_format)) { return; } Texture* source_texture = source_texture_ref->texture(); Texture* dest_texture = dest_texture_ref->texture(); + GLenum source_target = source_texture->target(); + GLenum dest_target = dest_texture->target(); int source_width = 0; int source_height = 0; gl::GLImage* image = - source_texture->GetLevelImage(source_texture->target(), 0); + source_texture->GetLevelImage(source_target, 0); if (image) { gfx::Size size = image->GetSize(); source_width = size.width(); @@ -13221,7 +13225,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( return; } } else { - if (!source_texture->GetLevelSize(source_texture->target(), 0, + if (!source_texture->GetLevelSize(source_target, 0, &source_width, &source_height, nullptr)) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopyTextureChromium", @@ -13230,7 +13234,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( } // Check that this type of texture is allowed. - if (!texture_manager()->ValidForTarget(source_texture->target(), 0, + if (!texture_manager()->ValidForTarget(source_target, 0, source_width, source_height, 1)) { LOCAL_SET_GL_ERROR( GL_INVALID_VALUE, "glCopyTextureCHROMIUM", "Bad dimensions"); @@ -13240,8 +13244,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( GLenum source_type = 0; GLenum source_internal_format = 0; - source_texture->GetLevelType( - source_texture->target(), 0, &source_type, &source_internal_format); + source_texture->GetLevelType(source_target, 0, &source_type, + &source_internal_format); if (dest_texture->IsImmutable()) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glCopyTextureCHROMIUM", @@ -13249,15 +13253,9 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( return; } - if (!ValidateCopyTextureCHROMIUM("glCopyTextureCHROMIUM", target, - source_texture_ref, dest_texture_ref, - internal_format)) { - return; - } - // Clear the source texture if necessary. if (!texture_manager()->ClearTextureLevel(this, source_texture_ref, - source_texture->target(), 0)) { + source_target, 0)) { LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCopyTextureCHROMIUM", "dimensions too big"); return; @@ -13279,10 +13277,10 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( int dest_width = 0; int dest_height = 0; bool dest_level_defined = dest_texture->GetLevelSize( - GL_TEXTURE_2D, 0, &dest_width, &dest_height, nullptr); + dest_target, 0, &dest_width, &dest_height, nullptr); if (dest_level_defined) { - dest_texture->GetLevelType(GL_TEXTURE_2D, 0, &dest_type_previous, + dest_texture->GetLevelType(dest_target, 0, &dest_type_previous, &dest_internal_format); } @@ -13293,21 +13291,21 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( dest_type_previous != dest_type) { // Ensure that the glTexImage2D succeeds. LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("glCopyTextureCHROMIUM"); - glBindTexture(GL_TEXTURE_2D, dest_texture->service_id()); - glTexImage2D(GL_TEXTURE_2D, 0, internal_format, source_width, source_height, + glBindTexture(dest_target, dest_texture->service_id()); + glTexImage2D(dest_target, 0, internal_format, source_width, source_height, 0, internal_format, dest_type, NULL); GLenum error = LOCAL_PEEK_GL_ERROR("glCopyTextureCHROMIUM"); if (error != GL_NO_ERROR) { - RestoreCurrentTextureBindings(&state_, GL_TEXTURE_2D); + RestoreCurrentTextureBindings(&state_, dest_target); return; } texture_manager()->SetLevelInfo( - dest_texture_ref, GL_TEXTURE_2D, 0, internal_format, source_width, + dest_texture_ref, dest_target, 0, internal_format, source_width, source_height, 1, 0, internal_format, dest_type, gfx::Rect(source_width, source_height)); } else { - texture_manager()->SetLevelCleared(dest_texture_ref, GL_TEXTURE_2D, 0, + texture_manager()->SetLevelCleared(dest_texture_ref, dest_target, 0, true); } @@ -13315,20 +13313,20 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( bool unpack_premultiply_alpha_change = (unpack_premultiply_alpha ^ unpack_unmultiply_alpha) != 0; if (image && !unpack_flip_y && !unpack_premultiply_alpha_change) { - glBindTexture(GL_TEXTURE_2D, dest_texture->service_id()); - if (image->CopyTexImage(GL_TEXTURE_2D)) + glBindTexture(dest_target, dest_texture->service_id()); + if (image->CopyTexImage(dest_target)) return; } - DoCopyTexImageIfNeeded(source_texture, source_texture->target()); + DoCopyTexImageIfNeeded(source_texture, source_target); // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix // before presenting. - if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { + if (source_target == GL_TEXTURE_EXTERNAL_OES) { // TODO(hkuang): get the StreamTexture transform matrix in GPU process // instead of using kIdentityMatrix crbug.com/226218. copy_texture_CHROMIUM_->DoCopyTextureWithTransform( - this, source_texture->target(), source_texture->service_id(), + this, source_target, source_texture->service_id(), dest_texture->service_id(), source_width, source_height, unpack_flip_y == GL_TRUE, unpack_premultiply_alpha == GL_TRUE, @@ -13336,7 +13334,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( kIdentityMatrix); } else { copy_texture_CHROMIUM_->DoCopyTexture( - this, source_texture->target(), source_texture->service_id(), + this, source_target, source_texture->service_id(), source_internal_format, dest_texture->service_id(), internal_format, source_width, source_height, unpack_flip_y == GL_TRUE, @@ -13346,7 +13344,6 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( } void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( - GLenum target, GLuint source_id, GLuint dest_id, GLint xoffset, @@ -13363,18 +13360,19 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( TextureRef* source_texture_ref = GetTexture(source_id); TextureRef* dest_texture_ref = GetTexture(dest_id); - if (!source_texture_ref || !dest_texture_ref) { - LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", - "unknown texture ids"); + if (!ValidateCopyTextureCHROMIUMTextures( + "glCopySubTextureCHROMIUM", source_texture_ref, dest_texture_ref)) { return; } Texture* source_texture = source_texture_ref->texture(); Texture* dest_texture = dest_texture_ref->texture(); + GLenum source_target = source_texture->target(); + GLenum dest_target = dest_texture->target(); int source_width = 0; int source_height = 0; gl::GLImage* image = - source_texture->GetLevelImage(source_texture->target(), 0); + source_texture->GetLevelImage(source_target, 0); if (image) { gfx::Size size = image->GetSize(); source_width = size.width(); @@ -13385,7 +13383,7 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( return; } } else { - if (!source_texture->GetLevelSize(source_texture->target(), 0, + if (!source_texture->GetLevelSize(source_target, 0, &source_width, &source_height, nullptr)) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", "source texture has no level 0"); @@ -13393,7 +13391,7 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( } // Check that this type of texture is allowed. - if (!texture_manager()->ValidForTarget(source_texture->target(), 0, + if (!texture_manager()->ValidForTarget(source_target, 0, source_width, source_height, 1)) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", "source texture bad dimensions"); @@ -13403,9 +13401,9 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( GLenum source_type = 0; GLenum source_internal_format = 0; - source_texture->GetLevelType(source_texture->target(), 0, &source_type, + source_texture->GetLevelType(source_target, 0, &source_type, &source_internal_format); - if (!source_texture->ValidForTexture(source_texture->target(), 0, x, y, 0, + if (!source_texture->ValidForTexture(source_target, 0, x, y, 0, width, height, 1)) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", "source texture bad dimensions."); @@ -13415,28 +13413,28 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( GLenum dest_type = 0; GLenum dest_internal_format = 0; bool dest_level_defined = dest_texture->GetLevelType( - dest_texture->target(), 0, &dest_type, &dest_internal_format); + dest_target, 0, &dest_type, &dest_internal_format); if (!dest_level_defined) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glCopySubTextureCHROMIUM", "destination texture is not defined"); return; } - if (!dest_texture->ValidForTexture(dest_texture->target(), 0, xoffset, + if (!dest_texture->ValidForTexture(dest_target, 0, xoffset, yoffset, 0, width, height, 1)) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM", "destination texture bad dimensions."); return; } - if (!ValidateCopyTextureCHROMIUM("glCopySubTextureCHROMIUM", target, - source_texture_ref, dest_texture_ref, - dest_internal_format)) { + if (!ValidateCopyTextureCHROMIUMInternalFormats("glCopySubTextureCHROMIUM", + source_texture_ref, + dest_internal_format)) { return; } // Clear the source texture if necessary. if (!texture_manager()->ClearTextureLevel(this, source_texture_ref, - source_texture->target(), 0)) { + source_target, 0)) { LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCopySubTextureCHROMIUM", "source texture dimensions too big"); return; @@ -13456,29 +13454,30 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( int dest_width = 0; int dest_height = 0; bool ok = dest_texture->GetLevelSize( - GL_TEXTURE_2D, 0, &dest_width, &dest_height, nullptr); + dest_target, 0, &dest_width, &dest_height, nullptr); DCHECK(ok); if (xoffset != 0 || yoffset != 0 || width != dest_width || height != dest_height) { gfx::Rect cleared_rect; if (TextureManager::CombineAdjacentRects( - dest_texture->GetLevelClearedRect(target, 0), + dest_texture->GetLevelClearedRect(dest_target, 0), gfx::Rect(xoffset, yoffset, width, height), &cleared_rect)) { - DCHECK_GE(cleared_rect.size().GetArea(), - dest_texture->GetLevelClearedRect(target, 0).size().GetArea()); - texture_manager()->SetLevelClearedRect(dest_texture_ref, target, 0, + DCHECK_GE( + cleared_rect.size().GetArea(), + dest_texture->GetLevelClearedRect(dest_target, 0).size().GetArea()); + texture_manager()->SetLevelClearedRect(dest_texture_ref, dest_target, 0, cleared_rect); } else { // Otherwise clear part of texture level that is not already cleared. - if (!texture_manager()->ClearTextureLevel(this, dest_texture_ref, target, - 0)) { + if (!texture_manager()->ClearTextureLevel(this, dest_texture_ref, + dest_target, 0)) { LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCopySubTextureCHROMIUM", "destination texture dimensions too big"); return; } } } else { - texture_manager()->SetLevelCleared(dest_texture_ref, GL_TEXTURE_2D, 0, + texture_manager()->SetLevelCleared(dest_texture_ref, dest_target, 0, true); } @@ -13487,19 +13486,19 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM( (unpack_premultiply_alpha ^ unpack_unmultiply_alpha) != 0; if (image && !unpack_flip_y && !unpack_premultiply_alpha_change) { ScopedTextureBinder binder( - &state_, dest_texture->service_id(), GL_TEXTURE_2D); - if (image->CopyTexSubImage(GL_TEXTURE_2D, gfx::Point(xoffset, yoffset), + &state_, dest_texture->service_id(), dest_target); + if (image->CopyTexSubImage(dest_target, gfx::Point(xoffset, yoffset), gfx::Rect(x, y, width, height))) { return; } } - DoCopyTexImageIfNeeded(source_texture, source_texture->target()); + DoCopyTexImageIfNeeded(source_texture, source_target); // TODO(hkuang): get the StreamTexture transform matrix in GPU process. // crbug.com/226218. copy_texture_CHROMIUM_->DoCopySubTexture( - this, source_texture->target(), source_texture->service_id(), + this, source_target, source_texture->service_id(), source_internal_format, dest_texture->service_id(), dest_internal_format, xoffset, yoffset, x, y, width, height, dest_width, dest_height, source_width, source_height, @@ -13570,8 +13569,7 @@ void GLES2DecoderImpl::DoCompressedCopyTextureCHROMIUM(GLenum target, } if (!ValidateCompressedCopyTextureCHROMIUM( - "glCompressedCopyTextureCHROMIUM", - target, + "glCompressedCopyTextureCHROMIUM", target, source_texture_ref, dest_texture_ref)) { return; } @@ -13767,7 +13765,7 @@ void GLES2DecoderImpl::DoCompressedCopySubTextureCHROMIUM(GLenum target, if (!ValidateCompressedCopyTextureCHROMIUM( "glCompressedCopySubTextureCHROMIUM", target, source_texture_ref, - dest_texture_ref)) { + dest_texture_ref)) { return; } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index badfbcd..c6da4ef 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -4405,7 +4405,6 @@ error::Error GLES2DecoderImpl::HandleCopyTextureCHROMIUM( const gles2::cmds::CopyTextureCHROMIUM& c = *static_cast<const gles2::cmds::CopyTextureCHROMIUM*>(cmd_data); (void)c; - GLenum target = static_cast<GLenum>(c.target); GLenum source_id = static_cast<GLenum>(c.source_id); GLenum dest_id = static_cast<GLenum>(c.dest_id); GLint internalformat = static_cast<GLint>(c.internalformat); @@ -4425,7 +4424,7 @@ error::Error GLES2DecoderImpl::HandleCopyTextureCHROMIUM( "dest_type"); return error::kNoError; } - DoCopyTextureCHROMIUM(target, source_id, dest_id, internalformat, dest_type, + DoCopyTextureCHROMIUM(source_id, dest_id, internalformat, dest_type, unpack_flip_y, unpack_premultiply_alpha, unpack_unmultiply_alpha); return error::kNoError; @@ -4437,7 +4436,6 @@ error::Error GLES2DecoderImpl::HandleCopySubTextureCHROMIUM( const gles2::cmds::CopySubTextureCHROMIUM& c = *static_cast<const gles2::cmds::CopySubTextureCHROMIUM*>(cmd_data); (void)c; - GLenum target = static_cast<GLenum>(c.target); GLenum source_id = static_cast<GLenum>(c.source_id); GLenum dest_id = static_cast<GLenum>(c.dest_id); GLint xoffset = static_cast<GLint>(c.xoffset); @@ -4461,9 +4459,9 @@ error::Error GLES2DecoderImpl::HandleCopySubTextureCHROMIUM( "height < 0"); return error::kNoError; } - DoCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset, yoffset, x, y, - width, height, unpack_flip_y, - unpack_premultiply_alpha, unpack_unmultiply_alpha); + DoCopySubTextureCHROMIUM(source_id, dest_id, xoffset, yoffset, x, y, width, + height, unpack_flip_y, unpack_premultiply_alpha, + unpack_unmultiply_alpha); return error::kNoError; } diff --git a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc index 7cdfb0c..682f0d7 100644 --- a/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc +++ b/gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc @@ -76,14 +76,14 @@ TEST_P(GLCopyTextureCHROMIUMTest, Basic) { pixels); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { glBindTexture(GL_TEXTURE_2D, textures_[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } EXPECT_TRUE(glGetError() == GL_NO_ERROR); @@ -123,11 +123,11 @@ TEST_P(GLCopyTextureCHROMIUMTest, ImmutableTexture) { EXPECT_TRUE(glGetError() == GL_NO_ERROR); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(glGetError() == GL_INVALID_OPERATION); } else { - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_NO_ERROR); @@ -161,7 +161,7 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormat) { EXPECT_TRUE(GL_NO_ERROR == glGetError()); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], + glCopyTextureCHROMIUM(textures_[0], textures_[1], dest_formats[dest_index], GL_UNSIGNED_BYTE, false, false, false); } else { @@ -170,7 +170,7 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormat) { dest_formats[dest_index], GL_UNSIGNED_BYTE, nullptr); EXPECT_TRUE(GL_NO_ERROR == glGetError()); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } @@ -193,7 +193,7 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { for (size_t dest_index = 0; dest_index < arraysize(unsupported_dest_formats); dest_index++) { if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], + glCopyTextureCHROMIUM(textures_[0], textures_[1], unsupported_dest_formats[dest_index], GL_UNSIGNED_BYTE, false, false, false); } else { @@ -201,7 +201,7 @@ TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { glTexImage2D(GL_TEXTURE_2D, 0, unsupported_dest_formats[dest_index], 1, 1, 0, unsupported_dest_formats[dest_index], GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } EXPECT_TRUE(GL_INVALID_OPERATION == glGetError()) @@ -242,7 +242,7 @@ TEST_F(GLCopyTextureCHROMIUMTest, RedefineDestinationTexture) { // If the dest texture has different properties, glCopyTextureCHROMIUM() // redefines them. - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(GL_NO_ERROR == glGetError()); @@ -310,10 +310,10 @@ TEST_P(GLCopyTextureCHROMIUMTest, BasicStatePreservation) { glActiveTexture(GL_TEXTURE1 + x); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } EXPECT_TRUE(GL_NO_ERROR == glGetError()); @@ -369,10 +369,10 @@ TEST_P(GLCopyTextureCHROMIUMTest, TextureStatePreserved) { glBindTexture(GL_TEXTURE_2D, texture_ids[1]); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } EXPECT_TRUE(GL_NO_ERROR == glGetError()); @@ -441,10 +441,10 @@ TEST_P(GLCopyTextureCHROMIUMTest, FBOStatePreserved) { GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_color); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } EXPECT_TRUE(GL_NO_ERROR == glGetError()); @@ -554,13 +554,13 @@ TEST_P(GLCopyTextureCHROMIUMTest, ProgramStatePreservation) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { glBindTexture(GL_TEXTURE_2D, textures_[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, 1, 1, false, false, false); } @@ -586,13 +586,13 @@ TEST_P(GLCopyTextureCHROMIUMTest, UninitializedSource) { GL_UNSIGNED_BYTE, nullptr); if (copy_type == TexImage) { - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); } else { glBindTexture(GL_TEXTURE_2D, textures_[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kWidth, kHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 0, 0, kWidth, kHeight, false, false, false); } EXPECT_TRUE(GL_NO_ERROR == glGetError()); @@ -620,27 +620,27 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureDimension) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 1, 1, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(GL_NO_ERROR == glGetError()); // xoffset < 0 - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], -1, 1, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], -1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); // x < 0 - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 1, 1, -1, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, -1, 0, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); // xoffset + width > dest_width - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 2, 2, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 2, 2, 0, 0, 2, 2, false, false, false); EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); // x + width > source_width - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 0, 1, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 0, 1, 1, 2, 2, false, false, false); EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); } @@ -654,19 +654,19 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopyTextureInvalidTextureIds) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], 99993, GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], 99993, GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopyTextureCHROMIUM(GL_TEXTURE_2D, 99994, textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(99994, textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopyTextureCHROMIUM(GL_TEXTURE_2D, 99995, 99996, GL_RGBA, GL_UNSIGNED_BYTE, + glCopyTextureCHROMIUM(99995, 99996, GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopyTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], GL_RGBA, + glCopyTextureCHROMIUM(textures_[0], textures_[1], GL_RGBA, GL_UNSIGNED_BYTE, false, false, false); EXPECT_TRUE(GL_NO_ERROR == glGetError()); } @@ -680,19 +680,19 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureInvalidTextureIds) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], 99993, 1, 1, 0, 0, 1, 1, + glCopySubTextureCHROMIUM(textures_[0], 99993, 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, 99994, textures_[1], 1, 1, 0, 0, 1, 1, + glCopySubTextureCHROMIUM(99994, textures_[1], 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, 99995, 99996, 1, 1, 0, 0, 1, 1, false, + glCopySubTextureCHROMIUM(99995, 99996, 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(GL_INVALID_VALUE == glGetError()); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 1, 1, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(GL_NO_ERROR == glGetError()); } @@ -710,13 +710,13 @@ TEST_F(GLCopyTextureCHROMIUMTest, CopySubTextureOffset) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, transparent_pixels); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 1, 1, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 1, 0, 0, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_NO_ERROR); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 1, 0, 1, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 1, 0, 1, 0, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_NO_ERROR); - glCopySubTextureCHROMIUM(GL_TEXTURE_2D, textures_[0], textures_[1], 0, 1, 0, + glCopySubTextureCHROMIUM(textures_[0], textures_[1], 0, 1, 0, 1, 1, 1, false, false, false); EXPECT_TRUE(glGetError() == GL_NO_ERROR); |