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

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

Issue 1152693002: ui: Add sub region copy support to GLImage::CopyTexImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 38c99ba4a68f5b08c641f753a71eed1785aca6d0..bce5894767ac64c621ce87f76be71bc4d35f3b1d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -11873,8 +11873,10 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(GLenum target,
unpack_premultiply_alpha_ ^ unpack_unpremultiply_alpha_;
if (image && !unpack_flip_y_ && !unpack_premultiply_alpha_change) {
glBindTexture(GL_TEXTURE_2D, dest_texture->service_id());
- if (image->CopyTexImage(GL_TEXTURE_2D))
+ if (image->CopyTexSubImage(GL_TEXTURE_2D, gfx::Point(0, 0),
+ gfx::Rect(0, 0, source_width, source_height))) {
return;
+ }
}
DoWillUseTexImageIfNeeded(source_texture, source_texture->target());
@@ -12010,11 +12012,12 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(GLenum target,
// Try using GLImage::CopyTexSubImage when possible.
bool unpack_premultiply_alpha_change =
unpack_premultiply_alpha_ ^ unpack_unpremultiply_alpha_;
- if (image && !unpack_flip_y_ && !unpack_premultiply_alpha_change &&
- !xoffset && !yoffset) {
+ if (image && !unpack_flip_y_ && !unpack_premultiply_alpha_change) {
glBindTexture(GL_TEXTURE_2D, dest_texture->service_id());
- if (image->CopyTexImage(GL_TEXTURE_2D))
+ if (image->CopyTexSubImage(GL_TEXTURE_2D, gfx::Point(xoffset, yoffset),
+ gfx::Rect(0, 0, source_width, source_height))) {
return;
+ }
}
DoWillUseTexImageIfNeeded(source_texture, source_texture->target());
« no previous file with comments | « content/common/gpu/stream_texture_android.cc ('k') | 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