| 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 0d778f3570ed2ab036adb03d327847c825248b4c..f56d47bad381a31ed09cf508a1ba09d9314b97b6 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -9145,10 +9145,17 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D(
|
| Clip(x, width, size.width(), ©X, ©Width);
|
| Clip(y, height, size.height(), ©Y, ©Height);
|
|
|
| - if (!texture_manager()->ClearTextureLevel(this, texture_ref, target, level)) {
|
| - LOCAL_SET_GL_ERROR(
|
| - GL_OUT_OF_MEMORY, "glCopyTexSubImage2D", "dimensions too big");
|
| - return;
|
| + if (xoffset != 0 || yoffset != 0 || width != size.width() ||
|
| + height != size.height()) {
|
| + if (!texture_manager()->ClearTextureLevel(this, texture_ref, target,
|
| + level)) {
|
| + LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCopyTexSubImage2D",
|
| + "dimensions too big");
|
| + return;
|
| + }
|
| + } else {
|
| + // Write all pixels in below.
|
| + texture_manager()->SetLevelCleared(texture_ref, target, level, true);
|
| }
|
|
|
| if (copyX != x ||
|
|
|