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

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

Issue 2418433002: Use gfx::Rect::Intersect() to clip for CopyTex{Sub}Image functions. (Closed)
Patch Set: Created 4 years, 2 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 | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index dbe95db5b0987cc247aae5d060983263bef23dea..0ab416a494992fb4217fb1430d632b767d676489 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1115,12 +1115,15 @@ bool Texture::ValidForTexture(
int32_t max_x;
int32_t max_y;
int32_t max_z;
- return SafeAddInt32(xoffset, width, &max_x) &&
- SafeAddInt32(yoffset, height, &max_y) &&
- SafeAddInt32(zoffset, depth, &max_z) &&
- xoffset >= 0 &&
+ return xoffset >= 0 &&
yoffset >= 0 &&
zoffset >= 0 &&
+ width >= 0 &&
+ height >= 0 &&
+ depth >= 0 &&
+ SafeAddInt32(xoffset, width, &max_x) &&
+ SafeAddInt32(yoffset, height, &max_y) &&
+ SafeAddInt32(zoffset, depth, &max_z) &&
max_x <= info.width &&
max_y <= info.height &&
max_z <= info.depth;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698