Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_autogen.h

Issue 1143373004: gpu: Extend CopyTextureCHROMIUM with support for copying part of source texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keep TODO for now Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index 26c4782a31059331862114114f1e28ab423a05fe..09d07c0b587862b0d8f9769f504db5bede9bd5df 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -4553,7 +4553,22 @@ error::Error GLES2DecoderImpl::HandleCopySubTextureCHROMIUM(
GLenum dest_id = static_cast<GLenum>(c.dest_id);
GLint xoffset = static_cast<GLint>(c.xoffset);
GLint yoffset = static_cast<GLint>(c.yoffset);
- DoCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset, yoffset);
+ GLint x = static_cast<GLint>(c.x);
+ GLint y = static_cast<GLint>(c.y);
+ GLsizei width = static_cast<GLsizei>(c.width);
+ GLsizei height = static_cast<GLsizei>(c.height);
+ if (width < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM",
+ "width < 0");
+ return error::kNoError;
+ }
+ if (height < 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glCopySubTextureCHROMIUM",
+ "height < 0");
+ return error::kNoError;
+ }
+ DoCopySubTextureCHROMIUM(target, source_id, dest_id, xoffset, yoffset, x, y,
+ width, height);
return error::kNoError;
}
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698