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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1586053002: Reland of Untouch out of bound pixels for CopyTexSubImage2D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments#5 Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(), &copyX, &copyWidth);
Clip(y, height, size.height(), &copyY, &copyHeight);
+ 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698