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

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

Issue 1275773003: gpu: support GL_TEXTURE_CUBE_MAP destination target to Copy(Sub)TextureCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Choose correct and expensive way Created 5 years, 4 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 (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 16 matching lines...) Expand all
27 CopyTextureCHROMIUMResourceManager(); 27 CopyTextureCHROMIUMResourceManager();
28 ~CopyTextureCHROMIUMResourceManager(); 28 ~CopyTextureCHROMIUMResourceManager();
29 29
30 void Initialize(const gles2::GLES2Decoder* decoder); 30 void Initialize(const gles2::GLES2Decoder* decoder);
31 void Destroy(); 31 void Destroy();
32 32
33 void DoCopyTexture(const gles2::GLES2Decoder* decoder, 33 void DoCopyTexture(const gles2::GLES2Decoder* decoder,
34 GLenum source_target, 34 GLenum source_target,
35 GLuint source_id, 35 GLuint source_id,
36 GLenum source_internal_format, 36 GLenum source_internal_format,
37 GLenum dest_target,
37 GLuint dest_id, 38 GLuint dest_id,
38 GLenum dest_internal_format, 39 GLenum dest_internal_format,
40 GLenum dest_type,
39 GLsizei width, 41 GLsizei width,
40 GLsizei height, 42 GLsizei height,
41 bool flip_y, 43 bool flip_y,
42 bool premultiply_alpha, 44 bool premultiply_alpha,
43 bool unpremultiply_alpha); 45 bool unpremultiply_alpha,
46 bool dest_cube_complete);
44 47
45 void DoCopySubTexture(const gles2::GLES2Decoder* decoder, 48 void DoCopySubTexture(const gles2::GLES2Decoder* decoder,
46 GLenum source_target, 49 GLenum source_target,
47 GLuint source_id, 50 GLuint source_id,
48 GLenum source_internal_format, 51 GLenum source_internal_format,
52 GLenum dest_target,
49 GLuint dest_id, 53 GLuint dest_id,
50 GLenum dest_internal_format, 54 GLenum dest_internal_format,
55 GLenum dest_type,
51 GLint xoffset, 56 GLint xoffset,
52 GLint yoffset, 57 GLint yoffset,
53 GLint x, 58 GLint x,
54 GLint y, 59 GLint y,
55 GLsizei width, 60 GLsizei width,
56 GLsizei height, 61 GLsizei height,
57 GLsizei dest_width, 62 GLsizei dest_width,
58 GLsizei dest_height, 63 GLsizei dest_height,
59 GLsizei source_width, 64 GLsizei source_width,
60 GLsizei source_height, 65 GLsizei source_height,
61 bool flip_y, 66 bool flip_y,
62 bool premultiply_alpha, 67 bool premultiply_alpha,
63 bool unpremultiply_alpha); 68 bool unpremultiply_alpha,
69 bool dest_cube_complete);
64 70
65 // This will apply a transform on the texture coordinates before sampling 71 // This will apply a transform on the texture coordinates before sampling
66 // the source texture and copying to the destination texture. The transform 72 // the source texture and copying to the destination texture. The transform
67 // matrix should be given in column-major form, so it can be passed 73 // matrix should be given in column-major form, so it can be passed
68 // directly to GL. 74 // directly to GL.
69 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, 75 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder,
70 GLenum source_target, 76 GLenum source_target,
71 GLuint source_id, 77 GLuint source_id,
78 GLenum dest_target,
72 GLuint dest_id, 79 GLuint dest_id,
80 GLenum dest_internal_format,
81 GLenum dest_type,
73 GLsizei width, 82 GLsizei width,
74 GLsizei height, 83 GLsizei height,
75 bool flip_y, 84 bool flip_y,
76 bool premultiply_alpha, 85 bool premultiply_alpha,
77 bool unpremultiply_alpha, 86 bool unpremultiply_alpha,
87 bool dest_cube_complete,
78 const GLfloat transform_matrix[16]); 88 const GLfloat transform_matrix[16]);
79 89
80 // The attributes used during invocation of the extension. 90 // The attributes used during invocation of the extension.
81 static const GLuint kVertexPositionAttrib = 0; 91 static const GLuint kVertexPositionAttrib = 0;
82 92
83 private: 93 private:
84 struct ProgramInfo { 94 struct ProgramInfo {
85 ProgramInfo() 95 ProgramInfo()
86 : program(0u), 96 : program(0u),
87 vertex_translate_handle(0u), 97 vertex_translate_handle(0u),
88 tex_coord_transform_handle(0u), 98 tex_coord_transform_handle(0u),
89 half_size_handle(0u), 99 half_size_handle(0u),
90 sampler_handle(0u) {} 100 sampler_handle(0u) {}
91 101
92 GLuint program; 102 GLuint program;
93 GLuint vertex_translate_handle; 103 GLuint vertex_translate_handle;
94 GLuint tex_coord_transform_handle; 104 GLuint tex_coord_transform_handle;
95 GLuint half_size_handle; 105 GLuint half_size_handle;
96 GLuint sampler_handle; 106 GLuint sampler_handle;
97 }; 107 };
98 108
99 void DoCopyTextureInternal(const gles2::GLES2Decoder* decoder, 109 void DoCopyTextureInternal(const gles2::GLES2Decoder* decoder,
100 GLenum source_target, 110 GLenum source_target,
101 GLuint source_id, 111 GLuint source_id,
112 GLenum dest_target,
102 GLuint dest_id, 113 GLuint dest_id,
103 GLint xoffset, 114 GLint xoffset,
104 GLint yoffset, 115 GLint yoffset,
105 GLint x, 116 GLint x,
106 GLint y, 117 GLint y,
107 GLsizei width, 118 GLsizei width,
108 GLsizei height, 119 GLsizei height,
109 GLsizei dest_width, 120 GLsizei dest_width,
110 GLsizei dest_height, 121 GLsizei dest_height,
111 GLsizei source_width, 122 GLsizei source_width,
112 GLsizei source_height, 123 GLsizei source_height,
113 bool flip_y, 124 bool flip_y,
114 bool premultiply_alpha, 125 bool premultiply_alpha,
115 bool unpremultiply_alpha, 126 bool unpremultiply_alpha,
116 const GLfloat transform_matrix[16]); 127 const GLfloat transform_matrix[16]);
117 128
118 bool initialized_; 129 bool initialized_;
119 typedef std::vector<GLuint> ShaderVector; 130 typedef std::vector<GLuint> ShaderVector;
120 ShaderVector vertex_shaders_; 131 ShaderVector vertex_shaders_;
121 ShaderVector fragment_shaders_; 132 ShaderVector fragment_shaders_;
122 typedef std::pair<int, int> ProgramMapKey; 133 typedef std::pair<int, int> ProgramMapKey;
123 typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap; 134 typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap;
124 ProgramMap programs_; 135 ProgramMap programs_;
125 GLuint buffer_id_; 136 GLuint buffer_id_;
126 GLuint framebuffer_; 137 GLuint framebuffer_;
138 GLuint staging_testure_;
Ken Russell (switch to Gerrit) 2015/08/18 00:33:02 typo: should be staging_texture_ .
dshwang 2015/08/18 14:42:01 Acknowledged.
127 139
128 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); 140 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
129 }; 141 };
130 142
131 } // namespace gpu. 143 } // namespace gpu.
132 144
133 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ 145 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698