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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 GLenum source_internal_format, | 36 GLenum source_internal_format, |
37 GLuint dest_id, | 37 GLuint dest_id, |
38 GLint dest_level, | 38 GLint dest_level, |
39 GLenum dest_internal_format, | 39 GLenum dest_internal_format, |
40 GLsizei width, | 40 GLsizei width, |
41 GLsizei height, | 41 GLsizei height, |
42 bool flip_y, | 42 bool flip_y, |
43 bool premultiply_alpha, | 43 bool premultiply_alpha, |
44 bool unpremultiply_alpha); | 44 bool unpremultiply_alpha); |
45 | 45 |
| 46 void DoCopySubTexture(const gles2::GLES2Decoder* decoder, |
| 47 GLenum source_target, |
| 48 GLuint source_id, |
| 49 GLenum source_internal_format, |
| 50 GLuint dest_id, |
| 51 GLint dest_level, |
| 52 GLenum dest_internal_format, |
| 53 GLint xoffset, |
| 54 GLint yoffset, |
| 55 GLsizei dest_width, |
| 56 GLsizei dest_height, |
| 57 GLsizei source_width, |
| 58 GLsizei source_height, |
| 59 bool flip_y, |
| 60 bool premultiply_alpha, |
| 61 bool unpremultiply_alpha); |
| 62 |
46 // This will apply a transform on the source texture before copying to | 63 // This will apply a transform on the source texture before copying to |
47 // destination texture. | 64 // destination texture. |
48 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, | 65 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, |
49 GLenum source_target, | 66 GLenum source_target, |
50 GLuint source_id, | 67 GLuint source_id, |
51 GLuint dest_id, | 68 GLuint dest_id, |
52 GLint dest_level, | 69 GLint dest_level, |
53 GLsizei width, | 70 GLsizei width, |
54 GLsizei height, | 71 GLsizei height, |
55 bool flip_y, | 72 bool flip_y, |
56 bool premultiply_alpha, | 73 bool premultiply_alpha, |
57 bool unpremultiply_alpha, | 74 bool unpremultiply_alpha, |
58 const GLfloat transform_matrix[16]); | 75 const GLfloat transform_matrix[16]); |
59 | 76 |
| 77 void DoCopySubTextureWithTransform(const gles2::GLES2Decoder* decoder, |
| 78 GLenum source_target, |
| 79 GLuint source_id, |
| 80 GLuint dest_id, |
| 81 GLint dest_level, |
| 82 GLint xoffset, |
| 83 GLint yoffset, |
| 84 GLsizei dest_width, |
| 85 GLsizei dest_height, |
| 86 GLsizei source_width, |
| 87 GLsizei source_height, |
| 88 bool flip_y, |
| 89 bool premultiply_alpha, |
| 90 bool unpremultiply_alpha, |
| 91 const GLfloat transform_matrix[16]); |
| 92 |
60 // The attributes used during invocation of the extension. | 93 // The attributes used during invocation of the extension. |
61 static const GLuint kVertexPositionAttrib = 0; | 94 static const GLuint kVertexPositionAttrib = 0; |
62 | 95 |
63 private: | 96 private: |
64 struct ProgramInfo { | 97 struct ProgramInfo { |
65 ProgramInfo() | 98 ProgramInfo() |
66 : program(0u), | 99 : program(0u), |
67 matrix_handle(0u), | 100 matrix_handle(0u), |
68 half_size_handle(0u), | 101 half_size_handle(0u), |
69 sampler_handle(0u) {} | 102 sampler_handle(0u) {} |
70 | 103 |
71 GLuint program; | 104 GLuint program; |
72 GLuint matrix_handle; | 105 GLuint matrix_handle; |
73 GLuint half_size_handle; | 106 GLuint half_size_handle; |
74 GLuint sampler_handle; | 107 GLuint sampler_handle; |
75 }; | 108 }; |
76 | 109 |
| 110 void DoCopyTextureInternal(const gles2::GLES2Decoder* decoder, |
| 111 GLenum source_target, |
| 112 GLuint source_id, |
| 113 GLuint dest_id, |
| 114 GLint dest_level, |
| 115 GLint xoffset, |
| 116 GLint yoffset, |
| 117 GLsizei dest_width, |
| 118 GLsizei dest_height, |
| 119 GLsizei source_width, |
| 120 GLsizei source_height, |
| 121 bool flip_y, |
| 122 bool premultiply_alpha, |
| 123 bool unpremultiply_alpha, |
| 124 const GLfloat transform_matrix[16]); |
| 125 |
77 bool initialized_; | 126 bool initialized_; |
78 typedef std::vector<GLuint> ShaderVector; | 127 typedef std::vector<GLuint> ShaderVector; |
79 ShaderVector vertex_shaders_; | 128 ShaderVector vertex_shaders_; |
80 ShaderVector fragment_shaders_; | 129 ShaderVector fragment_shaders_; |
81 typedef std::pair<int, int> ProgramMapKey; | 130 typedef std::pair<int, int> ProgramMapKey; |
82 typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap; | 131 typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap; |
83 ProgramMap programs_; | 132 ProgramMap programs_; |
84 GLuint buffer_id_; | 133 GLuint buffer_id_; |
85 GLuint framebuffer_; | 134 GLuint framebuffer_; |
86 | 135 |
87 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); | 136 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); |
88 }; | 137 }; |
89 | 138 |
90 } // namespace gpu. | 139 } // namespace gpu. |
91 | 140 |
92 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 141 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
OLD | NEW |