Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index 849edbb3f448213cd00b13a8d99f2b0a3755f803..6a859ae9a137ab61f85feba1b8bbcf216662c694 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -969,6 +969,18 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { |
| GLsizei image_size, |
| const void* data); |
| + // Wrapper for CopyTexSubImage3D. |
| + void DoCopyTexSubImage3D( |
| + GLenum target, |
| + GLint level, |
| + GLint xoffset, |
| + GLint yoffset, |
| + GLint zoffset, |
| + GLint x, |
| + GLint y, |
| + GLsizei width, |
| + GLsizei height); |
| + |
| // Validate if |format| is valid for CopyTex{Sub}Image functions. |
| // If not, generate a GL error and return false. |
| bool ValidateCopyTexFormat(const char* func_name, GLenum internal_format, |
| @@ -12583,6 +12595,33 @@ void GLES2DecoderImpl::DoCompressedTexSubImage3D( |
| ExitCommandProcessingEarly(); |
| } |
| +void GLES2DecoderImpl::DoCopyTexSubImage3D( |
| + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, |
| + GLint x, GLint y, GLsizei width, GLsizei height) { |
| + if (!texture_manager()->ValidForTarget(target, level, width, height, 1)) { |
|
Zhenyao Mo
2016/07/26 13:25:55
Please look at CopyTexSubImage2D. You will need m
yunchao
2016/07/26 13:30:50
Acknowledged.
|
| + LOCAL_SET_GL_ERROR( |
| + GL_INVALID_VALUE, |
| + "glCopyTexSubImage3D", "dimensions out of range"); |
|
Zhenyao Mo
2016/07/26 13:25:55
nit: define a const char* function_name, so you do
yunchao
2016/07/26 13:30:50
Acknowledged.
|
| + return; |
| + } |
| + TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
| + &state_, target); |
| + if (!texture_ref) { |
| + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glCopyTexSubImage3D", |
| + "unknown texture for target"); |
| + return; |
| + } |
| + Texture* texture = texture_ref->texture(); |
| + if (!texture->ValidForTexture(target, level, xoffset, yoffset, zoffset, |
| + width, height, 1)) { |
| + LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopyTexSubImage3D", |
| + "bad dimensions"); |
| + return; |
| + } |
| + glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, |
| + height); |
| +} |
| + |
| error::Error GLES2DecoderImpl::HandleTexImage2D(uint32_t immediate_data_size, |
| const void* cmd_data) { |
| const gles2::cmds::TexImage2D& c = |