| 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 e9fb769156909867595e4de8ac15bdf2fa3ffb1a..8c275fd00b0caab4108f8bc204981165649a9cac 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -951,7 +951,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
| GLintptr writeoffset,
|
| GLsizeiptr size);
|
|
|
| - void DoCopyTextureCHROMIUM(GLuint source_id,
|
| + void DoCopyTextureCHROMIUM(GLenum target,
|
| + GLuint source_id,
|
| GLint source_level,
|
| GLuint dest_id,
|
| GLint dest_level,
|
| @@ -961,7 +962,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
| GLboolean unpack_premultiply_alpha,
|
| GLboolean unpack_unmultiply_alpha);
|
|
|
| - void DoCopySubTextureCHROMIUM(GLuint source_id,
|
| + void DoCopySubTextureCHROMIUM(GLenum target,
|
| + GLuint source_id,
|
| GLint source_level,
|
| GLuint dest_id,
|
| GLint dest_level,
|
| @@ -2019,6 +2021,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
| GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
| Texture* texture);
|
| bool ValidateCopyTextureCHROMIUMTextures(const char* function_name,
|
| + GLenum target,
|
| TextureRef* source_texture_ref,
|
| TextureRef* dest_texture_ref);
|
| CopyTextureMethod ValidateCopyTextureCHROMIUMInternalFormats(
|
| @@ -16133,6 +16136,7 @@ bool GLES2DecoderImpl::DoIsSync(GLuint client_id) {
|
|
|
| bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMTextures(
|
| const char* function_name,
|
| + GLenum target,
|
| TextureRef* source_texture_ref,
|
| TextureRef* dest_texture_ref) {
|
| if (!source_texture_ref || !dest_texture_ref) {
|
| @@ -16148,8 +16152,15 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMTextures(
|
| return false;
|
| }
|
|
|
| + if (dest_texture->target() !=
|
| + GLES2Util::GLFaceTargetToTextureTarget(target)) {
|
| + LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name,
|
| + "target should be aligned with dest target");
|
| + return false;
|
| + }
|
| switch (dest_texture->target()) {
|
| case GL_TEXTURE_2D:
|
| + case GL_TEXTURE_CUBE_MAP:
|
| case GL_TEXTURE_RECTANGLE_ARB:
|
| break;
|
| default:
|
| @@ -16332,6 +16343,7 @@ bool GLES2DecoderImpl::ValidateCompressedCopyTextureCHROMIUM(
|
| }
|
|
|
| void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
|
| + GLenum target,
|
| GLuint source_id,
|
| GLint source_level,
|
| GLuint dest_id,
|
| @@ -16347,8 +16359,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
|
| TextureRef* source_texture_ref = GetTexture(source_id);
|
| TextureRef* dest_texture_ref = GetTexture(dest_id);
|
|
|
| - if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref,
|
| - dest_texture_ref)) {
|
| + if (!ValidateCopyTextureCHROMIUMTextures(
|
| + kFunctionName, target, source_texture_ref, dest_texture_ref)) {
|
| return;
|
| }
|
|
|
| @@ -16532,6 +16544,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
|
| }
|
|
|
| void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
|
| + GLenum target,
|
| GLuint source_id,
|
| GLint source_level,
|
| GLuint dest_id,
|
| @@ -16551,8 +16564,8 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
|
| TextureRef* source_texture_ref = GetTexture(source_id);
|
| TextureRef* dest_texture_ref = GetTexture(dest_id);
|
|
|
| - if (!ValidateCopyTextureCHROMIUMTextures(kFunctionName, source_texture_ref,
|
| - dest_texture_ref)) {
|
| + if (!ValidateCopyTextureCHROMIUMTextures(
|
| + kFunctionName, target, source_texture_ref, dest_texture_ref)) {
|
| return;
|
| }
|
|
|
|
|