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

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 Created 4 years, 9 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 f28cc4387e7832e07bdf8335f303ff646fd0293c..e4728293d3aaac1b8f9e96ac3a787925771f141c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -7617,16 +7617,9 @@ 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()) {
@@ -7634,6 +7627,19 @@ void GLES2DecoderImpl::DoUniformMatrix4fvStreamTextureMatrixCHROMIUM(
texture_ref->texture()->GetLevelStreamTextureImage(
GL_TEXTURE_EXTERNAL_OES, 0)) {
image->GetTextureMatrix(gl_matrix);
liberato (no reviews please) 2016/03/31 15:03:16 maybe not for this CL, but GetFlippedTextureMatrix
liberato (no reviews please) 2016/03/31 15:03:16 don't we want this to be GetFlippedTextureMatrix?
Tobias Sargeant 2016/04/01 11:59:10 Done. On reflection I decided against GetChromiumT
liberato (no reviews please) 2016/04/01 14:07:13 makes sense.
+ GLfloat tmp[16];
liberato (no reviews please) 2016/03/31 15:03:16 without this premultiply, does the y-flip without
+ for (int c = 0; c < 16; c += 4) {
+ for (int r = 0; r < 4; ++r) {
+ tmp[c + r] = 0.0f;
+ for (int i = 0; i < 4; ++i) {
+ tmp[c + r] += gl_matrix[r + 4 * i] * transform[c + i];
+ }
+ }
+ }
+ std::copy(tmp, tmp + 16, 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,

Powered by Google App Engine
This is Rietveld 408576698