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

Side by Side Diff: gpu/command_buffer/service/gl_stream_texture_image.h

Issue 1746983002: Make Android StreamTexture implement GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't remove the default stream texture matrix from cc/layers Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_
7 7
8 #include "gpu/gpu_export.h" 8 #include "gpu/gpu_export.h"
9 #include "ui/gl/gl_image.h" 9 #include "ui/gl/gl_image.h"
10 10
11 namespace gpu { 11 namespace gpu {
12 namespace gles2 { 12 namespace gles2 {
13 13
14 // Specialization of GLImage that allows us to support (stream) textures 14 // Specialization of GLImage that allows us to support (stream) textures
15 // that supply a texture matrix. 15 // that supply a texture matrix.
16 class GPU_EXPORT GLStreamTextureImage : public gl::GLImage { 16 class GPU_EXPORT GLStreamTextureImage : public gl::GLImage {
17 public: 17 public:
18 GLStreamTextureImage() {} 18 GLStreamTextureImage() {}
19 19
20 // Get the matrix. 20 // Get the matrix.
21 // Copy the texture matrix for this image into |matrix|. 21 // Copy the texture matrix for this image into |matrix|.
22 // Subclasses must return a matrix appropriate for a coordinate system where
23 // UV=(0,0) corresponds to the bottom left corner of the image.
22 virtual void GetTextureMatrix(float matrix[16]) = 0; 24 virtual void GetTextureMatrix(float matrix[16]) = 0;
23 25
26 // Copy the texture matrix for this image into |matrix|, returning a matrix
27 // for which UV=(0,0) corresponds to the top left of corner of the image,
28 // which is what Chromium generally expects.
29 void GetFlippedTextureMatrix(float matrix[16]) {
30 GetTextureMatrix(matrix);
31 matrix[13] += matrix[5];
32 matrix[5] = -matrix[5];
33 }
24 protected: 34 protected:
25 ~GLStreamTextureImage() override {} 35 ~GLStreamTextureImage() override {}
26 36
27 private: 37 private:
28 DISALLOW_COPY_AND_ASSIGN(GLStreamTextureImage); 38 DISALLOW_COPY_AND_ASSIGN(GLStreamTextureImage);
29 }; 39 };
30 40
31 } // namespace gles2 41 } // namespace gles2
32 } // namespace gpu 42 } // namespace gpu
33 43
34 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_ 44 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_STREAM_TEXTURE_IMAGE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698