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 5bf0492c8d49a6650c21b06423fe6c87ad236e7a..d8571ebe1a1124effd65900490c0abe61e8df540 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -11393,6 +11393,10 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D( |
| Clip(x, width, size.width(), ©X, ©Width); |
| Clip(y, height, size.height(), ©Y, ©Height); |
| + xoffset += (copyX - x); |
|
Zhenyao Mo
2016/01/20 00:26:49
What I mean is, do not modify xoffset, yoffset, wi
qiankun
2016/01/20 01:02:50
Done.
|
| + yoffset += (copyY - y); |
| + width = copyWidth; |
| + height = copyHeight; |
| if (xoffset != 0 || yoffset != 0 || width != size.width() || |
| height != size.height()) { |
| gfx::Rect cleared_rect; |
| @@ -11417,31 +11421,9 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D( |
| texture_manager()->SetLevelCleared(texture_ref, target, level, true); |
| } |
| - if (copyX != x || |
| - copyY != y || |
| - copyWidth != width || |
| - copyHeight != height) { |
| - // some part was clipped so clear the sub rect. |
| - uint32_t pixels_size = 0; |
| - if (!GLES2Util::ComputeImageDataSizes( |
| - width, height, 1, format, type, state_.unpack_alignment, &pixels_size, |
| - NULL, NULL)) { |
| - LOCAL_SET_GL_ERROR( |
| - GL_INVALID_VALUE, "glCopyTexSubImage2D", "dimensions too large"); |
| - return; |
| - } |
| - scoped_ptr<char[]> zero(new char[pixels_size]); |
| - memset(zero.get(), 0, pixels_size); |
| - glTexSubImage2D( |
| - target, level, xoffset, yoffset, width, height, |
| - format, type, zero.get()); |
| - } |
| - |
| if (copyHeight > 0 && copyWidth > 0) { |
| - GLint dx = copyX - x; |
| - GLint dy = copyY - y; |
| - GLint destX = xoffset + dx; |
| - GLint destY = yoffset + dy; |
| + GLint destX = xoffset; |
| + GLint destY = yoffset; |
| glCopyTexSubImage2D(target, level, |
| destX, destY, copyX, copyY, |
| copyWidth, copyHeight); |