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 15 matching lines...) Expand all Loading... |
26 // The target of |dest_id| texture must be GL_TEXTURE_2D. | 26 // The target of |dest_id| texture must be GL_TEXTURE_2D. |
27 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { | 27 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { |
28 public: | 28 public: |
29 CopyTextureCHROMIUMResourceManager(); | 29 CopyTextureCHROMIUMResourceManager(); |
30 ~CopyTextureCHROMIUMResourceManager(); | 30 ~CopyTextureCHROMIUMResourceManager(); |
31 | 31 |
32 void Initialize(const gles2::GLES2Decoder* decoder, | 32 void Initialize(const gles2::GLES2Decoder* decoder, |
33 const gles2::FeatureInfo::FeatureFlags& feature_flags); | 33 const gles2::FeatureInfo::FeatureFlags& feature_flags); |
34 void Destroy(); | 34 void Destroy(); |
35 | 35 |
36 void DoCopyTexture(const gles2::GLES2Decoder* decoder, | 36 void DoCopyTexture(gles2::GLES2Decoder* decoder, |
37 GLenum source_target, | 37 GLenum source_target, |
38 GLuint source_id, | 38 GLuint source_id, |
39 GLenum source_internal_format, | 39 GLenum source_internal_format, |
40 GLenum dest_target, | 40 GLenum dest_target, |
41 GLuint dest_id, | 41 GLuint dest_id, |
42 GLenum dest_internal_format, | 42 GLenum dest_internal_format, |
43 GLsizei width, | 43 GLsizei width, |
44 GLsizei height, | 44 GLsizei height, |
45 bool flip_y, | 45 bool flip_y, |
46 bool premultiply_alpha, | 46 bool premultiply_alpha, |
47 bool unpremultiply_alpha); | 47 bool unpremultiply_alpha); |
48 | 48 |
49 void DoCopySubTexture(const gles2::GLES2Decoder* decoder, | 49 void DoCopySubTexture(gles2::GLES2Decoder* decoder, |
50 GLenum source_target, | 50 GLenum source_target, |
51 GLuint source_id, | 51 GLuint source_id, |
52 GLenum source_internal_format, | 52 GLenum source_internal_format, |
53 GLenum dest_target, | 53 GLenum dest_target, |
54 GLuint dest_id, | 54 GLuint dest_id, |
55 GLenum dest_internal_format, | 55 GLenum dest_internal_format, |
56 GLint xoffset, | 56 GLint xoffset, |
57 GLint yoffset, | 57 GLint yoffset, |
58 GLint x, | 58 GLint x, |
59 GLint y, | 59 GLint y, |
60 GLsizei width, | 60 GLsizei width, |
61 GLsizei height, | 61 GLsizei height, |
62 GLsizei dest_width, | 62 GLsizei dest_width, |
63 GLsizei dest_height, | 63 GLsizei dest_height, |
64 GLsizei source_width, | 64 GLsizei source_width, |
65 GLsizei source_height, | 65 GLsizei source_height, |
66 bool flip_y, | 66 bool flip_y, |
67 bool premultiply_alpha, | 67 bool premultiply_alpha, |
68 bool unpremultiply_alpha); | 68 bool unpremultiply_alpha); |
69 | 69 |
70 void DoCopySubTextureWithTransform(const gles2::GLES2Decoder* decoder, | 70 void DoCopySubTextureWithTransform(gles2::GLES2Decoder* decoder, |
71 GLenum source_target, | 71 GLenum source_target, |
72 GLuint source_id, | 72 GLuint source_id, |
73 GLenum source_internal_format, | 73 GLenum source_internal_format, |
74 GLenum dest_target, | 74 GLenum dest_target, |
75 GLuint dest_id, | 75 GLuint dest_id, |
76 GLenum dest_internal_format, | 76 GLenum dest_internal_format, |
77 GLint xoffset, | 77 GLint xoffset, |
78 GLint yoffset, | 78 GLint yoffset, |
79 GLint x, | 79 GLint x, |
80 GLint y, | 80 GLint y, |
81 GLsizei width, | 81 GLsizei width, |
82 GLsizei height, | 82 GLsizei height, |
83 GLsizei dest_width, | 83 GLsizei dest_width, |
84 GLsizei dest_height, | 84 GLsizei dest_height, |
85 GLsizei source_width, | 85 GLsizei source_width, |
86 GLsizei source_height, | 86 GLsizei source_height, |
87 bool flip_y, | 87 bool flip_y, |
88 bool premultiply_alpha, | 88 bool premultiply_alpha, |
89 bool unpremultiply_alpha, | 89 bool unpremultiply_alpha, |
90 const GLfloat transform_matrix[16]); | 90 const GLfloat transform_matrix[16]); |
91 | 91 |
92 // This will apply a transform on the texture coordinates before sampling | 92 // This will apply a transform on the texture coordinates before sampling |
93 // the source texture and copying to the destination texture. The transform | 93 // the source texture and copying to the destination texture. The transform |
94 // matrix should be given in column-major form, so it can be passed | 94 // matrix should be given in column-major form, so it can be passed |
95 // directly to GL. | 95 // directly to GL. |
96 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, | 96 void DoCopyTextureWithTransform(gles2::GLES2Decoder* decoder, |
97 GLenum source_target, | 97 GLenum source_target, |
98 GLuint source_id, | 98 GLuint source_id, |
99 GLenum dest_target, | 99 GLenum dest_target, |
100 GLuint dest_id, | 100 GLuint dest_id, |
101 GLsizei width, | 101 GLsizei width, |
102 GLsizei height, | 102 GLsizei height, |
103 bool flip_y, | 103 bool flip_y, |
104 bool premultiply_alpha, | 104 bool premultiply_alpha, |
105 bool unpremultiply_alpha, | 105 bool unpremultiply_alpha, |
106 const GLfloat transform_matrix[16]); | 106 const GLfloat transform_matrix[16]); |
(...skipping 21 matching lines...) Expand all Loading... |
128 | 128 |
129 // Transformations that map from the original quad coordinates [-1, 1] into | 129 // Transformations that map from the original quad coordinates [-1, 1] into |
130 // the source texture's texture coordinates. | 130 // the source texture's texture coordinates. |
131 GLuint vertex_source_mult_handle; | 131 GLuint vertex_source_mult_handle; |
132 GLuint vertex_source_add_handle; | 132 GLuint vertex_source_add_handle; |
133 | 133 |
134 GLuint tex_coord_transform_handle; | 134 GLuint tex_coord_transform_handle; |
135 GLuint sampler_handle; | 135 GLuint sampler_handle; |
136 }; | 136 }; |
137 | 137 |
138 void DoCopyTextureInternal(const gles2::GLES2Decoder* decoder, | 138 void DoCopyTextureInternal(gles2::GLES2Decoder* decoder, |
139 GLenum source_target, | 139 GLenum source_target, |
140 GLuint source_id, | 140 GLuint source_id, |
141 GLenum dest_target, | 141 GLenum dest_target, |
142 GLuint dest_id, | 142 GLuint dest_id, |
143 GLint xoffset, | 143 GLint xoffset, |
144 GLint yoffset, | 144 GLint yoffset, |
145 GLint x, | 145 GLint x, |
146 GLint y, | 146 GLint y, |
147 GLsizei width, | 147 GLsizei width, |
148 GLsizei height, | 148 GLsizei height, |
(...skipping 16 matching lines...) Expand all Loading... |
165 GLuint vertex_array_object_id_; | 165 GLuint vertex_array_object_id_; |
166 GLuint buffer_id_; | 166 GLuint buffer_id_; |
167 GLuint framebuffer_; | 167 GLuint framebuffer_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); | 169 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace gpu. | 172 } // namespace gpu. |
173 | 173 |
174 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 174 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
OLD | NEW |