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

Unified Diff: gpu/command_buffer/service/gl_stream_texture_image.h

Issue 2150993002: Revert of Always apply UniformMatrix4fvStreamTextureMatrixCHROMIUM matrix argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/gl_stream_texture_image.h
diff --git a/gpu/command_buffer/service/gl_stream_texture_image.h b/gpu/command_buffer/service/gl_stream_texture_image.h
index 747a44ac8b241d0c64f0c6d91aef43933f9fbc47..b5bc370c5ba58af945a348050c9229c9f7fc5b40 100644
--- a/gpu/command_buffer/service/gl_stream_texture_image.h
+++ b/gpu/command_buffer/service/gl_stream_texture_image.h
@@ -20,24 +20,19 @@
// Get the matrix.
// Copy the texture matrix for this image into |matrix|.
// Subclasses must return a matrix appropriate for a coordinate system where
- // UV=(0,0) corresponds to the top left corner of the image.
+ // UV=(0,0) corresponds to the bottom left corner of the image.
virtual void GetTextureMatrix(float matrix[16]) = 0;
+ // Copy the texture matrix for this image into |matrix|, returning a matrix
+ // for which UV=(0,0) corresponds to the top left of corner of the image,
+ // which is what Chromium generally expects.
+ void GetFlippedTextureMatrix(float matrix[16]) {
+ GetTextureMatrix(matrix);
+ matrix[13] += matrix[5];
+ matrix[5] = -matrix[5];
+ }
protected:
~GLStreamTextureImage() override {}
-
- // Convenience function for subclasses that deal with SurfaceTextures, whose
- // coordinate system has (0,0) at the bottom left of the image.
- // [ a e i m ] [ 1 0 0 0 ] [ a -e i m+e ]
- // [ b f j n ] [ 0 -1 0 1 ] = [ b -f j n+f ]
- // [ c g k o ] [ 0 0 1 0 ] [ c -g k o+g ]
- // [ d h l p ] [ 0 0 0 1 ] [ d -h l p+h ]
- static void YInvertMatrix(float matrix[16]) {
- for (int i = 0; i < 4; ++i) {
- matrix[i + 12] += matrix[i + 4];
- matrix[i + 4] = -matrix[i + 4];
- }
- }
private:
DISALLOW_COPY_AND_ASSIGN(GLStreamTextureImage);
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698