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

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

Issue 976063002: Cherry pick fix for bug 461847. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 10 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 | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | 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 0870c36b889bcd266ba85c623819e3152fa514b6..88e197483ec9bc5fec6a1349f8d9ea45c1de8973 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9140,10 +9140,17 @@ void GLES2DecoderImpl::DoCopyTexSubImage2D(
Clip(x, width, size.width(), &copyX, &copyWidth);
Clip(y, height, size.height(), &copyY, &copyHeight);
- 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 ||
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698