OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
7 | 7 |
8 #include "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
9 #include "gpu/gpu_export.h" | 9 #include "gpu/gpu_export.h" |
10 | 10 |
11 namespace gpu { | 11 namespace gpu { |
12 namespace gles2 { | 12 namespace gles2 { |
13 | 13 |
14 class GLES2Decoder; | 14 class GLES2Decoder; |
15 | 15 |
16 } // namespace gles2. | 16 } // namespace gles2. |
17 | 17 |
18 // This class encapsulates the resources required to implement the | 18 // This class encapsulates the resources required to implement the |
19 // GL_CHROMIUM_copy_texture extension. The copy operation is performed | 19 // GL_CHROMIUM_copy_texture extension. The copy operation is performed |
20 // via a blit to a framebuffer object. | 20 // via a blit to a framebuffer object. |
21 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { | 21 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { |
22 public: | 22 public: |
23 CopyTextureCHROMIUMResourceManager() : initialized_(false) {} | 23 CopyTextureCHROMIUMResourceManager() : initialized_(false) {} |
24 | 24 |
25 void Initialize(const gles2::GLES2Decoder* decoder); | 25 void Initialize(const gles2::GLES2Decoder* decoder); |
26 void Destroy(); | 26 void Destroy(); |
27 | 27 |
28 void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target, | 28 void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target, |
scherkus (not reviewing)
2013/04/10 00:05:08
there only appear to be two callers:
https://code.
hkuang1
2013/04/10 01:32:35
Yes. On Android, the video frames are emitted as s
| |
29 GLenum dest_target, GLuint source_id, GLuint dest_id, | 29 GLenum dest_target, GLuint source_id, GLuint dest_id, |
30 GLint level, GLsizei width, GLsizei height, | 30 GLint level, GLsizei width, GLsizei height, |
31 bool flip_y, bool premultiply_alpha, | 31 bool flip_y, bool premultiply_alpha, |
32 bool unpremultiply_alpha); | 32 bool unpremultiply_alpha); |
33 | 33 |
34 // This will apply a transform on the source texture before copying to | |
35 // destination texture. | |
36 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, | |
37 GLenum source_target, GLenum dest_target, | |
38 GLuint source_id, GLuint dest_id, GLint level, | |
39 GLsizei width, GLsizei height, bool flip_y, | |
40 bool premultiply_alpha, | |
41 bool unpremultiply_alpha, | |
42 const GLfloat transform_matrix[16]); | |
43 | |
34 // The attributes used during invocation of the extension. | 44 // The attributes used during invocation of the extension. |
35 static const GLuint kVertexPositionAttrib = 0; | 45 static const GLuint kVertexPositionAttrib = 0; |
36 | 46 |
37 private: | 47 private: |
38 bool initialized_; | 48 bool initialized_; |
39 | 49 |
40 static const int kNumPrograms = 12; | 50 static const int kNumPrograms = 12; |
41 GLuint programs_[kNumPrograms]; | 51 GLuint programs_[kNumPrograms]; |
42 GLuint buffer_id_; | 52 GLuint buffer_id_; |
43 GLuint framebuffer_; | 53 GLuint framebuffer_; |
54 GLuint matrix_handle_[kNumPrograms]; | |
44 GLuint sampler_locations_[kNumPrograms]; | 55 GLuint sampler_locations_[kNumPrograms]; |
45 | 56 |
46 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); | 57 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); |
47 }; | 58 }; |
48 | 59 |
49 } // namespace gpu. | 60 } // namespace gpu. |
50 | 61 |
51 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 62 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
52 | 63 |
53 | 64 |
OLD | NEW |