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

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

Issue 1818073002: Always apply UniformMatrix4fvStreamTextureMatrixCHROMIUM matrix argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase [If you wait by the river long enough, the bodies of your gyp files will float by] Created 4 years, 4 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 dc009c82bfd34e95ce3297b6a083858d5db9cb86..f4b237f2fab19298388785f792df4a5fdf2eaf31 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8553,23 +8553,26 @@ void GLES2DecoderImpl::DoUniformMatrix4fv(
void GLES2DecoderImpl::DoUniformMatrix4fvStreamTextureMatrixCHROMIUM(
GLint fake_location,
GLboolean transpose,
- const GLfloat* default_value) {
+ const GLfloat* transform) {
float gl_matrix[16];
- // If we can't get a matrix from the texture, then use a default.
- // TODO(liberato): remove |default_value| and replace with an identity matrix.
- // It is only present as a transitionary step until StreamTexture supplies
- // the matrix via GLImage. Once that happens, GLRenderer can quit sending
- // in a default.
- memcpy(gl_matrix, default_value, sizeof(gl_matrix));
-
// This refers to the bound external texture on the active unit.
TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
if (TextureRef* texture_ref = unit.bound_texture_external_oes.get()) {
if (GLStreamTextureImage* image =
texture_ref->texture()->GetLevelStreamTextureImage(
GL_TEXTURE_EXTERNAL_OES, 0)) {
+ gfx::Transform st_transform(gfx::Transform::kSkipInitialization);
+ gfx::Transform pre_transform(gfx::Transform::kSkipInitialization);
image->GetTextureMatrix(gl_matrix);
+ st_transform.matrix().setColMajorf(gl_matrix);
+ pre_transform.matrix().setColMajorf(transform);
+ gfx::Transform(pre_transform, st_transform)
+ .matrix()
+ .asColMajorf(gl_matrix);
+ } else {
+ // Missing stream texture. Treat matrix as identity.
+ memcpy(gl_matrix, transform, sizeof(gl_matrix));
}
} else {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
@@ -15254,10 +15257,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
if (GLStreamTextureImage* image =
source_texture->GetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES,
0)) {
- // The coordinate system of this matrix is y-up, not y-down, so a flip is
- // needed.
GLfloat transform_matrix[16];
- image->GetFlippedTextureMatrix(transform_matrix);
+ image->GetTextureMatrix(transform_matrix);
copy_texture_CHROMIUM_->DoCopyTextureWithTransform(
this, source_target, source_texture->service_id(), dest_target,
dest_texture->service_id(), source_width, source_height,
@@ -15432,17 +15433,14 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
DoCopyTexImageIfNeeded(source_texture, source_target);
-
// GL_TEXTURE_EXTERNAL_OES texture requires apply a transform matrix
// before presenting.
if (source_target == GL_TEXTURE_EXTERNAL_OES) {
if (GLStreamTextureImage* image =
source_texture->GetLevelStreamTextureImage(GL_TEXTURE_EXTERNAL_OES,
0)) {
- // The coordinate system of this matrix is y-up, not y-down, so a flip is
- // needed.
GLfloat transform_matrix[16];
- image->GetFlippedTextureMatrix(transform_matrix);
+ image->GetTextureMatrix(transform_matrix);
copy_texture_CHROMIUM_->DoCopySubTextureWithTransform(
this, source_target, source_texture->service_id(),
source_internal_format, dest_target, dest_texture->service_id(),
« no previous file with comments | « gpu/command_buffer/service/gl_stream_texture_image.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698