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

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

Issue 1746983002: Make Android StreamTexture implement GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove resolved TODO Created 4 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
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 7a1628fc6b835178865826192bd7a0a85530230e..a25809d7ea1e69862bbc5ffc474ed7a6df5fb18f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -13551,13 +13551,9 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
DoCopyTexImageIfNeeded(source_texture, source_target);
- // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix
+ // GL_TEXTURE_EXTERNAL_OES texture requires that we apply a transform matrix
// before presenting.
if (source_target == GL_TEXTURE_EXTERNAL_OES) {
- // TODO(hkuang): get the StreamTexture transform matrix in GPU process
- // instead of using kIdentityMatrix crbug.com/226218. AVDACodecImage does
- // this correctly, but others (e.g., stream_texture_android.cc) don't.
- // (crbug.com/371500, crbug.com/588837)
GLfloat transform_matrix[16];
memcpy(transform_matrix, kIdentityMatrix, sizeof(transform_matrix));
no sievers 2016/03/01 00:50:27 nit: Looks like we can get rid of |kIdentityMatrix
Tobias Sargeant 2016/03/01 21:56:12 Done.
if (GLStreamTextureImage* image =
@@ -13749,16 +13745,38 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
DoCopyTexImageIfNeeded(source_texture, source_target);
- // TODO(hkuang): get the StreamTexture transform matrix in GPU process.
- // crbug.com/226218.
liberato (no reviews please) 2016/02/29 22:33:32 you don't have 226218 in the BUG= .
Tobias Sargeant 2016/02/29 23:57:50 Done.
- copy_texture_CHROMIUM_->DoCopySubTexture(
- this, source_target, source_texture->service_id(), source_internal_format,
- dest_target, dest_texture->service_id(), dest_internal_format,
- xoffset, yoffset, x, y, width, height, dest_width, dest_height,
- source_width, source_height,
- unpack_flip_y == GL_TRUE,
- unpack_premultiply_alpha == GL_TRUE,
- unpack_unmultiply_alpha == GL_TRUE);
+
+ // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix
+ // before presenting.
+ if (source_target == GL_TEXTURE_EXTERNAL_OES) {
+ // TODO(hkuang): get the StreamTexture transform matrix in GPU process
+ // instead of using kIdentityMatrix crbug.com/226218. AVDACodecImage does
+ // this correctly, but others (e.g., stream_texture_android.cc) don't.
no sievers 2016/03/01 00:50:27 you are fixing this TODO right?
Tobias Sargeant 2016/03/01 21:56:11 Done.
+ // (crbug.com/371500, crbug.com/588837)
+ GLfloat transform_matrix[16];
+ memcpy(transform_matrix, kIdentityMatrix, sizeof(transform_matrix));
+ if (GLStreamTextureImage* image =
+ source_texture->GetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES,
+ 0)) {
+ image->GetTextureMatrix(transform_matrix);
+ }
+ copy_texture_CHROMIUM_->DoCopySubTextureWithTransform(
no sievers 2016/03/01 00:50:27 see above: if no matrix override we can fall throu
Tobias Sargeant 2016/03/01 21:56:12 Done.
+ this, source_target, source_texture->service_id(),
+ source_internal_format, dest_target, dest_texture->service_id(),
+ dest_internal_format, xoffset, yoffset, x, y, width, height, dest_width,
+ dest_height, source_width, source_height, unpack_flip_y == GL_TRUE,
+ unpack_premultiply_alpha == GL_TRUE,
+ unpack_unmultiply_alpha == GL_TRUE,
+ transform_matrix);
+ } else {
+ copy_texture_CHROMIUM_->DoCopySubTexture(
+ this, source_target, source_texture->service_id(),
+ source_internal_format, dest_target, dest_texture->service_id(),
+ dest_internal_format, xoffset, yoffset, x, y, width, height, dest_width,
+ dest_height, source_width, source_height, unpack_flip_y == GL_TRUE,
+ unpack_premultiply_alpha == GL_TRUE,
+ unpack_unmultiply_alpha == GL_TRUE);
+ }
}
void GLES2DecoderImpl::DoCompressedCopyTextureCHROMIUM(GLuint source_id,
@@ -13919,11 +13937,9 @@ void GLES2DecoderImpl::DoCompressedCopyTextureCHROMIUM(GLuint source_id,
source_height, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
gfx::Rect(source_width, source_height));
- // GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix
+ // GL_TEXTURE_EXTERNAL_OES texture requires that we 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 kIdentityMatrix crbug.com/226218.
copy_texture_CHROMIUM_->DoCopyTextureWithTransform(
this, source_texture->target(), source_texture->service_id(),
dest_texture->target(), dest_texture->service_id(), source_width,

Powered by Google App Engine
This is Rietveld 408576698