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

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

Issue 13620008: Enable 2D Canvas painting for Chrome on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and addressing xhwang's comments. Created 7 years, 8 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 760b580ef198c006db5699378e1ea86413f76d3f..9413bd172095f6290a097bc21b866f192c7f9ec3 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9852,15 +9852,38 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
dest_texture, GL_TEXTURE_2D, level, true);
}
- copy_texture_CHROMIUM_->DoCopyTexture(this,
- source_texture->target(),
- dest_texture->target(),
- source_texture->service_id(),
- dest_texture->service_id(), level,
- source_width, source_height,
- unpack_flip_y_,
- unpack_premultiply_alpha_,
- unpack_unpremultiply_alpha_);
+ // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix
+ // before presenting.
+ if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) {
+ // TODO(hkuang): get the StreamTexture transform matrix in GPU process
+ // instead of using default matrix crbug.com/226218.
+ const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f};
+ copy_texture_CHROMIUM_->DoCopyTextureWithTransform(
+ this,
+ source_texture->target(),
+ dest_texture->target(),
+ source_texture->service_id(),
+ dest_texture->service_id(), level,
+ source_width, source_height,
+ unpack_flip_y_,
+ unpack_premultiply_alpha_,
+ unpack_unpremultiply_alpha_,
+ default_matrix);
+ } else {
+ copy_texture_CHROMIUM_->DoCopyTexture(
+ this,
+ source_texture->target(),
+ dest_texture->target(),
+ source_texture->service_id(),
+ dest_texture->service_id(), level,
+ source_width, source_height,
+ unpack_flip_y_,
+ unpack_premultiply_alpha_,
+ unpack_unpremultiply_alpha_);
+ }
}
static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc ('k') | webkit/media/android/webmediaplayer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698