OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 | 8 |
9 namespace gpu { | 9 namespace gpu { |
10 namespace gles2 { | 10 namespace gles2 { |
11 | 11 |
| 12 namespace { |
| 13 |
| 14 template <typename ClientType, typename ServiceType, typename GenFunction> |
| 15 error::Error GenHelper(GLsizei n, |
| 16 const volatile ClientType* client_ids, |
| 17 ClientServiceMap<ClientType, ServiceType>* id_map, |
| 18 GenFunction gen_function) { |
| 19 std::vector<ClientType> client_ids_copy(client_ids, client_ids + n); |
| 20 for (GLsizei ii = 0; ii < n; ++ii) { |
| 21 if (id_map->GetServiceID(client_ids_copy[ii], nullptr)) { |
| 22 return error::kInvalidArguments; |
| 23 } |
| 24 } |
| 25 if (!CheckUniqueAndNonNullIds(n, client_ids_copy.data())) { |
| 26 return error::kInvalidArguments; |
| 27 } |
| 28 |
| 29 std::vector<ServiceType> service_ids(n, 0); |
| 30 gen_function(n, service_ids.data()); |
| 31 for (GLsizei ii = 0; ii < n; ++ii) { |
| 32 id_map->SetIDMapping(client_ids_copy[ii], service_ids[ii]); |
| 33 } |
| 34 |
| 35 return error::kNoError; |
| 36 } |
| 37 |
| 38 template <typename ClientType, typename ServiceType, typename GenFunction> |
| 39 error::Error CreateHelper(ClientType client_id, |
| 40 ClientServiceMap<ClientType, ServiceType>* id_map, |
| 41 GenFunction create_function) { |
| 42 if (id_map->GetServiceID(client_id, nullptr)) { |
| 43 return error::kInvalidArguments; |
| 44 } |
| 45 ServiceType service_id = create_function(); |
| 46 id_map->SetIDMapping(client_id, service_id); |
| 47 return error::kNoError; |
| 48 } |
| 49 |
| 50 template <typename ClientType, typename ServiceType, typename DeleteFunction> |
| 51 error::Error DeleteHelper(GLsizei n, |
| 52 const volatile ClientType* client_ids, |
| 53 ClientServiceMap<ClientType, ServiceType>* id_map, |
| 54 DeleteFunction delete_function) { |
| 55 std::vector<ServiceType> service_ids(n, 0); |
| 56 for (GLsizei ii = 0; ii < n; ++ii) { |
| 57 ClientType client_id = client_ids[ii]; |
| 58 service_ids[ii] = id_map->GetServiceIDOrInvalid(client_id); |
| 59 id_map->RemoveClientID(client_id); |
| 60 } |
| 61 |
| 62 delete_function(n, service_ids.data()); |
| 63 |
| 64 return error::kNoError; |
| 65 } |
| 66 |
| 67 template <typename ClientType, typename ServiceType, typename DeleteFunction> |
| 68 error::Error DeleteHelper(ClientType client_id, |
| 69 ClientServiceMap<ClientType, ServiceType>* id_map, |
| 70 DeleteFunction delete_function) { |
| 71 delete_function(id_map->GetServiceIDOrInvalid(client_id)); |
| 72 id_map->RemoveClientID(client_id); |
| 73 return error::kNoError; |
| 74 } |
| 75 |
| 76 template <typename ClientType, typename ServiceType, typename GenFunction> |
| 77 ServiceType GetServiceID(ClientType client_id, |
| 78 ClientServiceMap<ClientType, ServiceType>* id_map, |
| 79 bool create_if_missing, |
| 80 GenFunction gen_function) { |
| 81 ServiceType service_id = id_map->invalid_service_id(); |
| 82 if (id_map->GetServiceID(client_id, &service_id)) { |
| 83 return service_id; |
| 84 } |
| 85 |
| 86 if (create_if_missing) { |
| 87 service_id = gen_function(); |
| 88 id_map->SetIDMapping(client_id, service_id); |
| 89 return service_id; |
| 90 } |
| 91 |
| 92 return id_map->invalid_service_id(); |
| 93 } |
| 94 |
| 95 GLuint GetTextureServiceID(GLuint client_id, |
| 96 PassthroughResources* resources, |
| 97 bool create_if_missing) { |
| 98 return GetServiceID(client_id, &resources->texture_id_map, create_if_missing, |
| 99 []() { |
| 100 GLuint service_id = 0; |
| 101 glGenTextures(1, &service_id); |
| 102 return service_id; |
| 103 }); |
| 104 } |
| 105 |
| 106 GLuint GetBufferServiceID(GLuint client_id, |
| 107 PassthroughResources* resources, |
| 108 bool create_if_missing) { |
| 109 return GetServiceID(client_id, &resources->buffer_id_map, create_if_missing, |
| 110 []() { |
| 111 GLuint service_id = 0; |
| 112 glGenBuffersARB(1, &service_id); |
| 113 return service_id; |
| 114 }); |
| 115 } |
| 116 |
| 117 GLuint GetRenderbufferServiceID(GLuint client_id, |
| 118 PassthroughResources* resources, |
| 119 bool create_if_missing) { |
| 120 return GetServiceID(client_id, &resources->renderbuffer_id_map, |
| 121 create_if_missing, []() { |
| 122 GLuint service_id = 0; |
| 123 glGenRenderbuffersEXT(1, &service_id); |
| 124 return service_id; |
| 125 }); |
| 126 } |
| 127 |
| 128 GLuint GetFramebufferServiceID(GLuint client_id, |
| 129 ClientServiceMap<GLuint, GLuint>* id_map, |
| 130 bool create_if_missing) { |
| 131 return GetServiceID(client_id, id_map, create_if_missing, []() { |
| 132 GLuint service_id = 0; |
| 133 glGenFramebuffersEXT(1, &service_id); |
| 134 return service_id; |
| 135 }); |
| 136 } |
| 137 |
| 138 GLuint GetTransformFeedbackServiceID(GLuint client_id, |
| 139 ClientServiceMap<GLuint, GLuint>* id_map, |
| 140 bool create_if_missing) { |
| 141 return GetServiceID(client_id, id_map, create_if_missing, []() { |
| 142 GLuint service_id = 0; |
| 143 glGenTransformFeedbacks(1, &service_id); |
| 144 return service_id; |
| 145 }); |
| 146 } |
| 147 |
| 148 GLuint GetVertexArrayServiceID(GLuint client_id, |
| 149 ClientServiceMap<GLuint, GLuint>* id_map, |
| 150 bool create_if_missing) { |
| 151 return GetServiceID(client_id, id_map, create_if_missing, []() { |
| 152 GLuint service_id = 0; |
| 153 glGenVertexArraysOES(1, &service_id); |
| 154 return service_id; |
| 155 }); |
| 156 } |
| 157 |
| 158 GLuint GetProgramServiceID(GLuint client_id, PassthroughResources* resources) { |
| 159 return resources->program_id_map.GetServiceIDOrInvalid(client_id); |
| 160 } |
| 161 |
| 162 GLuint GetShaderServiceID(GLuint client_id, PassthroughResources* resources) { |
| 163 return resources->shader_id_map.GetServiceIDOrInvalid(client_id); |
| 164 } |
| 165 |
| 166 GLuint GetQueryServiceID(GLuint client_id, |
| 167 ClientServiceMap<GLuint, GLuint>* id_map) { |
| 168 return id_map->GetServiceIDOrInvalid(client_id); |
| 169 } |
| 170 |
| 171 GLuint GetSamplerServiceID(GLuint client_id, PassthroughResources* resources) { |
| 172 return resources->sampler_id_map.GetServiceIDOrInvalid(client_id); |
| 173 } |
| 174 |
| 175 GLsync GetSyncServiceID(GLuint client_id, PassthroughResources* resources) { |
| 176 return reinterpret_cast<GLsync>( |
| 177 resources->sync_id_map.GetServiceIDOrInvalid(client_id)); |
| 178 } |
| 179 |
| 180 template <typename T> |
| 181 void InsertValueIntoBuffer(std::vector<uint8_t>* data, |
| 182 const T& value, |
| 183 size_t offset) { |
| 184 DCHECK_LE(offset + sizeof(T), data->size()); |
| 185 memcpy(data->data() + offset, &value, sizeof(T)); |
| 186 } |
| 187 |
| 188 template <typename T> |
| 189 void AppendValueToBuffer(std::vector<uint8_t>* data, const T& value) { |
| 190 size_t old_size = data->size(); |
| 191 data->resize(old_size + sizeof(T)); |
| 192 memcpy(data->data() + old_size, &value, sizeof(T)); |
| 193 } |
| 194 |
| 195 void AppendStringToBuffer(std::vector<uint8_t>* data, |
| 196 const char* str, |
| 197 size_t len) { |
| 198 size_t old_size = data->size(); |
| 199 data->resize(old_size + len); |
| 200 memcpy(data->data() + old_size, str, len); |
| 201 } |
| 202 |
| 203 } // anonymous namespace |
| 204 |
12 // Implementations of commands | 205 // Implementations of commands |
13 error::Error GLES2DecoderPassthroughImpl::DoActiveTexture(GLenum texture) { | 206 error::Error GLES2DecoderPassthroughImpl::DoActiveTexture(GLenum texture) { |
| 207 glActiveTexture(texture); |
| 208 active_texture_unit_ = static_cast<size_t>(texture) - GL_TEXTURE0; |
14 return error::kNoError; | 209 return error::kNoError; |
15 } | 210 } |
16 | 211 |
17 error::Error GLES2DecoderPassthroughImpl::DoAttachShader(GLuint program, | 212 error::Error GLES2DecoderPassthroughImpl::DoAttachShader(GLuint program, |
18 GLuint shader) { | 213 GLuint shader) { |
19 return error::kNoError; | 214 glAttachShader(GetProgramServiceID(program, resources_), |
20 } | 215 GetShaderServiceID(shader, resources_)); |
21 | 216 return error::kNoError; |
| 217 } |
| 218 |
22 error::Error GLES2DecoderPassthroughImpl::DoBindAttribLocation( | 219 error::Error GLES2DecoderPassthroughImpl::DoBindAttribLocation( |
23 GLuint program, | 220 GLuint program, |
24 GLuint index, | 221 GLuint index, |
25 const char* name) { | 222 const char* name) { |
| 223 glBindAttribLocation(GetProgramServiceID(program, resources_), index, name); |
26 return error::kNoError; | 224 return error::kNoError; |
27 } | 225 } |
28 | 226 |
29 error::Error GLES2DecoderPassthroughImpl::DoBindBuffer(GLenum target, | 227 error::Error GLES2DecoderPassthroughImpl::DoBindBuffer(GLenum target, |
30 GLuint buffer) { | 228 GLuint buffer) { |
| 229 glBindBuffer( |
| 230 target, GetBufferServiceID(buffer, resources_, bind_generates_resource_)); |
31 return error::kNoError; | 231 return error::kNoError; |
32 } | 232 } |
33 | 233 |
34 error::Error GLES2DecoderPassthroughImpl::DoBindBufferBase(GLenum target, | 234 error::Error GLES2DecoderPassthroughImpl::DoBindBufferBase(GLenum target, |
35 GLuint index, | 235 GLuint index, |
36 GLuint buffer) { | 236 GLuint buffer) { |
| 237 glBindBufferBase(target, index, GetBufferServiceID(buffer, resources_, |
| 238 bind_generates_resource_)); |
37 return error::kNoError; | 239 return error::kNoError; |
38 } | 240 } |
39 | 241 |
40 error::Error GLES2DecoderPassthroughImpl::DoBindBufferRange(GLenum target, | 242 error::Error GLES2DecoderPassthroughImpl::DoBindBufferRange(GLenum target, |
41 GLuint index, | 243 GLuint index, |
42 GLuint buffer, | 244 GLuint buffer, |
43 GLintptr offset, | 245 GLintptr offset, |
44 GLsizeiptr size) { | 246 GLsizeiptr size) { |
| 247 glBindBufferRange(target, index, GetBufferServiceID(buffer, resources_, |
| 248 bind_generates_resource_), |
| 249 offset, size); |
45 return error::kNoError; | 250 return error::kNoError; |
46 } | 251 } |
47 | 252 |
48 error::Error GLES2DecoderPassthroughImpl::DoBindFramebuffer( | 253 error::Error GLES2DecoderPassthroughImpl::DoBindFramebuffer( |
49 GLenum target, | 254 GLenum target, |
50 GLuint framebuffer) { | 255 GLuint framebuffer) { |
| 256 glBindFramebufferEXT( |
| 257 target, GetFramebufferServiceID(framebuffer, &framebuffer_id_map_, |
| 258 bind_generates_resource_)); |
51 return error::kNoError; | 259 return error::kNoError; |
52 } | 260 } |
53 | 261 |
54 error::Error GLES2DecoderPassthroughImpl::DoBindRenderbuffer( | 262 error::Error GLES2DecoderPassthroughImpl::DoBindRenderbuffer( |
55 GLenum target, | 263 GLenum target, |
56 GLuint renderbuffer) { | 264 GLuint renderbuffer) { |
| 265 glBindRenderbufferEXT(target, |
| 266 GetRenderbufferServiceID(renderbuffer, resources_, |
| 267 bind_generates_resource_)); |
57 return error::kNoError; | 268 return error::kNoError; |
58 } | 269 } |
59 | 270 |
60 error::Error GLES2DecoderPassthroughImpl::DoBindSampler(GLuint unit, | 271 error::Error GLES2DecoderPassthroughImpl::DoBindSampler(GLuint unit, |
61 GLuint sampler) { | 272 GLuint sampler) { |
| 273 glBindSampler(unit, GetSamplerServiceID(sampler, resources_)); |
62 return error::kNoError; | 274 return error::kNoError; |
63 } | 275 } |
64 | 276 |
65 error::Error GLES2DecoderPassthroughImpl::DoBindTexture(GLenum target, | 277 error::Error GLES2DecoderPassthroughImpl::DoBindTexture(GLenum target, |
66 GLuint texture) { | 278 GLuint texture) { |
| 279 glBindTexture(target, GetTextureServiceID(texture, resources_, |
| 280 bind_generates_resource_)); |
| 281 if (target == GL_TEXTURE_2D && |
| 282 active_texture_unit_ < bound_textures_.size()) { |
| 283 bound_textures_[active_texture_unit_] = texture; |
| 284 } |
67 return error::kNoError; | 285 return error::kNoError; |
68 } | 286 } |
69 | 287 |
70 error::Error GLES2DecoderPassthroughImpl::DoBindTransformFeedback( | 288 error::Error GLES2DecoderPassthroughImpl::DoBindTransformFeedback( |
71 GLenum target, | 289 GLenum target, |
72 GLuint transformfeedback) { | 290 GLuint transformfeedback) { |
| 291 glBindTransformFeedback( |
| 292 target, GetTransformFeedbackServiceID(transformfeedback, |
| 293 &transform_feedback_id_map_, |
| 294 bind_generates_resource_)); |
73 return error::kNoError; | 295 return error::kNoError; |
74 } | 296 } |
75 | 297 |
76 error::Error GLES2DecoderPassthroughImpl::DoBlendColor(GLclampf red, | 298 error::Error GLES2DecoderPassthroughImpl::DoBlendColor(GLclampf red, |
77 GLclampf green, | 299 GLclampf green, |
78 GLclampf blue, | 300 GLclampf blue, |
79 GLclampf alpha) { | 301 GLclampf alpha) { |
| 302 glBlendColor(red, green, blue, alpha); |
80 return error::kNoError; | 303 return error::kNoError; |
81 } | 304 } |
82 | 305 |
83 error::Error GLES2DecoderPassthroughImpl::DoBlendEquation(GLenum mode) { | 306 error::Error GLES2DecoderPassthroughImpl::DoBlendEquation(GLenum mode) { |
| 307 glBlendEquation(mode); |
84 return error::kNoError; | 308 return error::kNoError; |
85 } | 309 } |
86 | 310 |
87 error::Error GLES2DecoderPassthroughImpl::DoBlendEquationSeparate( | 311 error::Error GLES2DecoderPassthroughImpl::DoBlendEquationSeparate( |
88 GLenum modeRGB, | 312 GLenum modeRGB, |
89 GLenum modeAlpha) { | 313 GLenum modeAlpha) { |
| 314 glBlendEquationSeparate(modeRGB, modeAlpha); |
90 return error::kNoError; | 315 return error::kNoError; |
91 } | 316 } |
92 | 317 |
93 error::Error GLES2DecoderPassthroughImpl::DoBlendFunc(GLenum sfactor, | 318 error::Error GLES2DecoderPassthroughImpl::DoBlendFunc(GLenum sfactor, |
94 GLenum dfactor) { | 319 GLenum dfactor) { |
| 320 glBlendFunc(sfactor, dfactor); |
95 return error::kNoError; | 321 return error::kNoError; |
96 } | 322 } |
97 | 323 |
98 error::Error GLES2DecoderPassthroughImpl::DoBlendFuncSeparate(GLenum srcRGB, | 324 error::Error GLES2DecoderPassthroughImpl::DoBlendFuncSeparate(GLenum srcRGB, |
99 GLenum dstRGB, | 325 GLenum dstRGB, |
100 GLenum srcAlpha, | 326 GLenum srcAlpha, |
101 GLenum dstAlpha) { | 327 GLenum dstAlpha) { |
| 328 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
102 return error::kNoError; | 329 return error::kNoError; |
103 } | 330 } |
104 | 331 |
105 error::Error GLES2DecoderPassthroughImpl::DoBufferData(GLenum target, | 332 error::Error GLES2DecoderPassthroughImpl::DoBufferData(GLenum target, |
106 GLsizeiptr size, | 333 GLsizeiptr size, |
107 const void* data, | 334 const void* data, |
108 GLenum usage) { | 335 GLenum usage) { |
| 336 glBufferData(target, size, data, usage); |
109 return error::kNoError; | 337 return error::kNoError; |
110 } | 338 } |
111 | 339 |
112 error::Error GLES2DecoderPassthroughImpl::DoBufferSubData(GLenum target, | 340 error::Error GLES2DecoderPassthroughImpl::DoBufferSubData(GLenum target, |
113 GLintptr offset, | 341 GLintptr offset, |
114 GLsizeiptr size, | 342 GLsizeiptr size, |
115 const void* data) { | 343 const void* data) { |
| 344 glBufferSubData(target, offset, size, data); |
116 return error::kNoError; | 345 return error::kNoError; |
117 } | 346 } |
118 | 347 |
119 error::Error GLES2DecoderPassthroughImpl::DoCheckFramebufferStatus( | 348 error::Error GLES2DecoderPassthroughImpl::DoCheckFramebufferStatus( |
120 GLenum target, | 349 GLenum target, |
121 uint32_t* result) { | 350 uint32_t* result) { |
| 351 *result = glCheckFramebufferStatusEXT(target); |
122 return error::kNoError; | 352 return error::kNoError; |
123 } | 353 } |
124 | 354 |
125 error::Error GLES2DecoderPassthroughImpl::DoClear(GLbitfield mask) { | 355 error::Error GLES2DecoderPassthroughImpl::DoClear(GLbitfield mask) { |
| 356 glClear(mask); |
126 return error::kNoError; | 357 return error::kNoError; |
127 } | 358 } |
128 | 359 |
129 error::Error GLES2DecoderPassthroughImpl::DoClearBufferfi(GLenum buffer, | 360 error::Error GLES2DecoderPassthroughImpl::DoClearBufferfi(GLenum buffer, |
130 GLint drawbuffers, | 361 GLint drawbuffers, |
131 GLfloat depth, | 362 GLfloat depth, |
132 GLint stencil) { | 363 GLint stencil) { |
| 364 glClearBufferfi(buffer, drawbuffers, depth, stencil); |
133 return error::kNoError; | 365 return error::kNoError; |
134 } | 366 } |
135 | 367 |
136 error::Error GLES2DecoderPassthroughImpl::DoClearBufferfv( | 368 error::Error GLES2DecoderPassthroughImpl::DoClearBufferfv( |
137 GLenum buffer, | 369 GLenum buffer, |
138 GLint drawbuffers, | 370 GLint drawbuffers, |
139 const volatile GLfloat* value) { | 371 const volatile GLfloat* value) { |
| 372 glClearBufferfv(buffer, drawbuffers, const_cast<const GLfloat*>(value)); |
140 return error::kNoError; | 373 return error::kNoError; |
141 } | 374 } |
142 | 375 |
143 error::Error GLES2DecoderPassthroughImpl::DoClearBufferiv( | 376 error::Error GLES2DecoderPassthroughImpl::DoClearBufferiv( |
144 GLenum buffer, | 377 GLenum buffer, |
145 GLint drawbuffers, | 378 GLint drawbuffers, |
146 const volatile GLint* value) { | 379 const volatile GLint* value) { |
| 380 glClearBufferiv(buffer, drawbuffers, const_cast<const GLint*>(value)); |
147 return error::kNoError; | 381 return error::kNoError; |
148 } | 382 } |
149 | 383 |
150 error::Error GLES2DecoderPassthroughImpl::DoClearBufferuiv( | 384 error::Error GLES2DecoderPassthroughImpl::DoClearBufferuiv( |
151 GLenum buffer, | 385 GLenum buffer, |
152 GLint drawbuffers, | 386 GLint drawbuffers, |
153 const volatile GLuint* value) { | 387 const volatile GLuint* value) { |
| 388 glClearBufferuiv(buffer, drawbuffers, const_cast<const GLuint*>(value)); |
154 return error::kNoError; | 389 return error::kNoError; |
155 } | 390 } |
156 | 391 |
157 error::Error GLES2DecoderPassthroughImpl::DoClearColor(GLclampf red, | 392 error::Error GLES2DecoderPassthroughImpl::DoClearColor(GLclampf red, |
158 GLclampf green, | 393 GLclampf green, |
159 GLclampf blue, | 394 GLclampf blue, |
160 GLclampf alpha) { | 395 GLclampf alpha) { |
| 396 glClearColor(red, green, blue, alpha); |
161 return error::kNoError; | 397 return error::kNoError; |
162 } | 398 } |
163 | 399 |
164 error::Error GLES2DecoderPassthroughImpl::DoClearDepthf(GLclampf depth) { | 400 error::Error GLES2DecoderPassthroughImpl::DoClearDepthf(GLclampf depth) { |
| 401 glClearDepthf(depth); |
165 return error::kNoError; | 402 return error::kNoError; |
166 } | 403 } |
167 | 404 |
168 error::Error GLES2DecoderPassthroughImpl::DoClearStencil(GLint s) { | 405 error::Error GLES2DecoderPassthroughImpl::DoClearStencil(GLint s) { |
| 406 glClearStencil(s); |
169 return error::kNoError; | 407 return error::kNoError; |
170 } | 408 } |
171 | 409 |
172 error::Error GLES2DecoderPassthroughImpl::DoClientWaitSync(GLuint sync, | 410 error::Error GLES2DecoderPassthroughImpl::DoClientWaitSync(GLuint sync, |
173 GLbitfield flags, | 411 GLbitfield flags, |
174 GLuint64 timeout, | 412 GLuint64 timeout, |
175 GLenum* result) { | 413 GLenum* result) { |
| 414 NOTIMPLEMENTED(); |
176 return error::kNoError; | 415 return error::kNoError; |
177 } | 416 } |
178 | 417 |
179 error::Error GLES2DecoderPassthroughImpl::DoColorMask(GLboolean red, | 418 error::Error GLES2DecoderPassthroughImpl::DoColorMask(GLboolean red, |
180 GLboolean green, | 419 GLboolean green, |
181 GLboolean blue, | 420 GLboolean blue, |
182 GLboolean alpha) { | 421 GLboolean alpha) { |
| 422 glColorMask(red, green, blue, alpha); |
183 return error::kNoError; | 423 return error::kNoError; |
184 } | 424 } |
185 | 425 |
186 error::Error GLES2DecoderPassthroughImpl::DoCompileShader(GLuint shader) { | 426 error::Error GLES2DecoderPassthroughImpl::DoCompileShader(GLuint shader) { |
| 427 glCompileShader(GetShaderServiceID(shader, resources_)); |
187 return error::kNoError; | 428 return error::kNoError; |
188 } | 429 } |
189 | 430 |
190 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage2D( | 431 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage2D( |
191 GLenum target, | 432 GLenum target, |
192 GLint level, | 433 GLint level, |
193 GLenum internalformat, | 434 GLenum internalformat, |
194 GLsizei width, | 435 GLsizei width, |
195 GLsizei height, | 436 GLsizei height, |
196 GLint border, | 437 GLint border, |
197 GLsizei imageSize, | 438 GLsizei imageSize, |
198 const void* data) { | 439 const void* data) { |
| 440 NOTIMPLEMENTED(); |
199 return error::kNoError; | 441 return error::kNoError; |
200 } | 442 } |
201 | 443 |
202 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage2D( | 444 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage2D( |
203 GLenum target, | 445 GLenum target, |
204 GLint level, | 446 GLint level, |
205 GLint xoffset, | 447 GLint xoffset, |
206 GLint yoffset, | 448 GLint yoffset, |
207 GLsizei width, | 449 GLsizei width, |
208 GLsizei height, | 450 GLsizei height, |
209 GLenum format, | 451 GLenum format, |
210 GLsizei imageSize, | 452 GLsizei imageSize, |
211 const void* data) { | 453 const void* data) { |
| 454 NOTIMPLEMENTED(); |
212 return error::kNoError; | 455 return error::kNoError; |
213 } | 456 } |
214 | 457 |
215 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage3D( | 458 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage3D( |
216 GLenum target, | 459 GLenum target, |
217 GLint level, | 460 GLint level, |
218 GLenum internalformat, | 461 GLenum internalformat, |
219 GLsizei width, | 462 GLsizei width, |
220 GLsizei height, | 463 GLsizei height, |
221 GLsizei depth, | 464 GLsizei depth, |
222 GLint border, | 465 GLint border, |
223 GLsizei imageSize, | 466 GLsizei imageSize, |
224 const void* data) { | 467 const void* data) { |
| 468 NOTIMPLEMENTED(); |
225 return error::kNoError; | 469 return error::kNoError; |
226 } | 470 } |
227 | 471 |
228 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage3D( | 472 error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage3D( |
229 GLenum target, | 473 GLenum target, |
230 GLint level, | 474 GLint level, |
231 GLint xoffset, | 475 GLint xoffset, |
232 GLint yoffset, | 476 GLint yoffset, |
233 GLint zoffset, | 477 GLint zoffset, |
234 GLsizei width, | 478 GLsizei width, |
235 GLsizei height, | 479 GLsizei height, |
236 GLsizei depth, | 480 GLsizei depth, |
237 GLenum format, | 481 GLenum format, |
238 GLsizei imageSize, | 482 GLsizei imageSize, |
239 const void* data) { | 483 const void* data) { |
| 484 NOTIMPLEMENTED(); |
240 return error::kNoError; | 485 return error::kNoError; |
241 } | 486 } |
242 | 487 |
243 error::Error GLES2DecoderPassthroughImpl::DoCopyBufferSubData( | 488 error::Error GLES2DecoderPassthroughImpl::DoCopyBufferSubData( |
244 GLenum readtarget, | 489 GLenum readtarget, |
245 GLenum writetarget, | 490 GLenum writetarget, |
246 GLintptr readoffset, | 491 GLintptr readoffset, |
247 GLintptr writeoffset, | 492 GLintptr writeoffset, |
248 GLsizeiptr size) { | 493 GLsizeiptr size) { |
| 494 glCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size); |
249 return error::kNoError; | 495 return error::kNoError; |
250 } | 496 } |
251 | 497 |
252 error::Error GLES2DecoderPassthroughImpl::DoCopyTexImage2D( | 498 error::Error GLES2DecoderPassthroughImpl::DoCopyTexImage2D( |
253 GLenum target, | 499 GLenum target, |
254 GLint level, | 500 GLint level, |
255 GLenum internalformat, | 501 GLenum internalformat, |
256 GLint x, | 502 GLint x, |
257 GLint y, | 503 GLint y, |
258 GLsizei width, | 504 GLsizei width, |
259 GLsizei height, | 505 GLsizei height, |
260 GLint border) { | 506 GLint border) { |
| 507 glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); |
261 return error::kNoError; | 508 return error::kNoError; |
262 } | 509 } |
263 | 510 |
264 error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage2D(GLenum target, | 511 error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage2D(GLenum target, |
265 GLint level, | 512 GLint level, |
266 GLint xoffset, | 513 GLint xoffset, |
267 GLint yoffset, | 514 GLint yoffset, |
268 GLint x, | 515 GLint x, |
269 GLint y, | 516 GLint y, |
270 GLsizei width, | 517 GLsizei width, |
271 GLsizei height) { | 518 GLsizei height) { |
| 519 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
272 return error::kNoError; | 520 return error::kNoError; |
273 } | 521 } |
274 | 522 |
275 error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage3D(GLenum target, | 523 error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage3D(GLenum target, |
276 GLint level, | 524 GLint level, |
277 GLint xoffset, | 525 GLint xoffset, |
278 GLint yoffset, | 526 GLint yoffset, |
279 GLint zoffset, | 527 GLint zoffset, |
280 GLint x, | 528 GLint x, |
281 GLint y, | 529 GLint y, |
282 GLsizei width, | 530 GLsizei width, |
283 GLsizei height) { | 531 GLsizei height) { |
| 532 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, |
| 533 height); |
284 return error::kNoError; | 534 return error::kNoError; |
285 } | 535 } |
286 | 536 |
287 error::Error GLES2DecoderPassthroughImpl::DoCreateProgram(GLuint client_id) { | 537 error::Error GLES2DecoderPassthroughImpl::DoCreateProgram(GLuint client_id) { |
288 return error::kNoError; | 538 return CreateHelper(client_id, &resources_->program_id_map, |
| 539 []() { return glCreateProgram(); }); |
289 } | 540 } |
290 | 541 |
291 error::Error GLES2DecoderPassthroughImpl::DoCreateShader(GLenum type, | 542 error::Error GLES2DecoderPassthroughImpl::DoCreateShader(GLenum type, |
292 GLuint client_id) { | 543 GLuint client_id) { |
293 return error::kNoError; | 544 return CreateHelper(client_id, &resources_->shader_id_map, |
| 545 [type]() { return glCreateShader(type); }); |
294 } | 546 } |
295 | 547 |
296 error::Error GLES2DecoderPassthroughImpl::DoCullFace(GLenum mode) { | 548 error::Error GLES2DecoderPassthroughImpl::DoCullFace(GLenum mode) { |
| 549 glCullFace(mode); |
297 return error::kNoError; | 550 return error::kNoError; |
298 } | 551 } |
299 | 552 |
300 error::Error GLES2DecoderPassthroughImpl::DoDeleteBuffers( | 553 error::Error GLES2DecoderPassthroughImpl::DoDeleteBuffers( |
301 GLsizei n, | 554 GLsizei n, |
302 const volatile GLuint* buffers) { | 555 const volatile GLuint* buffers) { |
303 return error::kNoError; | 556 return DeleteHelper( |
| 557 n, buffers, &resources_->buffer_id_map, |
| 558 [](GLsizei n, GLuint* buffers) { glDeleteBuffersARB(n, buffers); }); |
304 } | 559 } |
305 | 560 |
306 error::Error GLES2DecoderPassthroughImpl::DoDeleteFramebuffers( | 561 error::Error GLES2DecoderPassthroughImpl::DoDeleteFramebuffers( |
307 GLsizei n, | 562 GLsizei n, |
308 const volatile GLuint* framebuffers) { | 563 const volatile GLuint* framebuffers) { |
309 return error::kNoError; | 564 return DeleteHelper(n, framebuffers, &framebuffer_id_map_, |
| 565 [](GLsizei n, GLuint* framebuffers) { |
| 566 glDeleteFramebuffersEXT(n, framebuffers); |
| 567 }); |
310 } | 568 } |
311 | 569 |
312 error::Error GLES2DecoderPassthroughImpl::DoDeleteProgram(GLuint program) { | 570 error::Error GLES2DecoderPassthroughImpl::DoDeleteProgram(GLuint program) { |
313 return error::kNoError; | 571 return DeleteHelper(program, &resources_->program_id_map, |
| 572 [](GLuint program) { glDeleteProgram(program); }); |
314 } | 573 } |
315 | 574 |
316 error::Error GLES2DecoderPassthroughImpl::DoDeleteRenderbuffers( | 575 error::Error GLES2DecoderPassthroughImpl::DoDeleteRenderbuffers( |
317 GLsizei n, | 576 GLsizei n, |
318 const volatile GLuint* renderbuffers) { | 577 const volatile GLuint* renderbuffers) { |
319 return error::kNoError; | 578 return DeleteHelper(n, renderbuffers, &resources_->renderbuffer_id_map, |
| 579 [](GLsizei n, GLuint* renderbuffers) { |
| 580 glDeleteRenderbuffersEXT(n, renderbuffers); |
| 581 }); |
320 } | 582 } |
321 | 583 |
322 error::Error GLES2DecoderPassthroughImpl::DoDeleteSamplers( | 584 error::Error GLES2DecoderPassthroughImpl::DoDeleteSamplers( |
323 GLsizei n, | 585 GLsizei n, |
324 const volatile GLuint* samplers) { | 586 const volatile GLuint* samplers) { |
325 return error::kNoError; | 587 return DeleteHelper( |
| 588 n, samplers, &resources_->sampler_id_map, |
| 589 [](GLsizei n, GLuint* samplers) { glDeleteSamplers(n, samplers); }); |
326 } | 590 } |
327 | 591 |
328 error::Error GLES2DecoderPassthroughImpl::DoDeleteSync(GLuint sync) { | 592 error::Error GLES2DecoderPassthroughImpl::DoDeleteSync(GLuint sync) { |
329 return error::kNoError; | 593 return DeleteHelper(sync, &resources_->sync_id_map, [](uintptr_t sync) { |
| 594 glDeleteSync(reinterpret_cast<GLsync>(sync)); |
| 595 }); |
330 } | 596 } |
331 | 597 |
332 error::Error GLES2DecoderPassthroughImpl::DoDeleteShader(GLuint shader) { | 598 error::Error GLES2DecoderPassthroughImpl::DoDeleteShader(GLuint shader) { |
333 return error::kNoError; | 599 return DeleteHelper(shader, &resources_->shader_id_map, |
| 600 [](GLuint shader) { glDeleteShader(shader); }); |
334 } | 601 } |
335 | 602 |
336 error::Error GLES2DecoderPassthroughImpl::DoDeleteTextures( | 603 error::Error GLES2DecoderPassthroughImpl::DoDeleteTextures( |
337 GLsizei n, | 604 GLsizei n, |
338 const volatile GLuint* textures) { | 605 const volatile GLuint* textures) { |
339 return error::kNoError; | 606 // Textures that are currently associated with a mailbox are stored in the |
| 607 // texture_object_map_ and are deleted automatically when they are |
| 608 // unreferenced. Only delete textures that are not in this map. |
| 609 std::vector<GLuint> non_mailbox_client_ids; |
| 610 for (GLsizei ii = 0; ii < n; ++ii) { |
| 611 GLuint client_id = textures[ii]; |
| 612 auto texture_object_iter = resources_->texture_object_map.find(client_id); |
| 613 if (texture_object_iter == resources_->texture_object_map.end()) { |
| 614 // Delete with DeleteHelper |
| 615 non_mailbox_client_ids.push_back(client_id); |
| 616 } else { |
| 617 // Deleted when unreferenced |
| 618 resources_->texture_id_map.RemoveClientID(client_id); |
| 619 resources_->texture_object_map.erase(client_id); |
| 620 } |
| 621 } |
| 622 return DeleteHelper( |
| 623 non_mailbox_client_ids.size(), non_mailbox_client_ids.data(), |
| 624 &resources_->texture_id_map, |
| 625 [](GLsizei n, GLuint* textures) { glDeleteTextures(n, textures); }); |
340 } | 626 } |
341 | 627 |
342 error::Error GLES2DecoderPassthroughImpl::DoDeleteTransformFeedbacks( | 628 error::Error GLES2DecoderPassthroughImpl::DoDeleteTransformFeedbacks( |
343 GLsizei n, | 629 GLsizei n, |
344 const volatile GLuint* ids) { | 630 const volatile GLuint* ids) { |
345 return error::kNoError; | 631 return DeleteHelper(n, ids, &transform_feedback_id_map_, |
| 632 [](GLsizei n, GLuint* transform_feedbacks) { |
| 633 glDeleteTransformFeedbacks(n, transform_feedbacks); |
| 634 }); |
346 } | 635 } |
347 | 636 |
348 error::Error GLES2DecoderPassthroughImpl::DoDepthFunc(GLenum func) { | 637 error::Error GLES2DecoderPassthroughImpl::DoDepthFunc(GLenum func) { |
| 638 glDepthFunc(func); |
349 return error::kNoError; | 639 return error::kNoError; |
350 } | 640 } |
351 | 641 |
352 error::Error GLES2DecoderPassthroughImpl::DoDepthMask(GLboolean flag) { | 642 error::Error GLES2DecoderPassthroughImpl::DoDepthMask(GLboolean flag) { |
| 643 glDepthMask(flag); |
353 return error::kNoError; | 644 return error::kNoError; |
354 } | 645 } |
355 | 646 |
356 error::Error GLES2DecoderPassthroughImpl::DoDepthRangef(GLclampf zNear, | 647 error::Error GLES2DecoderPassthroughImpl::DoDepthRangef(GLclampf zNear, |
357 GLclampf zFar) { | 648 GLclampf zFar) { |
| 649 glDepthRangef(zNear, zFar); |
358 return error::kNoError; | 650 return error::kNoError; |
359 } | 651 } |
360 | 652 |
361 error::Error GLES2DecoderPassthroughImpl::DoDetachShader(GLuint program, | 653 error::Error GLES2DecoderPassthroughImpl::DoDetachShader(GLuint program, |
362 GLuint shader) { | 654 GLuint shader) { |
| 655 glDetachShader(GetProgramServiceID(program, resources_), |
| 656 GetShaderServiceID(shader, resources_)); |
363 return error::kNoError; | 657 return error::kNoError; |
364 } | 658 } |
365 | 659 |
366 error::Error GLES2DecoderPassthroughImpl::DoDisable(GLenum cap) { | 660 error::Error GLES2DecoderPassthroughImpl::DoDisable(GLenum cap) { |
| 661 glDisable(cap); |
367 return error::kNoError; | 662 return error::kNoError; |
368 } | 663 } |
369 | 664 |
370 error::Error GLES2DecoderPassthroughImpl::DoDisableVertexAttribArray( | 665 error::Error GLES2DecoderPassthroughImpl::DoDisableVertexAttribArray( |
371 GLuint index) { | 666 GLuint index) { |
| 667 glDisableVertexAttribArray(index); |
372 return error::kNoError; | 668 return error::kNoError; |
373 } | 669 } |
374 | 670 |
375 error::Error GLES2DecoderPassthroughImpl::DoDrawArrays(GLenum mode, | 671 error::Error GLES2DecoderPassthroughImpl::DoDrawArrays(GLenum mode, |
376 GLint first, | 672 GLint first, |
377 GLsizei count) { | 673 GLsizei count) { |
| 674 glDrawArrays(mode, first, count); |
378 return error::kNoError; | 675 return error::kNoError; |
379 } | 676 } |
380 | 677 |
381 error::Error GLES2DecoderPassthroughImpl::DoDrawElements(GLenum mode, | 678 error::Error GLES2DecoderPassthroughImpl::DoDrawElements(GLenum mode, |
382 GLsizei count, | 679 GLsizei count, |
383 GLenum type, | 680 GLenum type, |
384 const void* indices) { | 681 const void* indices) { |
| 682 glDrawElements(mode, count, type, indices); |
385 return error::kNoError; | 683 return error::kNoError; |
386 } | 684 } |
387 | 685 |
388 error::Error GLES2DecoderPassthroughImpl::DoEnable(GLenum cap) { | 686 error::Error GLES2DecoderPassthroughImpl::DoEnable(GLenum cap) { |
| 687 glEnable(cap); |
389 return error::kNoError; | 688 return error::kNoError; |
390 } | 689 } |
391 | 690 |
392 error::Error GLES2DecoderPassthroughImpl::DoEnableVertexAttribArray( | 691 error::Error GLES2DecoderPassthroughImpl::DoEnableVertexAttribArray( |
393 GLuint index) { | 692 GLuint index) { |
| 693 glEnableVertexAttribArray(index); |
394 return error::kNoError; | 694 return error::kNoError; |
395 } | 695 } |
396 | 696 |
397 error::Error GLES2DecoderPassthroughImpl::DoFenceSync(GLenum condition, | 697 error::Error GLES2DecoderPassthroughImpl::DoFenceSync(GLenum condition, |
398 GLbitfield flags, | 698 GLbitfield flags, |
399 GLuint client_id) { | 699 GLuint client_id) { |
| 700 NOTIMPLEMENTED(); |
400 return error::kNoError; | 701 return error::kNoError; |
401 } | 702 } |
402 | 703 |
403 error::Error GLES2DecoderPassthroughImpl::DoFinish() { | 704 error::Error GLES2DecoderPassthroughImpl::DoFinish() { |
| 705 glFinish(); |
404 return error::kNoError; | 706 return error::kNoError; |
405 } | 707 } |
406 | 708 |
407 error::Error GLES2DecoderPassthroughImpl::DoFlush() { | 709 error::Error GLES2DecoderPassthroughImpl::DoFlush() { |
| 710 glFlush(); |
408 return error::kNoError; | 711 return error::kNoError; |
409 } | 712 } |
410 | 713 |
411 error::Error GLES2DecoderPassthroughImpl::DoFramebufferRenderbuffer( | 714 error::Error GLES2DecoderPassthroughImpl::DoFramebufferRenderbuffer( |
412 GLenum target, | 715 GLenum target, |
413 GLenum attachment, | 716 GLenum attachment, |
414 GLenum renderbuffertarget, | 717 GLenum renderbuffertarget, |
415 GLuint renderbuffer) { | 718 GLuint renderbuffer) { |
| 719 // TODO(geofflang): Handle this case in ANGLE by adding a WebGL validation |
| 720 // mode. |
| 721 if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| 722 glFramebufferRenderbufferEXT( |
| 723 target, GL_DEPTH_ATTACHMENT, renderbuffertarget, |
| 724 GetRenderbufferServiceID(renderbuffer, resources_, false)); |
| 725 glFramebufferRenderbufferEXT( |
| 726 target, GL_STENCIL_ATTACHMENT, renderbuffertarget, |
| 727 GetRenderbufferServiceID(renderbuffer, resources_, false)); |
| 728 } else { |
| 729 glFramebufferRenderbufferEXT( |
| 730 target, attachment, renderbuffertarget, |
| 731 GetRenderbufferServiceID(renderbuffer, resources_, false)); |
| 732 } |
416 return error::kNoError; | 733 return error::kNoError; |
417 } | 734 } |
418 | 735 |
419 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2D( | 736 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2D( |
420 GLenum target, | 737 GLenum target, |
421 GLenum attachment, | 738 GLenum attachment, |
422 GLenum textarget, | 739 GLenum textarget, |
423 GLuint texture, | 740 GLuint texture, |
424 GLint level) { | 741 GLint level) { |
| 742 glFramebufferTexture2DEXT(target, attachment, textarget, |
| 743 GetTextureServiceID(texture, resources_, false), |
| 744 level); |
425 return error::kNoError; | 745 return error::kNoError; |
426 } | 746 } |
427 | 747 |
428 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTextureLayer( | 748 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTextureLayer( |
429 GLenum target, | 749 GLenum target, |
430 GLenum attachment, | 750 GLenum attachment, |
431 GLuint texture, | 751 GLuint texture, |
432 GLint level, | 752 GLint level, |
433 GLint layer) { | 753 GLint layer) { |
| 754 glFramebufferTextureLayer(target, attachment, |
| 755 GetTextureServiceID(texture, resources_, false), |
| 756 level, layer); |
434 return error::kNoError; | 757 return error::kNoError; |
435 } | 758 } |
436 | 759 |
437 error::Error GLES2DecoderPassthroughImpl::DoFrontFace(GLenum mode) { | 760 error::Error GLES2DecoderPassthroughImpl::DoFrontFace(GLenum mode) { |
| 761 glFrontFace(mode); |
438 return error::kNoError; | 762 return error::kNoError; |
439 } | 763 } |
440 | 764 |
441 error::Error GLES2DecoderPassthroughImpl::DoGenBuffers( | 765 error::Error GLES2DecoderPassthroughImpl::DoGenBuffers( |
442 GLsizei n, | 766 GLsizei n, |
443 volatile GLuint* buffers) { | 767 volatile GLuint* buffers) { |
444 return error::kNoError; | 768 return GenHelper( |
| 769 n, buffers, &resources_->buffer_id_map, |
| 770 [](GLsizei n, GLuint* buffers) { glGenBuffersARB(n, buffers); }); |
445 } | 771 } |
446 | 772 |
447 error::Error GLES2DecoderPassthroughImpl::DoGenerateMipmap(GLenum target) { | 773 error::Error GLES2DecoderPassthroughImpl::DoGenerateMipmap(GLenum target) { |
| 774 glGenerateMipmapEXT(target); |
448 return error::kNoError; | 775 return error::kNoError; |
449 } | 776 } |
450 | 777 |
451 error::Error GLES2DecoderPassthroughImpl::DoGenFramebuffers( | 778 error::Error GLES2DecoderPassthroughImpl::DoGenFramebuffers( |
452 GLsizei n, | 779 GLsizei n, |
453 volatile GLuint* framebuffers) { | 780 volatile GLuint* framebuffers) { |
454 return error::kNoError; | 781 return GenHelper(n, framebuffers, &framebuffer_id_map_, |
| 782 [](GLsizei n, GLuint* framebuffers) { |
| 783 glGenFramebuffersEXT(n, framebuffers); |
| 784 }); |
455 } | 785 } |
456 | 786 |
457 error::Error GLES2DecoderPassthroughImpl::DoGenRenderbuffers( | 787 error::Error GLES2DecoderPassthroughImpl::DoGenRenderbuffers( |
458 GLsizei n, | 788 GLsizei n, |
459 volatile GLuint* renderbuffers) { | 789 volatile GLuint* renderbuffers) { |
460 return error::kNoError; | 790 return GenHelper(n, renderbuffers, &resources_->renderbuffer_id_map, |
| 791 [](GLsizei n, GLuint* renderbuffers) { |
| 792 glGenRenderbuffersEXT(n, renderbuffers); |
| 793 }); |
461 } | 794 } |
462 | 795 |
463 error::Error GLES2DecoderPassthroughImpl::DoGenSamplers( | 796 error::Error GLES2DecoderPassthroughImpl::DoGenSamplers( |
464 GLsizei n, | 797 GLsizei n, |
465 volatile GLuint* samplers) { | 798 volatile GLuint* samplers) { |
466 return error::kNoError; | 799 return GenHelper( |
| 800 n, samplers, &resources_->sampler_id_map, |
| 801 [](GLsizei n, GLuint* samplers) { glGenSamplers(n, samplers); }); |
467 } | 802 } |
468 | 803 |
469 error::Error GLES2DecoderPassthroughImpl::DoGenTextures( | 804 error::Error GLES2DecoderPassthroughImpl::DoGenTextures( |
470 GLsizei n, | 805 GLsizei n, |
471 volatile GLuint* textures) { | 806 volatile GLuint* textures) { |
472 return error::kNoError; | 807 return GenHelper( |
| 808 n, textures, &resources_->texture_id_map, |
| 809 [](GLsizei n, GLuint* textures) { glGenTextures(n, textures); }); |
473 } | 810 } |
474 | 811 |
475 error::Error GLES2DecoderPassthroughImpl::DoGenTransformFeedbacks( | 812 error::Error GLES2DecoderPassthroughImpl::DoGenTransformFeedbacks( |
476 GLsizei n, | 813 GLsizei n, |
477 volatile GLuint* ids) { | 814 volatile GLuint* ids) { |
478 return error::kNoError; | 815 return GenHelper(n, ids, &transform_feedback_id_map_, |
| 816 [](GLsizei n, GLuint* transform_feedbacks) { |
| 817 glGenTransformFeedbacks(n, transform_feedbacks); |
| 818 }); |
479 } | 819 } |
480 | 820 |
481 error::Error GLES2DecoderPassthroughImpl::DoGetActiveAttrib(GLuint program, | 821 error::Error GLES2DecoderPassthroughImpl::DoGetActiveAttrib(GLuint program, |
482 GLuint index, | 822 GLuint index, |
483 GLint* size, | 823 GLint* size, |
484 GLenum* type, | 824 GLenum* type, |
485 std::string* name) { | 825 std::string* name) { |
| 826 NOTIMPLEMENTED(); |
486 return error::kNoError; | 827 return error::kNoError; |
487 } | 828 } |
488 | 829 |
489 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniform( | 830 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniform( |
490 GLuint program, | 831 GLuint program, |
491 GLuint index, | 832 GLuint index, |
492 GLint* size, | 833 GLint* size, |
493 GLenum* type, | 834 GLenum* type, |
494 std::string* name) { | 835 std::string* name) { |
| 836 NOTIMPLEMENTED(); |
495 return error::kNoError; | 837 return error::kNoError; |
496 } | 838 } |
497 | 839 |
498 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockiv( | 840 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockiv( |
499 GLuint program, | 841 GLuint program, |
500 GLuint index, | 842 GLuint index, |
501 GLenum pname, | 843 GLenum pname, |
502 GLsizei bufSize, | 844 GLsizei bufSize, |
503 GLsizei* length, | 845 GLsizei* length, |
504 GLint* params) { | 846 GLint* params) { |
| 847 NOTIMPLEMENTED(); |
505 return error::kNoError; | 848 return error::kNoError; |
506 } | 849 } |
507 | 850 |
508 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockName( | 851 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockName( |
509 GLuint program, | 852 GLuint program, |
510 GLuint index, | 853 GLuint index, |
511 std::string* name) { | 854 std::string* name) { |
| 855 NOTIMPLEMENTED(); |
512 return error::kNoError; | 856 return error::kNoError; |
513 } | 857 } |
514 | 858 |
515 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformsiv( | 859 error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformsiv( |
516 GLuint program, | 860 GLuint program, |
517 GLsizei count, | 861 GLsizei count, |
518 const GLuint* indices, | 862 const GLuint* indices, |
519 GLenum pname, | 863 GLenum pname, |
520 GLsizei bufSize, | 864 GLsizei bufSize, |
521 GLsizei* length, | 865 GLsizei* length, |
522 GLint* params) { | 866 GLint* params) { |
| 867 NOTIMPLEMENTED(); |
523 return error::kNoError; | 868 return error::kNoError; |
524 } | 869 } |
525 | 870 |
526 error::Error GLES2DecoderPassthroughImpl::DoGetAttachedShaders( | 871 error::Error GLES2DecoderPassthroughImpl::DoGetAttachedShaders( |
527 GLuint program, | 872 GLuint program, |
528 GLsizei maxcount, | 873 GLsizei maxcount, |
529 GLsizei* count, | 874 GLsizei* count, |
530 GLuint* shaders) { | 875 GLuint* shaders) { |
| 876 NOTIMPLEMENTED(); |
531 return error::kNoError; | 877 return error::kNoError; |
532 } | 878 } |
533 | 879 |
534 error::Error GLES2DecoderPassthroughImpl::DoGetAttribLocation(GLuint program, | 880 error::Error GLES2DecoderPassthroughImpl::DoGetAttribLocation(GLuint program, |
535 const char* name, | 881 const char* name, |
536 GLint* result) { | 882 GLint* result) { |
| 883 NOTIMPLEMENTED(); |
537 return error::kNoError; | 884 return error::kNoError; |
538 } | 885 } |
539 | 886 |
540 error::Error GLES2DecoderPassthroughImpl::DoGetBooleanv(GLenum pname, | 887 error::Error GLES2DecoderPassthroughImpl::DoGetBooleanv(GLenum pname, |
541 GLsizei bufsize, | 888 GLsizei bufsize, |
542 GLsizei* length, | 889 GLsizei* length, |
543 GLboolean* params) { | 890 GLboolean* params) { |
| 891 // TODO(geofflang): new-style getter |
| 892 glGetBooleanv(pname, params); |
| 893 *length = 1; |
544 return error::kNoError; | 894 return error::kNoError; |
545 } | 895 } |
546 | 896 |
547 error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteri64v( | 897 error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteri64v( |
548 GLenum target, | 898 GLenum target, |
549 GLenum pname, | 899 GLenum pname, |
550 GLsizei bufsize, | 900 GLsizei bufsize, |
551 GLsizei* length, | 901 GLsizei* length, |
552 GLint64* params) { | 902 GLint64* params) { |
| 903 NOTIMPLEMENTED(); |
| 904 // TODO(geofflang): new-style getter |
| 905 // TODO(geofflang): missing glGetBufferParameteri64v? |
| 906 // glGetBufferParameteri64v(target, pname, params); |
| 907 *length = 1; |
553 return error::kNoError; | 908 return error::kNoError; |
554 } | 909 } |
555 | 910 |
556 error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteriv( | 911 error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteriv( |
557 GLenum target, | 912 GLenum target, |
558 GLenum pname, | 913 GLenum pname, |
559 GLsizei bufsize, | 914 GLsizei bufsize, |
560 GLsizei* length, | 915 GLsizei* length, |
561 GLint* params) { | 916 GLint* params) { |
| 917 // TODO(geofflang): new-style getter |
| 918 glGetBufferParameteriv(target, pname, params); |
| 919 *length = 1; |
562 return error::kNoError; | 920 return error::kNoError; |
563 } | 921 } |
564 | 922 |
565 error::Error GLES2DecoderPassthroughImpl::DoGetError(uint32_t* result) { | 923 error::Error GLES2DecoderPassthroughImpl::DoGetError(uint32_t* result) { |
| 924 *result = glGetError(); |
566 return error::kNoError; | 925 return error::kNoError; |
567 } | 926 } |
568 | 927 |
569 error::Error GLES2DecoderPassthroughImpl::DoGetFloatv(GLenum pname, | 928 error::Error GLES2DecoderPassthroughImpl::DoGetFloatv(GLenum pname, |
570 GLsizei bufsize, | 929 GLsizei bufsize, |
571 GLsizei* length, | 930 GLsizei* length, |
572 GLfloat* params) { | 931 GLfloat* params) { |
| 932 // TODO(geofflang): new-style getter |
| 933 glGetFloatv(pname, params); |
| 934 *length = 1; |
573 return error::kNoError; | 935 return error::kNoError; |
574 } | 936 } |
575 | 937 |
576 error::Error GLES2DecoderPassthroughImpl::DoGetFragDataLocation( | 938 error::Error GLES2DecoderPassthroughImpl::DoGetFragDataLocation( |
577 GLuint program, | 939 GLuint program, |
578 const char* name, | 940 const char* name, |
579 GLint* result) { | 941 GLint* result) { |
| 942 NOTIMPLEMENTED(); |
580 return error::kNoError; | 943 return error::kNoError; |
581 } | 944 } |
582 | 945 |
583 error::Error GLES2DecoderPassthroughImpl::DoGetFramebufferAttachmentParameteriv( | 946 error::Error GLES2DecoderPassthroughImpl::DoGetFramebufferAttachmentParameteriv( |
584 GLenum target, | 947 GLenum target, |
585 GLenum attachment, | 948 GLenum attachment, |
586 GLenum pname, | 949 GLenum pname, |
587 GLsizei bufsize, | 950 GLsizei bufsize, |
588 GLsizei* length, | 951 GLsizei* length, |
589 GLint* params) { | 952 GLint* params) { |
| 953 // TODO(geofflang): new-style getter |
| 954 glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); |
| 955 *length = 1; |
590 return error::kNoError; | 956 return error::kNoError; |
591 } | 957 } |
592 | 958 |
593 error::Error GLES2DecoderPassthroughImpl::DoGetInteger64v(GLenum pname, | 959 error::Error GLES2DecoderPassthroughImpl::DoGetInteger64v(GLenum pname, |
594 GLsizei bufsize, | 960 GLsizei bufsize, |
595 GLsizei* length, | 961 GLsizei* length, |
596 GLint64* params) { | 962 GLint64* params) { |
| 963 // TODO(geofflang): new-style getter |
| 964 glGetInteger64v(pname, params); |
| 965 *length = 1; |
597 return error::kNoError; | 966 return error::kNoError; |
598 } | 967 } |
599 | 968 |
600 error::Error GLES2DecoderPassthroughImpl::DoGetIntegeri_v(GLenum pname, | 969 error::Error GLES2DecoderPassthroughImpl::DoGetIntegeri_v(GLenum pname, |
601 GLuint index, | 970 GLuint index, |
602 GLsizei bufsize, | 971 GLsizei bufsize, |
603 GLsizei* length, | 972 GLsizei* length, |
604 GLint* data) { | 973 GLint* data) { |
| 974 // TODO(geofflang): new-style getter |
| 975 glGetIntegeri_v(pname, index, data); |
| 976 *length = 1; |
605 return error::kNoError; | 977 return error::kNoError; |
606 } | 978 } |
607 | 979 |
608 error::Error GLES2DecoderPassthroughImpl::DoGetInteger64i_v(GLenum pname, | 980 error::Error GLES2DecoderPassthroughImpl::DoGetInteger64i_v(GLenum pname, |
609 GLuint index, | 981 GLuint index, |
610 GLsizei bufsize, | 982 GLsizei bufsize, |
611 GLsizei* length, | 983 GLsizei* length, |
612 GLint64* data) { | 984 GLint64* data) { |
| 985 // TODO(geofflang): new-style getter |
| 986 glGetInteger64i_v(pname, index, data); |
| 987 *length = 1; |
613 return error::kNoError; | 988 return error::kNoError; |
614 } | 989 } |
615 | 990 |
616 error::Error GLES2DecoderPassthroughImpl::DoGetIntegerv(GLenum pname, | 991 error::Error GLES2DecoderPassthroughImpl::DoGetIntegerv(GLenum pname, |
617 GLsizei bufsize, | 992 GLsizei bufsize, |
618 GLsizei* length, | 993 GLsizei* length, |
619 GLint* params) { | 994 GLint* params) { |
| 995 // TODO(geofflang): new-style getter |
| 996 glGetIntegerv(pname, params); |
| 997 *length = 1; |
| 998 // HACK: WebGL initialization requires this query |
| 999 if (pname == GL_MAX_VIEWPORT_DIMS) { |
| 1000 *length = 2; |
| 1001 } |
620 return error::kNoError; | 1002 return error::kNoError; |
621 } | 1003 } |
622 | 1004 |
623 error::Error GLES2DecoderPassthroughImpl::DoGetInternalformativ(GLenum target, | 1005 error::Error GLES2DecoderPassthroughImpl::DoGetInternalformativ(GLenum target, |
624 GLenum format, | 1006 GLenum format, |
625 GLenum pname, | 1007 GLenum pname, |
626 GLsizei bufSize, | 1008 GLsizei bufSize, |
627 GLsizei* length, | 1009 GLsizei* length, |
628 GLint* params) { | 1010 GLint* params) { |
| 1011 // TODO(geofflang): new-style getter |
| 1012 glGetInternalformativ(target, format, pname, bufSize, params); |
| 1013 *length = 1; |
629 return error::kNoError; | 1014 return error::kNoError; |
630 } | 1015 } |
631 | 1016 |
632 error::Error GLES2DecoderPassthroughImpl::DoGetProgramiv(GLuint program, | 1017 error::Error GLES2DecoderPassthroughImpl::DoGetProgramiv(GLuint program, |
633 GLenum pname, | 1018 GLenum pname, |
634 GLsizei bufsize, | 1019 GLsizei bufsize, |
635 GLsizei* length, | 1020 GLsizei* length, |
636 GLint* params) { | 1021 GLint* params) { |
| 1022 // TODO(geofflang): new-style getter |
| 1023 glGetProgramiv(GetProgramServiceID(program, resources_), pname, params); |
| 1024 *length = 1; |
637 return error::kNoError; | 1025 return error::kNoError; |
638 } | 1026 } |
639 | 1027 |
640 error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoLog( | 1028 error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoLog( |
641 GLuint program, | 1029 GLuint program, |
642 std::string* infolog) { | 1030 std::string* infolog) { |
| 1031 GLint info_log_len = 0; |
| 1032 glGetProgramiv(GetProgramServiceID(program, resources_), GL_INFO_LOG_LENGTH, |
| 1033 &info_log_len); |
| 1034 |
| 1035 std::vector<char> buffer(info_log_len, 0); |
| 1036 glGetProgramInfoLog(GetProgramServiceID(program, resources_), info_log_len, |
| 1037 nullptr, buffer.data()); |
| 1038 *infolog = std::string(buffer.data()); |
643 return error::kNoError; | 1039 return error::kNoError; |
644 } | 1040 } |
645 | 1041 |
646 error::Error GLES2DecoderPassthroughImpl::DoGetRenderbufferParameteriv( | 1042 error::Error GLES2DecoderPassthroughImpl::DoGetRenderbufferParameteriv( |
647 GLenum target, | 1043 GLenum target, |
648 GLenum pname, | 1044 GLenum pname, |
649 GLsizei bufsize, | 1045 GLsizei bufsize, |
650 GLsizei* length, | 1046 GLsizei* length, |
651 GLint* params) { | 1047 GLint* params) { |
| 1048 NOTIMPLEMENTED(); |
652 return error::kNoError; | 1049 return error::kNoError; |
653 } | 1050 } |
654 | 1051 |
655 error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameterfv( | 1052 error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameterfv( |
656 GLuint sampler, | 1053 GLuint sampler, |
657 GLenum pname, | 1054 GLenum pname, |
658 GLsizei bufsize, | 1055 GLsizei bufsize, |
659 GLsizei* length, | 1056 GLsizei* length, |
660 GLfloat* params) { | 1057 GLfloat* params) { |
| 1058 // TODO(geofflang): new-style getter |
| 1059 glGetSamplerParameterfv(GetSamplerServiceID(sampler, resources_), pname, |
| 1060 params); |
| 1061 *length = 1; |
661 return error::kNoError; | 1062 return error::kNoError; |
662 } | 1063 } |
663 | 1064 |
664 error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameteriv( | 1065 error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameteriv( |
665 GLuint sampler, | 1066 GLuint sampler, |
666 GLenum pname, | 1067 GLenum pname, |
667 GLsizei bufsize, | 1068 GLsizei bufsize, |
668 GLsizei* length, | 1069 GLsizei* length, |
669 GLint* params) { | 1070 GLint* params) { |
| 1071 NOTIMPLEMENTED(); |
| 1072 // TODO(geofflang): new-style getter |
| 1073 // glGetRenderbufferParameterivEXT(target, pname, params); |
| 1074 *length = 1; |
670 return error::kNoError; | 1075 return error::kNoError; |
671 } | 1076 } |
672 | 1077 |
673 error::Error GLES2DecoderPassthroughImpl::DoGetShaderiv(GLuint shader, | 1078 error::Error GLES2DecoderPassthroughImpl::DoGetShaderiv(GLuint shader, |
674 GLenum pname, | 1079 GLenum pname, |
675 GLsizei bufsize, | 1080 GLsizei bufsize, |
676 GLsizei* length, | 1081 GLsizei* length, |
677 GLint* params) { | 1082 GLint* params) { |
| 1083 // TODO(geofflang): new-style getter |
| 1084 glGetShaderiv(GetShaderServiceID(shader, resources_), pname, params); |
| 1085 *length = 1; |
678 return error::kNoError; | 1086 return error::kNoError; |
679 } | 1087 } |
680 | 1088 |
681 error::Error GLES2DecoderPassthroughImpl::DoGetShaderInfoLog( | 1089 error::Error GLES2DecoderPassthroughImpl::DoGetShaderInfoLog( |
682 GLuint shader, | 1090 GLuint shader, |
683 std::string* infolog) { | 1091 std::string* infolog) { |
| 1092 GLuint service_id = GetShaderServiceID(shader, resources_); |
| 1093 GLint info_log_len = 0; |
| 1094 glGetShaderiv(service_id, GL_INFO_LOG_LENGTH, &info_log_len); |
| 1095 std::vector<char> buffer(info_log_len, 0); |
| 1096 glGetShaderInfoLog(service_id, info_log_len, nullptr, buffer.data()); |
| 1097 *infolog = std::string(buffer.data()); |
684 return error::kNoError; | 1098 return error::kNoError; |
685 } | 1099 } |
686 | 1100 |
687 error::Error GLES2DecoderPassthroughImpl::DoGetShaderPrecisionFormat( | 1101 error::Error GLES2DecoderPassthroughImpl::DoGetShaderPrecisionFormat( |
688 GLenum shadertype, | 1102 GLenum shadertype, |
689 GLenum precisiontype, | 1103 GLenum precisiontype, |
690 GLint* range, | 1104 GLint* range, |
691 GLint* precision) { | 1105 GLint* precision) { |
| 1106 glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); |
692 return error::kNoError; | 1107 return error::kNoError; |
693 } | 1108 } |
694 | 1109 |
695 error::Error GLES2DecoderPassthroughImpl::DoGetShaderSource( | 1110 error::Error GLES2DecoderPassthroughImpl::DoGetShaderSource( |
696 GLuint shader, | 1111 GLuint shader, |
697 std::string* source) { | 1112 std::string* source) { |
| 1113 NOTIMPLEMENTED(); |
698 return error::kNoError; | 1114 return error::kNoError; |
699 } | 1115 } |
700 | 1116 |
701 error::Error GLES2DecoderPassthroughImpl::DoGetString(GLenum name, | 1117 error::Error GLES2DecoderPassthroughImpl::DoGetString(GLenum name, |
702 const char** result) { | 1118 const char** result) { |
| 1119 // TODO(geofflang): Append additional CHROMIUM extension strings? |
| 1120 *result = reinterpret_cast<const char*>(glGetString(name)); |
703 return error::kNoError; | 1121 return error::kNoError; |
704 } | 1122 } |
705 | 1123 |
706 error::Error GLES2DecoderPassthroughImpl::DoGetSynciv(GLuint sync, | 1124 error::Error GLES2DecoderPassthroughImpl::DoGetSynciv(GLuint sync, |
707 GLenum pname, | 1125 GLenum pname, |
708 GLsizei bufsize, | 1126 GLsizei bufsize, |
709 GLsizei* length, | 1127 GLsizei* length, |
710 GLint* values) { | 1128 GLint* values) { |
| 1129 glGetSynciv(GetSyncServiceID(sync, resources_), pname, bufsize, length, |
| 1130 values); |
711 return error::kNoError; | 1131 return error::kNoError; |
712 } | 1132 } |
713 | 1133 |
714 error::Error GLES2DecoderPassthroughImpl::DoGetTexParameterfv(GLenum target, | 1134 error::Error GLES2DecoderPassthroughImpl::DoGetTexParameterfv(GLenum target, |
715 GLenum pname, | 1135 GLenum pname, |
716 GLsizei bufsize, | 1136 GLsizei bufsize, |
717 GLsizei* length, | 1137 GLsizei* length, |
718 GLfloat* params) { | 1138 GLfloat* params) { |
| 1139 // TODO(geofflang): new-style getter |
| 1140 glGetTexParameterfv(target, pname, params); |
| 1141 *length = 1; |
719 return error::kNoError; | 1142 return error::kNoError; |
720 } | 1143 } |
721 | 1144 |
722 error::Error GLES2DecoderPassthroughImpl::DoGetTexParameteriv(GLenum target, | 1145 error::Error GLES2DecoderPassthroughImpl::DoGetTexParameteriv(GLenum target, |
723 GLenum pname, | 1146 GLenum pname, |
724 GLsizei bufsize, | 1147 GLsizei bufsize, |
725 GLsizei* length, | 1148 GLsizei* length, |
726 GLint* params) { | 1149 GLint* params) { |
| 1150 // TODO(geofflang): new-style getter |
| 1151 glGetTexParameteriv(target, pname, params); |
| 1152 *length = 1; |
727 return error::kNoError; | 1153 return error::kNoError; |
728 } | 1154 } |
729 | 1155 |
730 error::Error GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVarying( | 1156 error::Error GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVarying( |
731 GLuint program, | 1157 GLuint program, |
732 GLuint index, | 1158 GLuint index, |
733 GLsizei* size, | 1159 GLsizei* size, |
734 GLenum* type, | 1160 GLenum* type, |
735 std::string* name) { | 1161 std::string* name) { |
| 1162 NOTIMPLEMENTED(); |
736 return error::kNoError; | 1163 return error::kNoError; |
737 } | 1164 } |
738 | 1165 |
739 error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlockIndex( | 1166 error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlockIndex( |
740 GLuint program, | 1167 GLuint program, |
741 const char* name, | 1168 const char* name, |
742 GLint* index) { | 1169 GLint* index) { |
| 1170 NOTIMPLEMENTED(); |
743 return error::kNoError; | 1171 return error::kNoError; |
744 } | 1172 } |
745 | 1173 |
746 error::Error GLES2DecoderPassthroughImpl::DoGetUniformfv(GLuint program, | 1174 error::Error GLES2DecoderPassthroughImpl::DoGetUniformfv(GLuint program, |
747 GLint location, | 1175 GLint location, |
748 GLsizei bufsize, | 1176 GLsizei bufsize, |
749 GLsizei* length, | 1177 GLsizei* length, |
750 GLfloat* params) { | 1178 GLfloat* params) { |
| 1179 // TODO(geofflang): new-style getter |
| 1180 glGetUniformfv(GetProgramServiceID(program, resources_), location, params); |
| 1181 *length = 1; |
751 return error::kNoError; | 1182 return error::kNoError; |
752 } | 1183 } |
753 | 1184 |
754 error::Error GLES2DecoderPassthroughImpl::DoGetUniformiv(GLuint program, | 1185 error::Error GLES2DecoderPassthroughImpl::DoGetUniformiv(GLuint program, |
755 GLint location, | 1186 GLint location, |
756 GLsizei bufsize, | 1187 GLsizei bufsize, |
757 GLsizei* length, | 1188 GLsizei* length, |
758 GLint* params) { | 1189 GLint* params) { |
| 1190 // TODO(geofflang): new-style getter |
| 1191 glGetUniformiv(GetProgramServiceID(program, resources_), location, params); |
| 1192 *length = 1; |
759 return error::kNoError; | 1193 return error::kNoError; |
760 } | 1194 } |
761 | 1195 |
762 error::Error GLES2DecoderPassthroughImpl::DoGetUniformuiv(GLuint program, | 1196 error::Error GLES2DecoderPassthroughImpl::DoGetUniformuiv(GLuint program, |
763 GLint location, | 1197 GLint location, |
764 GLsizei bufsize, | 1198 GLsizei bufsize, |
765 GLsizei* length, | 1199 GLsizei* length, |
766 GLuint* params) { | 1200 GLuint* params) { |
| 1201 // TODO(geofflang): new-style getter |
| 1202 glGetUniformuiv(GetProgramServiceID(program, resources_), location, params); |
| 1203 *length = 1; |
767 return error::kNoError; | 1204 return error::kNoError; |
768 } | 1205 } |
769 | 1206 |
770 error::Error GLES2DecoderPassthroughImpl::DoGetUniformIndices( | 1207 error::Error GLES2DecoderPassthroughImpl::DoGetUniformIndices( |
771 GLuint program, | 1208 GLuint program, |
772 GLsizei count, | 1209 GLsizei count, |
773 const char* const* names, | 1210 const char* const* names, |
774 GLsizei bufSize, | 1211 GLsizei bufSize, |
775 GLsizei* length, | 1212 GLsizei* length, |
776 GLuint* indices) { | 1213 GLuint* indices) { |
| 1214 NOTIMPLEMENTED(); |
777 return error::kNoError; | 1215 return error::kNoError; |
778 } | 1216 } |
779 | 1217 |
780 error::Error GLES2DecoderPassthroughImpl::DoGetUniformLocation( | 1218 error::Error GLES2DecoderPassthroughImpl::DoGetUniformLocation( |
781 GLuint program, | 1219 GLuint program, |
782 const char* name, | 1220 const char* name, |
783 GLint* location) { | 1221 GLint* location) { |
| 1222 *location = |
| 1223 glGetUniformLocation(GetProgramServiceID(program, resources_), name); |
784 return error::kNoError; | 1224 return error::kNoError; |
785 } | 1225 } |
786 | 1226 |
787 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribfv(GLuint index, | 1227 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribfv(GLuint index, |
788 GLenum pname, | 1228 GLenum pname, |
789 GLsizei bufsize, | 1229 GLsizei bufsize, |
790 GLsizei* length, | 1230 GLsizei* length, |
791 GLfloat* params) { | 1231 GLfloat* params) { |
| 1232 NOTIMPLEMENTED(); |
792 return error::kNoError; | 1233 return error::kNoError; |
793 } | 1234 } |
794 | 1235 |
795 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribiv(GLuint index, | 1236 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribiv(GLuint index, |
796 GLenum pname, | 1237 GLenum pname, |
797 GLsizei bufsize, | 1238 GLsizei bufsize, |
798 GLsizei* length, | 1239 GLsizei* length, |
799 GLint* params) { | 1240 GLint* params) { |
| 1241 NOTIMPLEMENTED(); |
800 return error::kNoError; | 1242 return error::kNoError; |
801 } | 1243 } |
802 | 1244 |
803 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIiv(GLuint index, | 1245 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIiv(GLuint index, |
804 GLenum pname, | 1246 GLenum pname, |
805 GLsizei bufsize, | 1247 GLsizei bufsize, |
806 GLsizei* length, | 1248 GLsizei* length, |
807 GLint* params) { | 1249 GLint* params) { |
| 1250 NOTIMPLEMENTED(); |
808 return error::kNoError; | 1251 return error::kNoError; |
809 } | 1252 } |
810 | 1253 |
811 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIuiv( | 1254 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIuiv( |
812 GLuint index, | 1255 GLuint index, |
813 GLenum pname, | 1256 GLenum pname, |
814 GLsizei bufsize, | 1257 GLsizei bufsize, |
815 GLsizei* length, | 1258 GLsizei* length, |
816 GLuint* params) { | 1259 GLuint* params) { |
| 1260 NOTIMPLEMENTED(); |
817 return error::kNoError; | 1261 return error::kNoError; |
818 } | 1262 } |
819 | 1263 |
820 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribPointerv( | 1264 error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribPointerv( |
821 GLuint index, | 1265 GLuint index, |
822 GLenum pname, | 1266 GLenum pname, |
823 GLsizei bufsize, | 1267 GLsizei bufsize, |
824 GLsizei* length, | 1268 GLsizei* length, |
825 GLuint* pointer) { | 1269 GLuint* pointer) { |
| 1270 NOTIMPLEMENTED(); |
826 return error::kNoError; | 1271 return error::kNoError; |
827 } | 1272 } |
828 | 1273 |
829 error::Error GLES2DecoderPassthroughImpl::DoHint(GLenum target, GLenum mode) { | 1274 error::Error GLES2DecoderPassthroughImpl::DoHint(GLenum target, GLenum mode) { |
| 1275 glHint(target, mode); |
830 return error::kNoError; | 1276 return error::kNoError; |
831 } | 1277 } |
832 | 1278 |
833 error::Error GLES2DecoderPassthroughImpl::DoInvalidateFramebuffer( | 1279 error::Error GLES2DecoderPassthroughImpl::DoInvalidateFramebuffer( |
834 GLenum target, | 1280 GLenum target, |
835 GLsizei count, | 1281 GLsizei count, |
836 const volatile GLenum* attachments) { | 1282 const volatile GLenum* attachments) { |
| 1283 std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| 1284 glInvalidateFramebuffer(target, count, attachments_copy.data()); |
837 return error::kNoError; | 1285 return error::kNoError; |
838 } | 1286 } |
839 | 1287 |
840 error::Error GLES2DecoderPassthroughImpl::DoInvalidateSubFramebuffer( | 1288 error::Error GLES2DecoderPassthroughImpl::DoInvalidateSubFramebuffer( |
841 GLenum target, | 1289 GLenum target, |
842 GLsizei count, | 1290 GLsizei count, |
843 const volatile GLenum* attachments, | 1291 const volatile GLenum* attachments, |
844 GLint x, | 1292 GLint x, |
845 GLint y, | 1293 GLint y, |
846 GLsizei width, | 1294 GLsizei width, |
847 GLsizei height) { | 1295 GLsizei height) { |
| 1296 std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| 1297 glInvalidateSubFramebuffer(target, count, attachments_copy.data(), x, y, |
| 1298 width, height); |
848 return error::kNoError; | 1299 return error::kNoError; |
849 } | 1300 } |
850 | 1301 |
851 error::Error GLES2DecoderPassthroughImpl::DoIsBuffer(GLuint buffer, | 1302 error::Error GLES2DecoderPassthroughImpl::DoIsBuffer(GLuint buffer, |
852 uint32_t* result) { | 1303 uint32_t* result) { |
| 1304 NOTIMPLEMENTED(); |
| 1305 *result = glIsBuffer(GetBufferServiceID(buffer, resources_, false)); |
853 return error::kNoError; | 1306 return error::kNoError; |
854 } | 1307 } |
855 | 1308 |
856 error::Error GLES2DecoderPassthroughImpl::DoIsEnabled(GLenum cap, | 1309 error::Error GLES2DecoderPassthroughImpl::DoIsEnabled(GLenum cap, |
857 uint32_t* result) { | 1310 uint32_t* result) { |
| 1311 *result = glIsEnabled(cap); |
858 return error::kNoError; | 1312 return error::kNoError; |
859 } | 1313 } |
860 | 1314 |
861 error::Error GLES2DecoderPassthroughImpl::DoIsFramebuffer(GLuint framebuffer, | 1315 error::Error GLES2DecoderPassthroughImpl::DoIsFramebuffer(GLuint framebuffer, |
862 uint32_t* result) { | 1316 uint32_t* result) { |
| 1317 *result = glIsFramebufferEXT( |
| 1318 GetFramebufferServiceID(framebuffer, &framebuffer_id_map_, false)); |
863 return error::kNoError; | 1319 return error::kNoError; |
864 } | 1320 } |
865 | 1321 |
866 error::Error GLES2DecoderPassthroughImpl::DoIsProgram(GLuint program, | 1322 error::Error GLES2DecoderPassthroughImpl::DoIsProgram(GLuint program, |
867 uint32_t* result) { | 1323 uint32_t* result) { |
| 1324 *result = glIsProgram(GetProgramServiceID(program, resources_)); |
868 return error::kNoError; | 1325 return error::kNoError; |
869 } | 1326 } |
870 | 1327 |
871 error::Error GLES2DecoderPassthroughImpl::DoIsRenderbuffer(GLuint renderbuffer, | 1328 error::Error GLES2DecoderPassthroughImpl::DoIsRenderbuffer(GLuint renderbuffer, |
872 uint32_t* result) { | 1329 uint32_t* result) { |
| 1330 NOTIMPLEMENTED(); |
| 1331 *result = glIsRenderbufferEXT( |
| 1332 GetRenderbufferServiceID(renderbuffer, resources_, false)); |
873 return error::kNoError; | 1333 return error::kNoError; |
874 } | 1334 } |
875 | 1335 |
876 error::Error GLES2DecoderPassthroughImpl::DoIsSampler(GLuint sampler, | 1336 error::Error GLES2DecoderPassthroughImpl::DoIsSampler(GLuint sampler, |
877 uint32_t* result) { | 1337 uint32_t* result) { |
| 1338 *result = glIsSampler(GetSamplerServiceID(sampler, resources_)); |
878 return error::kNoError; | 1339 return error::kNoError; |
879 } | 1340 } |
880 | 1341 |
881 error::Error GLES2DecoderPassthroughImpl::DoIsShader(GLuint shader, | 1342 error::Error GLES2DecoderPassthroughImpl::DoIsShader(GLuint shader, |
882 uint32_t* result) { | 1343 uint32_t* result) { |
| 1344 *result = glIsShader(GetShaderServiceID(shader, resources_)); |
883 return error::kNoError; | 1345 return error::kNoError; |
884 } | 1346 } |
885 | 1347 |
886 error::Error GLES2DecoderPassthroughImpl::DoIsSync(GLuint sync, | 1348 error::Error GLES2DecoderPassthroughImpl::DoIsSync(GLuint sync, |
887 uint32_t* result) { | 1349 uint32_t* result) { |
| 1350 *result = glIsSync(GetSyncServiceID(sync, resources_)); |
888 return error::kNoError; | 1351 return error::kNoError; |
889 } | 1352 } |
890 | 1353 |
891 error::Error GLES2DecoderPassthroughImpl::DoIsTexture(GLuint texture, | 1354 error::Error GLES2DecoderPassthroughImpl::DoIsTexture(GLuint texture, |
892 uint32_t* result) { | 1355 uint32_t* result) { |
| 1356 *result = glIsTexture(GetTextureServiceID(texture, resources_, false)); |
893 return error::kNoError; | 1357 return error::kNoError; |
894 } | 1358 } |
895 | 1359 |
896 error::Error GLES2DecoderPassthroughImpl::DoIsTransformFeedback( | 1360 error::Error GLES2DecoderPassthroughImpl::DoIsTransformFeedback( |
897 GLuint transformfeedback, | 1361 GLuint transformfeedback, |
898 uint32_t* result) { | 1362 uint32_t* result) { |
| 1363 *result = glIsTransformFeedback(GetTransformFeedbackServiceID( |
| 1364 transformfeedback, &transform_feedback_id_map_, false)); |
899 return error::kNoError; | 1365 return error::kNoError; |
900 } | 1366 } |
901 | 1367 |
902 error::Error GLES2DecoderPassthroughImpl::DoLineWidth(GLfloat width) { | 1368 error::Error GLES2DecoderPassthroughImpl::DoLineWidth(GLfloat width) { |
| 1369 glLineWidth(width); |
903 return error::kNoError; | 1370 return error::kNoError; |
904 } | 1371 } |
905 | 1372 |
906 error::Error GLES2DecoderPassthroughImpl::DoLinkProgram(GLuint program) { | 1373 error::Error GLES2DecoderPassthroughImpl::DoLinkProgram(GLuint program) { |
| 1374 glLinkProgram(GetProgramServiceID(program, resources_)); |
907 return error::kNoError; | 1375 return error::kNoError; |
908 } | 1376 } |
909 | 1377 |
910 error::Error GLES2DecoderPassthroughImpl::DoPauseTransformFeedback() { | 1378 error::Error GLES2DecoderPassthroughImpl::DoPauseTransformFeedback() { |
| 1379 glPauseTransformFeedback(); |
911 return error::kNoError; | 1380 return error::kNoError; |
912 } | 1381 } |
913 | 1382 |
914 error::Error GLES2DecoderPassthroughImpl::DoPixelStorei(GLenum pname, | 1383 error::Error GLES2DecoderPassthroughImpl::DoPixelStorei(GLenum pname, |
915 GLint param) { | 1384 GLint param) { |
| 1385 glPixelStorei(pname, param); |
916 return error::kNoError; | 1386 return error::kNoError; |
917 } | 1387 } |
918 | 1388 |
919 error::Error GLES2DecoderPassthroughImpl::DoPolygonOffset(GLfloat factor, | 1389 error::Error GLES2DecoderPassthroughImpl::DoPolygonOffset(GLfloat factor, |
920 GLfloat units) { | 1390 GLfloat units) { |
| 1391 glPolygonOffset(factor, units); |
921 return error::kNoError; | 1392 return error::kNoError; |
922 } | 1393 } |
923 | 1394 |
924 error::Error GLES2DecoderPassthroughImpl::DoReadBuffer(GLenum src) { | 1395 error::Error GLES2DecoderPassthroughImpl::DoReadBuffer(GLenum src) { |
| 1396 glReadBuffer(src); |
925 return error::kNoError; | 1397 return error::kNoError; |
926 } | 1398 } |
927 | 1399 |
928 error::Error GLES2DecoderPassthroughImpl::DoReadPixels(GLint x, | 1400 error::Error GLES2DecoderPassthroughImpl::DoReadPixels(GLint x, |
929 GLint y, | 1401 GLint y, |
930 GLsizei width, | 1402 GLsizei width, |
931 GLsizei height, | 1403 GLsizei height, |
932 GLenum format, | 1404 GLenum format, |
933 GLenum type, | 1405 GLenum type, |
934 GLsizei bufsize, | 1406 GLsizei bufsize, |
935 GLsizei* length, | 1407 GLsizei* length, |
936 void* pixels) { | 1408 void* pixels) { |
| 1409 glReadPixels(x, y, width, height, format, type, pixels); |
| 1410 |
| 1411 // HACK: Calculate the length here without taking into account the unpack |
| 1412 // parameters. |
| 1413 // Move into an ANGLE extension. |
| 1414 size_t componentCount = 4; |
| 1415 switch (format) { |
| 1416 case GL_RGBA: |
| 1417 componentCount = 4; |
| 1418 break; |
| 1419 case GL_RGB: |
| 1420 componentCount = 3; |
| 1421 break; |
| 1422 case GL_RG: |
| 1423 componentCount = 2; |
| 1424 break; |
| 1425 case GL_RED: |
| 1426 componentCount = 1; |
| 1427 break; |
| 1428 } |
| 1429 *length = width * height * componentCount * 4; |
| 1430 |
937 return error::kNoError; | 1431 return error::kNoError; |
938 } | 1432 } |
939 | 1433 |
940 error::Error GLES2DecoderPassthroughImpl::DoReleaseShaderCompiler() { | 1434 error::Error GLES2DecoderPassthroughImpl::DoReleaseShaderCompiler() { |
| 1435 glReleaseShaderCompiler(); |
941 return error::kNoError; | 1436 return error::kNoError; |
942 } | 1437 } |
943 | 1438 |
944 error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorage( | 1439 error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorage( |
945 GLenum target, | 1440 GLenum target, |
946 GLenum internalformat, | 1441 GLenum internalformat, |
947 GLsizei width, | 1442 GLsizei width, |
948 GLsizei height) { | 1443 GLsizei height) { |
| 1444 glRenderbufferStorageEXT(target, internalformat, width, height); |
949 return error::kNoError; | 1445 return error::kNoError; |
950 } | 1446 } |
951 | 1447 |
952 error::Error GLES2DecoderPassthroughImpl::DoResumeTransformFeedback() { | 1448 error::Error GLES2DecoderPassthroughImpl::DoResumeTransformFeedback() { |
| 1449 glResumeTransformFeedback(); |
953 return error::kNoError; | 1450 return error::kNoError; |
954 } | 1451 } |
955 | 1452 |
956 error::Error GLES2DecoderPassthroughImpl::DoSampleCoverage(GLclampf value, | 1453 error::Error GLES2DecoderPassthroughImpl::DoSampleCoverage(GLclampf value, |
957 GLboolean invert) { | 1454 GLboolean invert) { |
| 1455 glSampleCoverage(value, invert); |
958 return error::kNoError; | 1456 return error::kNoError; |
959 } | 1457 } |
960 | 1458 |
961 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterf(GLuint sampler, | 1459 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterf(GLuint sampler, |
962 GLenum pname, | 1460 GLenum pname, |
963 GLfloat param) { | 1461 GLfloat param) { |
| 1462 glSamplerParameterf(GetSamplerServiceID(sampler, resources_), pname, param); |
964 return error::kNoError; | 1463 return error::kNoError; |
965 } | 1464 } |
966 | 1465 |
967 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterfv( | 1466 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterfv( |
968 GLuint sampler, | 1467 GLuint sampler, |
969 GLenum pname, | 1468 GLenum pname, |
970 const volatile GLfloat* params) { | 1469 const volatile GLfloat* params) { |
| 1470 // TODO(geofflang): new-style setter, needs to make only one copy |
| 1471 glSamplerParameterfv(GetSamplerServiceID(sampler, resources_), pname, |
| 1472 const_cast<const GLfloat*>(params)); |
971 return error::kNoError; | 1473 return error::kNoError; |
972 } | 1474 } |
973 | 1475 |
974 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteri(GLuint sampler, | 1476 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteri(GLuint sampler, |
975 GLenum pname, | 1477 GLenum pname, |
976 GLint param) { | 1478 GLint param) { |
| 1479 glSamplerParameteri(GetSamplerServiceID(sampler, resources_), pname, param); |
977 return error::kNoError; | 1480 return error::kNoError; |
978 } | 1481 } |
979 | 1482 |
980 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteriv( | 1483 error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteriv( |
981 GLuint sampler, | 1484 GLuint sampler, |
982 GLenum pname, | 1485 GLenum pname, |
983 const volatile GLint* params) { | 1486 const volatile GLint* params) { |
| 1487 // TODO(geofflang): new-style setter, needs to make only one copy |
| 1488 glSamplerParameteriv(GetSamplerServiceID(sampler, resources_), pname, |
| 1489 const_cast<const GLint*>(params)); |
984 return error::kNoError; | 1490 return error::kNoError; |
985 } | 1491 } |
986 | 1492 |
987 error::Error GLES2DecoderPassthroughImpl::DoScissor(GLint x, | 1493 error::Error GLES2DecoderPassthroughImpl::DoScissor(GLint x, |
988 GLint y, | 1494 GLint y, |
989 GLsizei width, | 1495 GLsizei width, |
990 GLsizei height) { | 1496 GLsizei height) { |
991 glScissor(x, y, width, height); | 1497 glScissor(x, y, width, height); |
992 return error::kNoError; | 1498 return error::kNoError; |
993 } | 1499 } |
994 | 1500 |
995 error::Error GLES2DecoderPassthroughImpl::DoShaderBinary(GLsizei n, | 1501 error::Error GLES2DecoderPassthroughImpl::DoShaderBinary(GLsizei n, |
996 const GLuint* shaders, | 1502 const GLuint* shaders, |
997 GLenum binaryformat, | 1503 GLenum binaryformat, |
998 const void* binary, | 1504 const void* binary, |
999 GLsizei length) { | 1505 GLsizei length) { |
| 1506 NOTIMPLEMENTED(); |
1000 return error::kNoError; | 1507 return error::kNoError; |
1001 } | 1508 } |
1002 | 1509 |
1003 error::Error GLES2DecoderPassthroughImpl::DoShaderSource(GLuint shader, | 1510 error::Error GLES2DecoderPassthroughImpl::DoShaderSource(GLuint shader, |
1004 GLsizei count, | 1511 GLsizei count, |
1005 const char** string, | 1512 const char** string, |
1006 const GLint* length) { | 1513 const GLint* length) { |
| 1514 glShaderSource(GetShaderServiceID(shader, resources_), count, string, length); |
1007 return error::kNoError; | 1515 return error::kNoError; |
1008 } | 1516 } |
1009 | 1517 |
1010 error::Error GLES2DecoderPassthroughImpl::DoStencilFunc(GLenum func, | 1518 error::Error GLES2DecoderPassthroughImpl::DoStencilFunc(GLenum func, |
1011 GLint ref, | 1519 GLint ref, |
1012 GLuint mask) { | 1520 GLuint mask) { |
| 1521 glStencilFunc(func, ref, mask); |
1013 return error::kNoError; | 1522 return error::kNoError; |
1014 } | 1523 } |
1015 | 1524 |
1016 error::Error GLES2DecoderPassthroughImpl::DoStencilFuncSeparate(GLenum face, | 1525 error::Error GLES2DecoderPassthroughImpl::DoStencilFuncSeparate(GLenum face, |
1017 GLenum func, | 1526 GLenum func, |
1018 GLint ref, | 1527 GLint ref, |
1019 GLuint mask) { | 1528 GLuint mask) { |
| 1529 glStencilFuncSeparate(face, func, ref, mask); |
1020 return error::kNoError; | 1530 return error::kNoError; |
1021 } | 1531 } |
1022 | 1532 |
1023 error::Error GLES2DecoderPassthroughImpl::DoStencilMask(GLuint mask) { | 1533 error::Error GLES2DecoderPassthroughImpl::DoStencilMask(GLuint mask) { |
| 1534 glStencilMask(mask); |
1024 return error::kNoError; | 1535 return error::kNoError; |
1025 } | 1536 } |
1026 | 1537 |
1027 error::Error GLES2DecoderPassthroughImpl::DoStencilMaskSeparate(GLenum face, | 1538 error::Error GLES2DecoderPassthroughImpl::DoStencilMaskSeparate(GLenum face, |
1028 GLuint mask) { | 1539 GLuint mask) { |
| 1540 glStencilMaskSeparate(face, mask); |
1029 return error::kNoError; | 1541 return error::kNoError; |
1030 } | 1542 } |
1031 | 1543 |
1032 error::Error GLES2DecoderPassthroughImpl::DoStencilOp(GLenum fail, | 1544 error::Error GLES2DecoderPassthroughImpl::DoStencilOp(GLenum fail, |
1033 GLenum zfail, | 1545 GLenum zfail, |
1034 GLenum zpass) { | 1546 GLenum zpass) { |
| 1547 glStencilOp(fail, zfail, zpass); |
1035 return error::kNoError; | 1548 return error::kNoError; |
1036 } | 1549 } |
1037 | 1550 |
1038 error::Error GLES2DecoderPassthroughImpl::DoStencilOpSeparate(GLenum face, | 1551 error::Error GLES2DecoderPassthroughImpl::DoStencilOpSeparate(GLenum face, |
1039 GLenum fail, | 1552 GLenum fail, |
1040 GLenum zfail, | 1553 GLenum zfail, |
1041 GLenum zpass) { | 1554 GLenum zpass) { |
| 1555 glStencilOpSeparate(face, fail, zfail, zpass); |
1042 return error::kNoError; | 1556 return error::kNoError; |
1043 } | 1557 } |
1044 | 1558 |
1045 error::Error GLES2DecoderPassthroughImpl::DoTexImage2D(GLenum target, | 1559 error::Error GLES2DecoderPassthroughImpl::DoTexImage2D(GLenum target, |
1046 GLint level, | 1560 GLint level, |
1047 GLint internalformat, | 1561 GLint internalformat, |
1048 GLsizei width, | 1562 GLsizei width, |
1049 GLsizei height, | 1563 GLsizei height, |
1050 GLint border, | 1564 GLint border, |
1051 GLenum format, | 1565 GLenum format, |
1052 GLenum type, | 1566 GLenum type, |
1053 GLsizei imagesize, | 1567 GLsizei imagesize, |
1054 const void* pixels) { | 1568 const void* pixels) { |
| 1569 // TODO(geofflang): validate using imagesize |
| 1570 glTexImage2D(target, level, internalformat, width, height, border, format, |
| 1571 type, pixels); |
1055 return error::kNoError; | 1572 return error::kNoError; |
1056 } | 1573 } |
1057 | 1574 |
1058 error::Error GLES2DecoderPassthroughImpl::DoTexImage3D(GLenum target, | 1575 error::Error GLES2DecoderPassthroughImpl::DoTexImage3D(GLenum target, |
1059 GLint level, | 1576 GLint level, |
1060 GLint internalformat, | 1577 GLint internalformat, |
1061 GLsizei width, | 1578 GLsizei width, |
1062 GLsizei height, | 1579 GLsizei height, |
1063 GLsizei depth, | 1580 GLsizei depth, |
1064 GLint border, | 1581 GLint border, |
1065 GLenum format, | 1582 GLenum format, |
1066 GLenum type, | 1583 GLenum type, |
1067 GLsizei imagesize, | 1584 GLsizei imagesize, |
1068 const void* pixels) { | 1585 const void* pixels) { |
| 1586 // TODO(geofflang): validate using imagesize |
| 1587 glTexImage3D(target, level, internalformat, width, height, depth, border, |
| 1588 format, type, pixels); |
1069 return error::kNoError; | 1589 return error::kNoError; |
1070 } | 1590 } |
1071 | 1591 |
1072 error::Error GLES2DecoderPassthroughImpl::DoTexParameterf(GLenum target, | 1592 error::Error GLES2DecoderPassthroughImpl::DoTexParameterf(GLenum target, |
1073 GLenum pname, | 1593 GLenum pname, |
1074 GLfloat param) { | 1594 GLfloat param) { |
| 1595 glTexParameterf(target, pname, param); |
1075 return error::kNoError; | 1596 return error::kNoError; |
1076 } | 1597 } |
1077 | 1598 |
1078 error::Error GLES2DecoderPassthroughImpl::DoTexParameterfv( | 1599 error::Error GLES2DecoderPassthroughImpl::DoTexParameterfv( |
1079 GLenum target, | 1600 GLenum target, |
1080 GLenum pname, | 1601 GLenum pname, |
1081 const volatile GLfloat* params) { | 1602 const volatile GLfloat* params) { |
| 1603 // TODO(geofflang): new-style setter, needs to make only one copy |
| 1604 glTexParameterfv(target, pname, const_cast<const GLfloat*>(params)); |
1082 return error::kNoError; | 1605 return error::kNoError; |
1083 } | 1606 } |
1084 | 1607 |
1085 error::Error GLES2DecoderPassthroughImpl::DoTexParameteri(GLenum target, | 1608 error::Error GLES2DecoderPassthroughImpl::DoTexParameteri(GLenum target, |
1086 GLenum pname, | 1609 GLenum pname, |
1087 GLint param) { | 1610 GLint param) { |
1088 glTexParameteri(target, pname, param); | 1611 glTexParameteri(target, pname, param); |
1089 return error::kNoError; | 1612 return error::kNoError; |
1090 } | 1613 } |
1091 | 1614 |
1092 error::Error GLES2DecoderPassthroughImpl::DoTexParameteriv( | 1615 error::Error GLES2DecoderPassthroughImpl::DoTexParameteriv( |
1093 GLenum target, | 1616 GLenum target, |
1094 GLenum pname, | 1617 GLenum pname, |
1095 const volatile GLint* params) { | 1618 const volatile GLint* params) { |
| 1619 // TODO(geofflang): new-style setter, needs to make only one copy |
| 1620 glTexParameteriv(target, pname, const_cast<const GLint*>(params)); |
1096 return error::kNoError; | 1621 return error::kNoError; |
1097 } | 1622 } |
1098 | 1623 |
1099 error::Error GLES2DecoderPassthroughImpl::DoTexStorage3D(GLenum target, | 1624 error::Error GLES2DecoderPassthroughImpl::DoTexStorage3D(GLenum target, |
1100 GLsizei levels, | 1625 GLsizei levels, |
1101 GLenum internalFormat, | 1626 GLenum internalFormat, |
1102 GLsizei width, | 1627 GLsizei width, |
1103 GLsizei height, | 1628 GLsizei height, |
1104 GLsizei depth) { | 1629 GLsizei depth) { |
| 1630 glTexStorage3D(target, levels, internalFormat, width, height, depth); |
1105 return error::kNoError; | 1631 return error::kNoError; |
1106 } | 1632 } |
1107 | 1633 |
1108 error::Error GLES2DecoderPassthroughImpl::DoTexSubImage2D(GLenum target, | 1634 error::Error GLES2DecoderPassthroughImpl::DoTexSubImage2D(GLenum target, |
1109 GLint level, | 1635 GLint level, |
1110 GLint xoffset, | 1636 GLint xoffset, |
1111 GLint yoffset, | 1637 GLint yoffset, |
1112 GLsizei width, | 1638 GLsizei width, |
1113 GLsizei height, | 1639 GLsizei height, |
1114 GLenum format, | 1640 GLenum format, |
1115 GLenum type, | 1641 GLenum type, |
1116 GLsizei imagesize, | 1642 GLsizei imagesize, |
1117 const void* pixels) { | 1643 const void* pixels) { |
| 1644 // TODO(geofflang): validate using imagesize |
| 1645 glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, |
| 1646 pixels); |
1118 return error::kNoError; | 1647 return error::kNoError; |
1119 } | 1648 } |
1120 | 1649 |
1121 error::Error GLES2DecoderPassthroughImpl::DoTexSubImage3D(GLenum target, | 1650 error::Error GLES2DecoderPassthroughImpl::DoTexSubImage3D(GLenum target, |
1122 GLint level, | 1651 GLint level, |
1123 GLint xoffset, | 1652 GLint xoffset, |
1124 GLint yoffset, | 1653 GLint yoffset, |
1125 GLint zoffset, | 1654 GLint zoffset, |
1126 GLsizei width, | 1655 GLsizei width, |
1127 GLsizei height, | 1656 GLsizei height, |
1128 GLsizei depth, | 1657 GLsizei depth, |
1129 GLenum format, | 1658 GLenum format, |
1130 GLenum type, | 1659 GLenum type, |
1131 GLsizei imagesize, | 1660 GLsizei imagesize, |
1132 const void* pixels) { | 1661 const void* pixels) { |
| 1662 // TODO(geofflang): validate using imagesize |
| 1663 glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, |
| 1664 depth, format, type, pixels); |
1133 return error::kNoError; | 1665 return error::kNoError; |
1134 } | 1666 } |
1135 | 1667 |
1136 error::Error GLES2DecoderPassthroughImpl::DoTransformFeedbackVaryings( | 1668 error::Error GLES2DecoderPassthroughImpl::DoTransformFeedbackVaryings( |
1137 GLuint program, | 1669 GLuint program, |
1138 GLsizei count, | 1670 GLsizei count, |
1139 const char** varyings, | 1671 const char** varyings, |
1140 GLenum buffermode) { | 1672 GLenum buffermode) { |
| 1673 glTransformFeedbackVaryings(GetProgramServiceID(program, resources_), count, |
| 1674 varyings, buffermode); |
1141 return error::kNoError; | 1675 return error::kNoError; |
1142 } | 1676 } |
1143 | 1677 |
1144 error::Error GLES2DecoderPassthroughImpl::DoUniform1f(GLint location, | 1678 error::Error GLES2DecoderPassthroughImpl::DoUniform1f(GLint location, |
1145 GLfloat x) { | 1679 GLfloat x) { |
| 1680 glUniform1f(location, x); |
1146 return error::kNoError; | 1681 return error::kNoError; |
1147 } | 1682 } |
1148 | 1683 |
1149 error::Error GLES2DecoderPassthroughImpl::DoUniform1fv( | 1684 error::Error GLES2DecoderPassthroughImpl::DoUniform1fv( |
1150 GLint location, | 1685 GLint location, |
1151 GLsizei count, | 1686 GLsizei count, |
1152 const volatile GLfloat* v) { | 1687 const volatile GLfloat* v) { |
| 1688 glUniform1fv(location, count, const_cast<const GLfloat*>(v)); |
1153 return error::kNoError; | 1689 return error::kNoError; |
1154 } | 1690 } |
1155 | 1691 |
1156 error::Error GLES2DecoderPassthroughImpl::DoUniform1i(GLint location, GLint x) { | 1692 error::Error GLES2DecoderPassthroughImpl::DoUniform1i(GLint location, GLint x) { |
| 1693 glUniform1i(location, x); |
1157 return error::kNoError; | 1694 return error::kNoError; |
1158 } | 1695 } |
1159 | 1696 |
1160 error::Error GLES2DecoderPassthroughImpl::DoUniform1iv( | 1697 error::Error GLES2DecoderPassthroughImpl::DoUniform1iv( |
1161 GLint location, | 1698 GLint location, |
1162 GLsizei count, | 1699 GLsizei count, |
1163 const volatile GLint* v) { | 1700 const volatile GLint* v) { |
| 1701 glUniform1iv(location, count, const_cast<const GLint*>(v)); |
1164 return error::kNoError; | 1702 return error::kNoError; |
1165 } | 1703 } |
1166 | 1704 |
1167 error::Error GLES2DecoderPassthroughImpl::DoUniform1ui(GLint location, | 1705 error::Error GLES2DecoderPassthroughImpl::DoUniform1ui(GLint location, |
1168 GLuint x) { | 1706 GLuint x) { |
| 1707 glUniform1ui(location, x); |
1169 return error::kNoError; | 1708 return error::kNoError; |
1170 } | 1709 } |
1171 | 1710 |
1172 error::Error GLES2DecoderPassthroughImpl::DoUniform1uiv( | 1711 error::Error GLES2DecoderPassthroughImpl::DoUniform1uiv( |
1173 GLint location, | 1712 GLint location, |
1174 GLsizei count, | 1713 GLsizei count, |
1175 const volatile GLuint* v) { | 1714 const volatile GLuint* v) { |
| 1715 glUniform1uiv(location, count, const_cast<const GLuint*>(v)); |
1176 return error::kNoError; | 1716 return error::kNoError; |
1177 } | 1717 } |
1178 | 1718 |
1179 error::Error GLES2DecoderPassthroughImpl::DoUniform2f(GLint location, | 1719 error::Error GLES2DecoderPassthroughImpl::DoUniform2f(GLint location, |
1180 GLfloat x, | 1720 GLfloat x, |
1181 GLfloat y) { | 1721 GLfloat y) { |
| 1722 glUniform2f(location, x, y); |
1182 return error::kNoError; | 1723 return error::kNoError; |
1183 } | 1724 } |
1184 | 1725 |
1185 error::Error GLES2DecoderPassthroughImpl::DoUniform2fv( | 1726 error::Error GLES2DecoderPassthroughImpl::DoUniform2fv( |
1186 GLint location, | 1727 GLint location, |
1187 GLsizei count, | 1728 GLsizei count, |
1188 const volatile GLfloat* v) { | 1729 const volatile GLfloat* v) { |
| 1730 glUniform2fv(location, count, const_cast<const GLfloat*>(v)); |
1189 return error::kNoError; | 1731 return error::kNoError; |
1190 } | 1732 } |
1191 | 1733 |
1192 error::Error GLES2DecoderPassthroughImpl::DoUniform2i(GLint location, | 1734 error::Error GLES2DecoderPassthroughImpl::DoUniform2i(GLint location, |
1193 GLint x, | 1735 GLint x, |
1194 GLint y) { | 1736 GLint y) { |
| 1737 glUniform2i(location, x, y); |
1195 return error::kNoError; | 1738 return error::kNoError; |
1196 } | 1739 } |
1197 | 1740 |
1198 error::Error GLES2DecoderPassthroughImpl::DoUniform2iv( | 1741 error::Error GLES2DecoderPassthroughImpl::DoUniform2iv( |
1199 GLint location, | 1742 GLint location, |
1200 GLsizei count, | 1743 GLsizei count, |
1201 const volatile GLint* v) { | 1744 const volatile GLint* v) { |
| 1745 glUniform2iv(location, count, const_cast<const GLint*>(v)); |
1202 return error::kNoError; | 1746 return error::kNoError; |
1203 } | 1747 } |
1204 | 1748 |
1205 error::Error GLES2DecoderPassthroughImpl::DoUniform2ui(GLint location, | 1749 error::Error GLES2DecoderPassthroughImpl::DoUniform2ui(GLint location, |
1206 GLuint x, | 1750 GLuint x, |
1207 GLuint y) { | 1751 GLuint y) { |
| 1752 glUniform2ui(location, x, y); |
1208 return error::kNoError; | 1753 return error::kNoError; |
1209 } | 1754 } |
1210 | 1755 |
1211 error::Error GLES2DecoderPassthroughImpl::DoUniform2uiv( | 1756 error::Error GLES2DecoderPassthroughImpl::DoUniform2uiv( |
1212 GLint location, | 1757 GLint location, |
1213 GLsizei count, | 1758 GLsizei count, |
1214 const volatile GLuint* v) { | 1759 const volatile GLuint* v) { |
| 1760 glUniform2uiv(location, count, const_cast<const GLuint*>(v)); |
1215 return error::kNoError; | 1761 return error::kNoError; |
1216 } | 1762 } |
1217 | 1763 |
1218 error::Error GLES2DecoderPassthroughImpl::DoUniform3f(GLint location, | 1764 error::Error GLES2DecoderPassthroughImpl::DoUniform3f(GLint location, |
1219 GLfloat x, | 1765 GLfloat x, |
1220 GLfloat y, | 1766 GLfloat y, |
1221 GLfloat z) { | 1767 GLfloat z) { |
| 1768 glUniform3f(location, x, y, z); |
1222 return error::kNoError; | 1769 return error::kNoError; |
1223 } | 1770 } |
1224 | 1771 |
1225 error::Error GLES2DecoderPassthroughImpl::DoUniform3fv( | 1772 error::Error GLES2DecoderPassthroughImpl::DoUniform3fv( |
1226 GLint location, | 1773 GLint location, |
1227 GLsizei count, | 1774 GLsizei count, |
1228 const volatile GLfloat* v) { | 1775 const volatile GLfloat* v) { |
| 1776 glUniform3fv(location, count, const_cast<const GLfloat*>(v)); |
1229 return error::kNoError; | 1777 return error::kNoError; |
1230 } | 1778 } |
1231 | 1779 |
1232 error::Error GLES2DecoderPassthroughImpl::DoUniform3i(GLint location, | 1780 error::Error GLES2DecoderPassthroughImpl::DoUniform3i(GLint location, |
1233 GLint x, | 1781 GLint x, |
1234 GLint y, | 1782 GLint y, |
1235 GLint z) { | 1783 GLint z) { |
| 1784 glUniform3i(location, x, y, z); |
1236 return error::kNoError; | 1785 return error::kNoError; |
1237 } | 1786 } |
1238 | 1787 |
1239 error::Error GLES2DecoderPassthroughImpl::DoUniform3iv( | 1788 error::Error GLES2DecoderPassthroughImpl::DoUniform3iv( |
1240 GLint location, | 1789 GLint location, |
1241 GLsizei count, | 1790 GLsizei count, |
1242 const volatile GLint* v) { | 1791 const volatile GLint* v) { |
| 1792 glUniform3iv(location, count, const_cast<const GLint*>(v)); |
1243 return error::kNoError; | 1793 return error::kNoError; |
1244 } | 1794 } |
1245 | 1795 |
1246 error::Error GLES2DecoderPassthroughImpl::DoUniform3ui(GLint location, | 1796 error::Error GLES2DecoderPassthroughImpl::DoUniform3ui(GLint location, |
1247 GLuint x, | 1797 GLuint x, |
1248 GLuint y, | 1798 GLuint y, |
1249 GLuint z) { | 1799 GLuint z) { |
| 1800 glUniform3ui(location, x, y, z); |
1250 return error::kNoError; | 1801 return error::kNoError; |
1251 } | 1802 } |
1252 | 1803 |
1253 error::Error GLES2DecoderPassthroughImpl::DoUniform3uiv( | 1804 error::Error GLES2DecoderPassthroughImpl::DoUniform3uiv( |
1254 GLint location, | 1805 GLint location, |
1255 GLsizei count, | 1806 GLsizei count, |
1256 const volatile GLuint* v) { | 1807 const volatile GLuint* v) { |
| 1808 glUniform3uiv(location, count, const_cast<const GLuint*>(v)); |
1257 return error::kNoError; | 1809 return error::kNoError; |
1258 } | 1810 } |
1259 | 1811 |
1260 error::Error GLES2DecoderPassthroughImpl::DoUniform4f(GLint location, | 1812 error::Error GLES2DecoderPassthroughImpl::DoUniform4f(GLint location, |
1261 GLfloat x, | 1813 GLfloat x, |
1262 GLfloat y, | 1814 GLfloat y, |
1263 GLfloat z, | 1815 GLfloat z, |
1264 GLfloat w) { | 1816 GLfloat w) { |
| 1817 glUniform4f(location, x, y, z, w); |
1265 return error::kNoError; | 1818 return error::kNoError; |
1266 } | 1819 } |
1267 | 1820 |
1268 error::Error GLES2DecoderPassthroughImpl::DoUniform4fv( | 1821 error::Error GLES2DecoderPassthroughImpl::DoUniform4fv( |
1269 GLint location, | 1822 GLint location, |
1270 GLsizei count, | 1823 GLsizei count, |
1271 const volatile GLfloat* v) { | 1824 const volatile GLfloat* v) { |
| 1825 glUniform4fv(location, count, const_cast<const GLfloat*>(v)); |
1272 return error::kNoError; | 1826 return error::kNoError; |
1273 } | 1827 } |
1274 | 1828 |
1275 error::Error GLES2DecoderPassthroughImpl::DoUniform4i(GLint location, | 1829 error::Error GLES2DecoderPassthroughImpl::DoUniform4i(GLint location, |
1276 GLint x, | 1830 GLint x, |
1277 GLint y, | 1831 GLint y, |
1278 GLint z, | 1832 GLint z, |
1279 GLint w) { | 1833 GLint w) { |
| 1834 glUniform4i(location, x, y, z, w); |
1280 return error::kNoError; | 1835 return error::kNoError; |
1281 } | 1836 } |
1282 | 1837 |
1283 error::Error GLES2DecoderPassthroughImpl::DoUniform4iv( | 1838 error::Error GLES2DecoderPassthroughImpl::DoUniform4iv( |
1284 GLint location, | 1839 GLint location, |
1285 GLsizei count, | 1840 GLsizei count, |
1286 const volatile GLint* v) { | 1841 const volatile GLint* v) { |
| 1842 glUniform4iv(location, count, const_cast<const GLint*>(v)); |
1287 return error::kNoError; | 1843 return error::kNoError; |
1288 } | 1844 } |
1289 | 1845 |
1290 error::Error GLES2DecoderPassthroughImpl::DoUniform4ui(GLint location, | 1846 error::Error GLES2DecoderPassthroughImpl::DoUniform4ui(GLint location, |
1291 GLuint x, | 1847 GLuint x, |
1292 GLuint y, | 1848 GLuint y, |
1293 GLuint z, | 1849 GLuint z, |
1294 GLuint w) { | 1850 GLuint w) { |
| 1851 glUniform4ui(location, x, y, z, w); |
1295 return error::kNoError; | 1852 return error::kNoError; |
1296 } | 1853 } |
1297 | 1854 |
1298 error::Error GLES2DecoderPassthroughImpl::DoUniform4uiv( | 1855 error::Error GLES2DecoderPassthroughImpl::DoUniform4uiv( |
1299 GLint location, | 1856 GLint location, |
1300 GLsizei count, | 1857 GLsizei count, |
1301 const volatile GLuint* v) { | 1858 const volatile GLuint* v) { |
| 1859 glUniform4uiv(location, count, const_cast<const GLuint*>(v)); |
1302 return error::kNoError; | 1860 return error::kNoError; |
1303 } | 1861 } |
1304 | 1862 |
1305 error::Error GLES2DecoderPassthroughImpl::DoUniformBlockBinding( | 1863 error::Error GLES2DecoderPassthroughImpl::DoUniformBlockBinding( |
1306 GLuint program, | 1864 GLuint program, |
1307 GLuint index, | 1865 GLuint index, |
1308 GLuint binding) { | 1866 GLuint binding) { |
| 1867 glUniformBlockBinding(GetProgramServiceID(program, resources_), index, |
| 1868 binding); |
1309 return error::kNoError; | 1869 return error::kNoError; |
1310 } | 1870 } |
1311 | 1871 |
1312 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2fv( | 1872 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2fv( |
1313 GLint location, | 1873 GLint location, |
1314 GLsizei count, | 1874 GLsizei count, |
1315 GLboolean transpose, | 1875 GLboolean transpose, |
1316 const volatile GLfloat* value) { | 1876 const volatile GLfloat* value) { |
| 1877 glUniformMatrix2fv(location, count, transpose, |
| 1878 const_cast<const GLfloat*>(value)); |
1317 return error::kNoError; | 1879 return error::kNoError; |
1318 } | 1880 } |
1319 | 1881 |
1320 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x3fv( | 1882 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x3fv( |
1321 GLint location, | 1883 GLint location, |
1322 GLsizei count, | 1884 GLsizei count, |
1323 GLboolean transpose, | 1885 GLboolean transpose, |
1324 const volatile GLfloat* value) { | 1886 const volatile GLfloat* value) { |
| 1887 glUniformMatrix2x3fv(location, count, transpose, |
| 1888 const_cast<const GLfloat*>(value)); |
1325 return error::kNoError; | 1889 return error::kNoError; |
1326 } | 1890 } |
1327 | 1891 |
1328 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x4fv( | 1892 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x4fv( |
1329 GLint location, | 1893 GLint location, |
1330 GLsizei count, | 1894 GLsizei count, |
1331 GLboolean transpose, | 1895 GLboolean transpose, |
1332 const volatile GLfloat* value) { | 1896 const volatile GLfloat* value) { |
| 1897 glUniformMatrix2x4fv(location, count, transpose, |
| 1898 const_cast<const GLfloat*>(value)); |
1333 return error::kNoError; | 1899 return error::kNoError; |
1334 } | 1900 } |
1335 | 1901 |
1336 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3fv( | 1902 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3fv( |
1337 GLint location, | 1903 GLint location, |
1338 GLsizei count, | 1904 GLsizei count, |
1339 GLboolean transpose, | 1905 GLboolean transpose, |
1340 const volatile GLfloat* value) { | 1906 const volatile GLfloat* value) { |
| 1907 glUniformMatrix3fv(location, count, transpose, |
| 1908 const_cast<const GLfloat*>(value)); |
1341 return error::kNoError; | 1909 return error::kNoError; |
1342 } | 1910 } |
1343 | 1911 |
1344 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x2fv( | 1912 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x2fv( |
1345 GLint location, | 1913 GLint location, |
1346 GLsizei count, | 1914 GLsizei count, |
1347 GLboolean transpose, | 1915 GLboolean transpose, |
1348 const volatile GLfloat* value) { | 1916 const volatile GLfloat* value) { |
| 1917 glUniformMatrix3x2fv(location, count, transpose, |
| 1918 const_cast<const GLfloat*>(value)); |
1349 return error::kNoError; | 1919 return error::kNoError; |
1350 } | 1920 } |
1351 | 1921 |
1352 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x4fv( | 1922 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x4fv( |
1353 GLint location, | 1923 GLint location, |
1354 GLsizei count, | 1924 GLsizei count, |
1355 GLboolean transpose, | 1925 GLboolean transpose, |
1356 const volatile GLfloat* value) { | 1926 const volatile GLfloat* value) { |
| 1927 glUniformMatrix3x4fv(location, count, transpose, |
| 1928 const_cast<const GLfloat*>(value)); |
1357 return error::kNoError; | 1929 return error::kNoError; |
1358 } | 1930 } |
1359 | 1931 |
1360 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4fv( | 1932 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4fv( |
1361 GLint location, | 1933 GLint location, |
1362 GLsizei count, | 1934 GLsizei count, |
1363 GLboolean transpose, | 1935 GLboolean transpose, |
1364 const volatile GLfloat* value) { | 1936 const volatile GLfloat* value) { |
| 1937 glUniformMatrix4fv(location, count, transpose, |
| 1938 const_cast<const GLfloat*>(value)); |
1365 return error::kNoError; | 1939 return error::kNoError; |
1366 } | 1940 } |
1367 | 1941 |
1368 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x2fv( | 1942 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x2fv( |
1369 GLint location, | 1943 GLint location, |
1370 GLsizei count, | 1944 GLsizei count, |
1371 GLboolean transpose, | 1945 GLboolean transpose, |
1372 const volatile GLfloat* value) { | 1946 const volatile GLfloat* value) { |
| 1947 glUniformMatrix4x2fv(location, count, transpose, |
| 1948 const_cast<const GLfloat*>(value)); |
1373 return error::kNoError; | 1949 return error::kNoError; |
1374 } | 1950 } |
1375 | 1951 |
1376 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x3fv( | 1952 error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x3fv( |
1377 GLint location, | 1953 GLint location, |
1378 GLsizei count, | 1954 GLsizei count, |
1379 GLboolean transpose, | 1955 GLboolean transpose, |
1380 const volatile GLfloat* value) { | 1956 const volatile GLfloat* value) { |
| 1957 glUniformMatrix4x3fv(location, count, transpose, |
| 1958 const_cast<const GLfloat*>(value)); |
1381 return error::kNoError; | 1959 return error::kNoError; |
1382 } | 1960 } |
1383 | 1961 |
1384 error::Error GLES2DecoderPassthroughImpl::DoUseProgram(GLuint program) { | 1962 error::Error GLES2DecoderPassthroughImpl::DoUseProgram(GLuint program) { |
| 1963 glUseProgram(GetProgramServiceID(program, resources_)); |
1385 return error::kNoError; | 1964 return error::kNoError; |
1386 } | 1965 } |
1387 | 1966 |
1388 error::Error GLES2DecoderPassthroughImpl::DoValidateProgram(GLuint program) { | 1967 error::Error GLES2DecoderPassthroughImpl::DoValidateProgram(GLuint program) { |
| 1968 glValidateProgram(GetProgramServiceID(program, resources_)); |
1389 return error::kNoError; | 1969 return error::kNoError; |
1390 } | 1970 } |
1391 | 1971 |
1392 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1f(GLuint indx, | 1972 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1f(GLuint indx, |
1393 GLfloat x) { | 1973 GLfloat x) { |
| 1974 glVertexAttrib1f(indx, x); |
1394 return error::kNoError; | 1975 return error::kNoError; |
1395 } | 1976 } |
1396 | 1977 |
1397 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1fv( | 1978 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1fv( |
1398 GLuint indx, | 1979 GLuint indx, |
1399 const volatile GLfloat* values) { | 1980 const volatile GLfloat* values) { |
| 1981 glVertexAttrib1fv(indx, const_cast<const GLfloat*>(values)); |
1400 return error::kNoError; | 1982 return error::kNoError; |
1401 } | 1983 } |
1402 | 1984 |
1403 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2f(GLuint indx, | 1985 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2f(GLuint indx, |
1404 GLfloat x, | 1986 GLfloat x, |
1405 GLfloat y) { | 1987 GLfloat y) { |
| 1988 glVertexAttrib2f(indx, x, y); |
1406 return error::kNoError; | 1989 return error::kNoError; |
1407 } | 1990 } |
1408 | 1991 |
1409 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2fv( | 1992 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2fv( |
1410 GLuint indx, | 1993 GLuint indx, |
1411 const volatile GLfloat* values) { | 1994 const volatile GLfloat* values) { |
| 1995 glVertexAttrib2fv(indx, const_cast<const GLfloat*>(values)); |
1412 return error::kNoError; | 1996 return error::kNoError; |
1413 } | 1997 } |
1414 | 1998 |
1415 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3f(GLuint indx, | 1999 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3f(GLuint indx, |
1416 GLfloat x, | 2000 GLfloat x, |
1417 GLfloat y, | 2001 GLfloat y, |
1418 GLfloat z) { | 2002 GLfloat z) { |
| 2003 glVertexAttrib3f(indx, x, y, z); |
1419 return error::kNoError; | 2004 return error::kNoError; |
1420 } | 2005 } |
1421 | 2006 |
1422 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3fv( | 2007 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3fv( |
1423 GLuint indx, | 2008 GLuint indx, |
1424 const volatile GLfloat* values) { | 2009 const volatile GLfloat* values) { |
| 2010 glVertexAttrib3fv(indx, const_cast<const GLfloat*>(values)); |
1425 return error::kNoError; | 2011 return error::kNoError; |
1426 } | 2012 } |
1427 | 2013 |
1428 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4f(GLuint indx, | 2014 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4f(GLuint indx, |
1429 GLfloat x, | 2015 GLfloat x, |
1430 GLfloat y, | 2016 GLfloat y, |
1431 GLfloat z, | 2017 GLfloat z, |
1432 GLfloat w) { | 2018 GLfloat w) { |
| 2019 glVertexAttrib4f(indx, x, y, z, w); |
1433 return error::kNoError; | 2020 return error::kNoError; |
1434 } | 2021 } |
1435 | 2022 |
1436 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4fv( | 2023 error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4fv( |
1437 GLuint indx, | 2024 GLuint indx, |
1438 const volatile GLfloat* values) { | 2025 const volatile GLfloat* values) { |
| 2026 glVertexAttrib4fv(indx, const_cast<const GLfloat*>(values)); |
1439 return error::kNoError; | 2027 return error::kNoError; |
1440 } | 2028 } |
1441 | 2029 |
1442 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4i(GLuint indx, | 2030 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4i(GLuint indx, |
1443 GLint x, | 2031 GLint x, |
1444 GLint y, | 2032 GLint y, |
1445 GLint z, | 2033 GLint z, |
1446 GLint w) { | 2034 GLint w) { |
| 2035 glVertexAttribI4i(indx, x, y, z, w); |
1447 return error::kNoError; | 2036 return error::kNoError; |
1448 } | 2037 } |
1449 | 2038 |
1450 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4iv( | 2039 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4iv( |
1451 GLuint indx, | 2040 GLuint indx, |
1452 const volatile GLint* values) { | 2041 const volatile GLint* values) { |
| 2042 glVertexAttribI4iv(indx, const_cast<const GLint*>(values)); |
1453 return error::kNoError; | 2043 return error::kNoError; |
1454 } | 2044 } |
1455 | 2045 |
1456 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4ui(GLuint indx, | 2046 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4ui(GLuint indx, |
1457 GLuint x, | 2047 GLuint x, |
1458 GLuint y, | 2048 GLuint y, |
1459 GLuint z, | 2049 GLuint z, |
1460 GLuint w) { | 2050 GLuint w) { |
| 2051 glVertexAttribI4ui(indx, x, y, z, w); |
1461 return error::kNoError; | 2052 return error::kNoError; |
1462 } | 2053 } |
1463 | 2054 |
1464 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4uiv( | 2055 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4uiv( |
1465 GLuint indx, | 2056 GLuint indx, |
1466 const volatile GLuint* values) { | 2057 const volatile GLuint* values) { |
| 2058 glVertexAttribI4uiv(indx, const_cast<const GLuint*>(values)); |
1467 return error::kNoError; | 2059 return error::kNoError; |
1468 } | 2060 } |
1469 | 2061 |
1470 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribIPointer( | 2062 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribIPointer( |
1471 GLuint indx, | 2063 GLuint indx, |
1472 GLint size, | 2064 GLint size, |
1473 GLenum type, | 2065 GLenum type, |
1474 GLsizei stride, | 2066 GLsizei stride, |
1475 const void* ptr) { | 2067 const void* ptr) { |
| 2068 glVertexAttribIPointer(indx, size, type, stride, ptr); |
1476 return error::kNoError; | 2069 return error::kNoError; |
1477 } | 2070 } |
1478 | 2071 |
1479 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribPointer( | 2072 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribPointer( |
1480 GLuint indx, | 2073 GLuint indx, |
1481 GLint size, | 2074 GLint size, |
1482 GLenum type, | 2075 GLenum type, |
1483 GLboolean normalized, | 2076 GLboolean normalized, |
1484 GLsizei stride, | 2077 GLsizei stride, |
1485 const void* ptr) { | 2078 const void* ptr) { |
| 2079 glVertexAttribPointer(indx, size, type, normalized, stride, ptr); |
1486 return error::kNoError; | 2080 return error::kNoError; |
1487 } | 2081 } |
1488 | 2082 |
1489 error::Error GLES2DecoderPassthroughImpl::DoViewport(GLint x, | 2083 error::Error GLES2DecoderPassthroughImpl::DoViewport(GLint x, |
1490 GLint y, | 2084 GLint y, |
1491 GLsizei width, | 2085 GLsizei width, |
1492 GLsizei height) { | 2086 GLsizei height) { |
| 2087 glViewport(x, y, width, height); |
1493 return error::kNoError; | 2088 return error::kNoError; |
1494 } | 2089 } |
1495 | 2090 |
1496 error::Error GLES2DecoderPassthroughImpl::DoWaitSync(GLuint sync, | 2091 error::Error GLES2DecoderPassthroughImpl::DoWaitSync(GLuint sync, |
1497 GLbitfield flags, | 2092 GLbitfield flags, |
1498 GLuint64 timeout) { | 2093 GLuint64 timeout) { |
| 2094 NOTIMPLEMENTED(); |
1499 return error::kNoError; | 2095 return error::kNoError; |
1500 } | 2096 } |
1501 | 2097 |
1502 error::Error GLES2DecoderPassthroughImpl::DoBlitFramebufferCHROMIUM( | 2098 error::Error GLES2DecoderPassthroughImpl::DoBlitFramebufferCHROMIUM( |
1503 GLint srcX0, | 2099 GLint srcX0, |
1504 GLint srcY0, | 2100 GLint srcY0, |
1505 GLint srcX1, | 2101 GLint srcX1, |
1506 GLint srcY1, | 2102 GLint srcY1, |
1507 GLint dstX0, | 2103 GLint dstX0, |
1508 GLint dstY0, | 2104 GLint dstY0, |
1509 GLint dstX1, | 2105 GLint dstX1, |
1510 GLint dstY1, | 2106 GLint dstY1, |
1511 GLbitfield mask, | 2107 GLbitfield mask, |
1512 GLenum filter) { | 2108 GLenum filter) { |
| 2109 glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, |
| 2110 mask, filter); |
1513 return error::kNoError; | 2111 return error::kNoError; |
1514 } | 2112 } |
1515 | 2113 |
1516 error::Error | 2114 error::Error |
1517 GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleCHROMIUM( | 2115 GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleCHROMIUM( |
1518 GLenum target, | 2116 GLenum target, |
1519 GLsizei samples, | 2117 GLsizei samples, |
1520 GLenum internalformat, | 2118 GLenum internalformat, |
1521 GLsizei width, | 2119 GLsizei width, |
1522 GLsizei height) { | 2120 GLsizei height) { |
| 2121 glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, |
| 2122 height); |
1523 return error::kNoError; | 2123 return error::kNoError; |
1524 } | 2124 } |
1525 | 2125 |
1526 error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleEXT( | 2126 error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleEXT( |
1527 GLenum target, | 2127 GLenum target, |
1528 GLsizei samples, | 2128 GLsizei samples, |
1529 GLenum internalformat, | 2129 GLenum internalformat, |
1530 GLsizei width, | 2130 GLsizei width, |
1531 GLsizei height) { | 2131 GLsizei height) { |
| 2132 glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, |
| 2133 height); |
1532 return error::kNoError; | 2134 return error::kNoError; |
1533 } | 2135 } |
1534 | 2136 |
1535 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2DMultisampleEXT( | 2137 error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2DMultisampleEXT( |
1536 GLenum target, | 2138 GLenum target, |
1537 GLenum attachment, | 2139 GLenum attachment, |
1538 GLenum textarget, | 2140 GLenum textarget, |
1539 GLuint texture, | 2141 GLuint texture, |
1540 GLint level, | 2142 GLint level, |
1541 GLsizei samples) { | 2143 GLsizei samples) { |
| 2144 NOTIMPLEMENTED(); |
1542 return error::kNoError; | 2145 return error::kNoError; |
1543 } | 2146 } |
1544 | 2147 |
1545 error::Error GLES2DecoderPassthroughImpl::DoTexStorage2DEXT( | 2148 error::Error GLES2DecoderPassthroughImpl::DoTexStorage2DEXT( |
1546 GLenum target, | 2149 GLenum target, |
1547 GLsizei levels, | 2150 GLsizei levels, |
1548 GLenum internalFormat, | 2151 GLenum internalFormat, |
1549 GLsizei width, | 2152 GLsizei width, |
1550 GLsizei height) { | 2153 GLsizei height) { |
1551 glTexStorage2DEXT(target, levels, internalFormat, width, height); | 2154 glTexStorage2DEXT(target, levels, internalFormat, width, height); |
1552 return error::kNoError; | 2155 return error::kNoError; |
1553 } | 2156 } |
1554 | 2157 |
1555 error::Error GLES2DecoderPassthroughImpl::DoGenQueriesEXT( | 2158 error::Error GLES2DecoderPassthroughImpl::DoGenQueriesEXT( |
1556 GLsizei n, | 2159 GLsizei n, |
1557 volatile GLuint* queries) { | 2160 volatile GLuint* queries) { |
1558 return error::kNoError; | 2161 return GenHelper(n, queries, &query_id_map_, [](GLsizei n, GLuint* queries) { |
| 2162 glGenQueries(n, queries); |
| 2163 }); |
1559 } | 2164 } |
1560 | 2165 |
1561 error::Error GLES2DecoderPassthroughImpl::DoDeleteQueriesEXT( | 2166 error::Error GLES2DecoderPassthroughImpl::DoDeleteQueriesEXT( |
1562 GLsizei n, | 2167 GLsizei n, |
1563 const volatile GLuint* queries) { | 2168 const volatile GLuint* queries) { |
1564 return error::kNoError; | 2169 return DeleteHelper( |
| 2170 n, queries, &query_id_map_, |
| 2171 [](GLsizei n, GLuint* queries) { glDeleteQueries(n, queries); }); |
1565 } | 2172 } |
1566 | 2173 |
1567 error::Error GLES2DecoderPassthroughImpl::DoQueryCounterEXT(GLuint id, | 2174 error::Error GLES2DecoderPassthroughImpl::DoQueryCounterEXT(GLuint id, |
1568 GLenum target) { | 2175 GLenum target) { |
| 2176 glQueryCounter(GetQueryServiceID(id, &query_id_map_), target); |
1569 return error::kNoError; | 2177 return error::kNoError; |
1570 } | 2178 } |
1571 | 2179 |
1572 error::Error GLES2DecoderPassthroughImpl::DoBeginQueryEXT(GLenum target, | 2180 error::Error GLES2DecoderPassthroughImpl::DoBeginQueryEXT(GLenum target, |
1573 GLuint id) { | 2181 GLuint id) { |
| 2182 // TODO(geofflang): Track active queries |
| 2183 glBeginQuery(target, GetQueryServiceID(id, &query_id_map_)); |
1574 return error::kNoError; | 2184 return error::kNoError; |
1575 } | 2185 } |
1576 | 2186 |
1577 error::Error GLES2DecoderPassthroughImpl::DoBeginTransformFeedback( | 2187 error::Error GLES2DecoderPassthroughImpl::DoBeginTransformFeedback( |
1578 GLenum primitivemode) { | 2188 GLenum primitivemode) { |
| 2189 glBeginTransformFeedback(primitivemode); |
1579 return error::kNoError; | 2190 return error::kNoError; |
1580 } | 2191 } |
1581 | 2192 |
1582 error::Error GLES2DecoderPassthroughImpl::DoEndQueryEXT(GLenum target) { | 2193 error::Error GLES2DecoderPassthroughImpl::DoEndQueryEXT(GLenum target) { |
| 2194 // TODO(geofflang): Track active queries |
| 2195 glEndQuery(target); |
1583 return error::kNoError; | 2196 return error::kNoError; |
1584 } | 2197 } |
1585 | 2198 |
1586 error::Error GLES2DecoderPassthroughImpl::DoEndTransformFeedback() { | 2199 error::Error GLES2DecoderPassthroughImpl::DoEndTransformFeedback() { |
| 2200 glEndTransformFeedback(); |
1587 return error::kNoError; | 2201 return error::kNoError; |
1588 } | 2202 } |
1589 | 2203 |
1590 error::Error GLES2DecoderPassthroughImpl::DoSetDisjointValueSyncCHROMIUM( | 2204 error::Error GLES2DecoderPassthroughImpl::DoSetDisjointValueSyncCHROMIUM( |
1591 DisjointValueSync* sync) { | 2205 DisjointValueSync* sync) { |
| 2206 NOTIMPLEMENTED(); |
1592 return error::kNoError; | 2207 return error::kNoError; |
1593 } | 2208 } |
1594 | 2209 |
1595 error::Error GLES2DecoderPassthroughImpl::DoInsertEventMarkerEXT( | 2210 error::Error GLES2DecoderPassthroughImpl::DoInsertEventMarkerEXT( |
1596 GLsizei length, | 2211 GLsizei length, |
1597 const char* marker) { | 2212 const char* marker) { |
| 2213 NOTIMPLEMENTED(); |
1598 return error::kNoError; | 2214 return error::kNoError; |
1599 } | 2215 } |
1600 | 2216 |
1601 error::Error GLES2DecoderPassthroughImpl::DoPushGroupMarkerEXT( | 2217 error::Error GLES2DecoderPassthroughImpl::DoPushGroupMarkerEXT( |
1602 GLsizei length, | 2218 GLsizei length, |
1603 const char* marker) { | 2219 const char* marker) { |
| 2220 NOTIMPLEMENTED(); |
1604 return error::kNoError; | 2221 return error::kNoError; |
1605 } | 2222 } |
1606 | 2223 |
1607 error::Error GLES2DecoderPassthroughImpl::DoPopGroupMarkerEXT() { | 2224 error::Error GLES2DecoderPassthroughImpl::DoPopGroupMarkerEXT() { |
| 2225 NOTIMPLEMENTED(); |
1608 return error::kNoError; | 2226 return error::kNoError; |
1609 } | 2227 } |
1610 | 2228 |
1611 error::Error GLES2DecoderPassthroughImpl::DoGenVertexArraysOES( | 2229 error::Error GLES2DecoderPassthroughImpl::DoGenVertexArraysOES( |
1612 GLsizei n, | 2230 GLsizei n, |
1613 volatile GLuint* arrays) { | 2231 volatile GLuint* arrays) { |
1614 return error::kNoError; | 2232 return GenHelper( |
| 2233 n, arrays, &vertex_array_id_map_, |
| 2234 [](GLsizei n, GLuint* arrays) { glGenVertexArraysOES(n, arrays); }); |
1615 } | 2235 } |
1616 | 2236 |
1617 error::Error GLES2DecoderPassthroughImpl::DoDeleteVertexArraysOES( | 2237 error::Error GLES2DecoderPassthroughImpl::DoDeleteVertexArraysOES( |
1618 GLsizei n, | 2238 GLsizei n, |
1619 const volatile GLuint* arrays) { | 2239 const volatile GLuint* arrays) { |
1620 return error::kNoError; | 2240 return DeleteHelper( |
| 2241 n, arrays, &vertex_array_id_map_, |
| 2242 [](GLsizei n, GLuint* arrays) { glDeleteVertexArraysOES(n, arrays); }); |
1621 } | 2243 } |
1622 | 2244 |
1623 error::Error GLES2DecoderPassthroughImpl::DoIsVertexArrayOES(GLuint array, | 2245 error::Error GLES2DecoderPassthroughImpl::DoIsVertexArrayOES(GLuint array, |
1624 uint32_t* result) { | 2246 uint32_t* result) { |
| 2247 *result = glIsVertexArrayOES( |
| 2248 GetVertexArrayServiceID(array, &vertex_array_id_map_, false)); |
1625 return error::kNoError; | 2249 return error::kNoError; |
1626 } | 2250 } |
1627 | 2251 |
1628 error::Error GLES2DecoderPassthroughImpl::DoBindVertexArrayOES(GLuint array) { | 2252 error::Error GLES2DecoderPassthroughImpl::DoBindVertexArrayOES(GLuint array) { |
| 2253 glBindVertexArrayOES(GetVertexArrayServiceID(array, &vertex_array_id_map_, |
| 2254 bind_generates_resource_)); |
1629 return error::kNoError; | 2255 return error::kNoError; |
1630 } | 2256 } |
1631 | 2257 |
1632 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffers() { | 2258 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffers() { |
| 2259 gfx::SwapResult result = surface_->SwapBuffers(); |
| 2260 if (result == gfx::SwapResult::SWAP_FAILED) { |
| 2261 LOG(ERROR) << "Context lost because SwapBuffers failed."; |
| 2262 } |
| 2263 // TODO(geofflang): force the context loss? |
1633 return error::kNoError; | 2264 return error::kNoError; |
1634 } | 2265 } |
1635 | 2266 |
1636 error::Error GLES2DecoderPassthroughImpl::DoGetMaxValueInBufferCHROMIUM( | 2267 error::Error GLES2DecoderPassthroughImpl::DoGetMaxValueInBufferCHROMIUM( |
1637 GLuint buffer_id, | 2268 GLuint buffer_id, |
1638 GLsizei count, | 2269 GLsizei count, |
1639 GLenum type, | 2270 GLenum type, |
1640 GLuint offset, | 2271 GLuint offset, |
1641 uint32_t* result) { | 2272 uint32_t* result) { |
| 2273 NOTIMPLEMENTED(); |
1642 return error::kNoError; | 2274 return error::kNoError; |
1643 } | 2275 } |
1644 | 2276 |
1645 error::Error GLES2DecoderPassthroughImpl::DoEnableFeatureCHROMIUM( | 2277 error::Error GLES2DecoderPassthroughImpl::DoEnableFeatureCHROMIUM( |
1646 const char* feature) { | 2278 const char* feature) { |
| 2279 NOTIMPLEMENTED(); |
1647 return error::kNoError; | 2280 return error::kNoError; |
1648 } | 2281 } |
1649 | 2282 |
1650 error::Error GLES2DecoderPassthroughImpl::DoMapBufferRange(GLenum target, | 2283 error::Error GLES2DecoderPassthroughImpl::DoMapBufferRange(GLenum target, |
1651 GLintptr offset, | 2284 GLintptr offset, |
1652 GLsizeiptr size, | 2285 GLsizeiptr size, |
1653 GLbitfield access, | 2286 GLbitfield access, |
1654 void** ptr) { | 2287 void** ptr) { |
| 2288 NOTIMPLEMENTED(); |
1655 return error::kNoError; | 2289 return error::kNoError; |
1656 } | 2290 } |
1657 | 2291 |
1658 error::Error GLES2DecoderPassthroughImpl::DoUnmapBuffer(GLenum target) { | 2292 error::Error GLES2DecoderPassthroughImpl::DoUnmapBuffer(GLenum target) { |
| 2293 NOTIMPLEMENTED(); |
1659 return error::kNoError; | 2294 return error::kNoError; |
1660 } | 2295 } |
1661 | 2296 |
1662 error::Error GLES2DecoderPassthroughImpl::DoResizeCHROMIUM(GLuint width, | 2297 error::Error GLES2DecoderPassthroughImpl::DoResizeCHROMIUM(GLuint width, |
1663 GLuint height, | 2298 GLuint height, |
1664 GLfloat scale_factor, | 2299 GLfloat scale_factor, |
1665 GLboolean alpha) { | 2300 GLboolean alpha) { |
| 2301 NOTIMPLEMENTED(); |
1666 return error::kNoError; | 2302 return error::kNoError; |
1667 } | 2303 } |
1668 | 2304 |
1669 error::Error GLES2DecoderPassthroughImpl::DoGetRequestableExtensionsCHROMIUM( | 2305 error::Error GLES2DecoderPassthroughImpl::DoGetRequestableExtensionsCHROMIUM( |
1670 const char** extensions) { | 2306 const char** extensions) { |
| 2307 *extensions = ""; |
| 2308 NOTIMPLEMENTED(); |
1671 return error::kNoError; | 2309 return error::kNoError; |
1672 } | 2310 } |
1673 | 2311 |
1674 error::Error GLES2DecoderPassthroughImpl::DoRequestExtensionCHROMIUM( | 2312 error::Error GLES2DecoderPassthroughImpl::DoRequestExtensionCHROMIUM( |
1675 const char* extension) { | 2313 const char* extension) { |
| 2314 NOTIMPLEMENTED(); |
1676 return error::kNoError; | 2315 return error::kNoError; |
1677 } | 2316 } |
1678 | 2317 |
1679 error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoCHROMIUM( | 2318 error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoCHROMIUM( |
1680 GLuint program, | 2319 GLuint program, |
1681 std::vector<uint8_t>* data) { | 2320 std::vector<uint8_t>* data) { |
| 2321 GLuint service_program = 0; |
| 2322 if (!resources_->program_id_map.GetServiceID(program, &service_program)) { |
| 2323 return error::kNoError; |
| 2324 } |
| 2325 |
| 2326 GLint num_attributes = 0; |
| 2327 glGetProgramiv(service_program, GL_ACTIVE_ATTRIBUTES, &num_attributes); |
| 2328 |
| 2329 GLint num_uniforms = 0; |
| 2330 glGetProgramiv(service_program, GL_ACTIVE_UNIFORMS, &num_uniforms); |
| 2331 |
| 2332 data->resize(sizeof(ProgramInfoHeader) + |
| 2333 ((num_attributes + num_uniforms) * sizeof(ProgramInput)), |
| 2334 0); |
| 2335 |
| 2336 GLint link_status = 0; |
| 2337 glGetProgramiv(service_program, GL_LINK_STATUS, &link_status); |
| 2338 |
| 2339 ProgramInfoHeader header; |
| 2340 header.link_status = link_status; |
| 2341 header.num_attribs = num_attributes; |
| 2342 header.num_uniforms = num_uniforms; |
| 2343 InsertValueIntoBuffer(data, header, 0); |
| 2344 |
| 2345 GLint active_attribute_max_length = 0; |
| 2346 glGetProgramiv(service_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, |
| 2347 &active_attribute_max_length); |
| 2348 |
| 2349 std::vector<char> attrib_name_buf(active_attribute_max_length, 0); |
| 2350 for (GLint attrib_index = 0; attrib_index < num_attributes; attrib_index++) { |
| 2351 GLsizei length = 0; |
| 2352 GLint size = 0; |
| 2353 GLenum type = GL_NONE; |
| 2354 glGetActiveAttrib(service_program, attrib_index, attrib_name_buf.size(), |
| 2355 &length, &size, &type, attrib_name_buf.data()); |
| 2356 |
| 2357 ProgramInput input; |
| 2358 input.size = size; |
| 2359 input.type = type; |
| 2360 |
| 2361 int32_t location = |
| 2362 glGetAttribLocation(service_program, attrib_name_buf.data()); |
| 2363 input.location_offset = data->size(); |
| 2364 AppendValueToBuffer(data, location); |
| 2365 |
| 2366 input.name_offset = data->size(); |
| 2367 input.name_length = length; |
| 2368 AppendStringToBuffer(data, attrib_name_buf.data(), length); |
| 2369 |
| 2370 InsertValueIntoBuffer( |
| 2371 data, input, |
| 2372 sizeof(ProgramInfoHeader) + (attrib_index * sizeof(ProgramInput))); |
| 2373 } |
| 2374 |
| 2375 GLint active_uniform_max_length = 0; |
| 2376 glGetProgramiv(service_program, GL_ACTIVE_UNIFORM_MAX_LENGTH, |
| 2377 &active_uniform_max_length); |
| 2378 |
| 2379 std::vector<char> uniform_name_buf(active_uniform_max_length, 0); |
| 2380 for (GLint uniform_index = 0; uniform_index < num_uniforms; uniform_index++) { |
| 2381 GLsizei length = 0; |
| 2382 GLint size = 0; |
| 2383 GLenum type = GL_NONE; |
| 2384 glGetActiveUniform(service_program, uniform_index, uniform_name_buf.size(), |
| 2385 &length, &size, &type, uniform_name_buf.data()); |
| 2386 |
| 2387 ProgramInput input; |
| 2388 input.size = size; |
| 2389 input.type = type; |
| 2390 |
| 2391 input.location_offset = data->size(); |
| 2392 int32_t base_location = |
| 2393 glGetUniformLocation(service_program, uniform_name_buf.data()); |
| 2394 AppendValueToBuffer(data, base_location); |
| 2395 |
| 2396 GLSLArrayName parsed_service_name(uniform_name_buf.data()); |
| 2397 if (size > 1 || parsed_service_name.IsArrayName()) { |
| 2398 for (GLint location_index = 1; location_index < size; location_index++) { |
| 2399 std::string array_element_name = parsed_service_name.base_name() + "[" + |
| 2400 base::IntToString(location_index) + |
| 2401 "]"; |
| 2402 int32_t element_location = |
| 2403 glGetUniformLocation(service_program, array_element_name.c_str()); |
| 2404 AppendValueToBuffer(data, element_location); |
| 2405 } |
| 2406 } |
| 2407 |
| 2408 input.name_offset = data->size(); |
| 2409 input.name_length = length; |
| 2410 AppendStringToBuffer(data, uniform_name_buf.data(), length); |
| 2411 |
| 2412 InsertValueIntoBuffer(data, input, sizeof(ProgramInfoHeader) + |
| 2413 ((num_attributes + uniform_index) * |
| 2414 sizeof(ProgramInput))); |
| 2415 } |
| 2416 |
1682 return error::kNoError; | 2417 return error::kNoError; |
1683 } | 2418 } |
1684 | 2419 |
1685 error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlocksCHROMIUM( | 2420 error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlocksCHROMIUM( |
1686 GLuint program, | 2421 GLuint program, |
1687 std::vector<uint8_t>* data) { | 2422 std::vector<uint8_t>* data) { |
| 2423 NOTIMPLEMENTED(); |
1688 return error::kNoError; | 2424 return error::kNoError; |
1689 } | 2425 } |
1690 | 2426 |
1691 error::Error | 2427 error::Error |
1692 GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVaryingsCHROMIUM( | 2428 GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVaryingsCHROMIUM( |
1693 GLuint program, | 2429 GLuint program, |
1694 std::vector<uint8_t>* data) { | 2430 std::vector<uint8_t>* data) { |
| 2431 NOTIMPLEMENTED(); |
1695 return error::kNoError; | 2432 return error::kNoError; |
1696 } | 2433 } |
1697 | 2434 |
1698 error::Error GLES2DecoderPassthroughImpl::DoGetUniformsES3CHROMIUM( | 2435 error::Error GLES2DecoderPassthroughImpl::DoGetUniformsES3CHROMIUM( |
1699 GLuint program, | 2436 GLuint program, |
1700 std::vector<uint8_t>* data) { | 2437 std::vector<uint8_t>* data) { |
| 2438 NOTIMPLEMENTED(); |
1701 return error::kNoError; | 2439 return error::kNoError; |
1702 } | 2440 } |
1703 | 2441 |
1704 error::Error GLES2DecoderPassthroughImpl::DoGetTranslatedShaderSourceANGLE( | 2442 error::Error GLES2DecoderPassthroughImpl::DoGetTranslatedShaderSourceANGLE( |
1705 GLuint shader, | 2443 GLuint shader, |
1706 std::string* source) { | 2444 std::string* source) { |
| 2445 NOTIMPLEMENTED(); |
1707 return error::kNoError; | 2446 return error::kNoError; |
1708 } | 2447 } |
1709 | 2448 |
1710 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffersWithDamageCHROMIUM( | 2449 error::Error GLES2DecoderPassthroughImpl::DoSwapBuffersWithDamageCHROMIUM( |
1711 GLint x, | 2450 GLint x, |
1712 GLint y, | 2451 GLint y, |
1713 GLint width, | 2452 GLint width, |
1714 GLint height) { | 2453 GLint height) { |
| 2454 gfx::SwapResult result = surface_->PostSubBuffer(x, y, width, height); |
| 2455 if (result == gfx::SwapResult::SWAP_FAILED) { |
| 2456 LOG(ERROR) << "Context lost because PostSubBuffer failed."; |
| 2457 } |
| 2458 // TODO(geofflang): force the context loss? |
1715 return error::kNoError; | 2459 return error::kNoError; |
1716 } | 2460 } |
1717 | 2461 |
1718 error::Error GLES2DecoderPassthroughImpl::DoPostSubBufferCHROMIUM( | 2462 error::Error GLES2DecoderPassthroughImpl::DoPostSubBufferCHROMIUM( |
1719 GLint x, | 2463 GLint x, |
1720 GLint y, | 2464 GLint y, |
1721 GLint width, | 2465 GLint width, |
1722 GLint height) { | 2466 GLint height) { |
1723 return error::kNoError; | 2467 return error::kNoError; |
1724 } | 2468 } |
1725 | 2469 |
1726 error::Error GLES2DecoderPassthroughImpl::DoCopyTextureCHROMIUM( | 2470 error::Error GLES2DecoderPassthroughImpl::DoCopyTextureCHROMIUM( |
1727 GLenum source_id, | 2471 GLenum source_id, |
1728 GLenum dest_id, | 2472 GLenum dest_id, |
1729 GLint internalformat, | 2473 GLint internalformat, |
1730 GLenum dest_type, | 2474 GLenum dest_type, |
1731 GLboolean unpack_flip_y, | 2475 GLboolean unpack_flip_y, |
1732 GLboolean unpack_premultiply_alpha, | 2476 GLboolean unpack_premultiply_alpha, |
1733 GLboolean unpack_unmultiply_alpha) { | 2477 GLboolean unpack_unmultiply_alpha) { |
| 2478 glCopyTextureCHROMIUM(GetTextureServiceID(source_id, resources_, false), |
| 2479 GetTextureServiceID(dest_id, resources_, false), |
| 2480 internalformat, dest_type, unpack_flip_y, |
| 2481 unpack_premultiply_alpha, unpack_unmultiply_alpha); |
1734 return error::kNoError; | 2482 return error::kNoError; |
1735 } | 2483 } |
1736 | 2484 |
1737 error::Error GLES2DecoderPassthroughImpl::DoCopySubTextureCHROMIUM( | 2485 error::Error GLES2DecoderPassthroughImpl::DoCopySubTextureCHROMIUM( |
1738 GLenum source_id, | 2486 GLenum source_id, |
1739 GLenum dest_id, | 2487 GLenum dest_id, |
1740 GLint xoffset, | 2488 GLint xoffset, |
1741 GLint yoffset, | 2489 GLint yoffset, |
1742 GLint x, | 2490 GLint x, |
1743 GLint y, | 2491 GLint y, |
1744 GLsizei width, | 2492 GLsizei width, |
1745 GLsizei height, | 2493 GLsizei height, |
1746 GLboolean unpack_flip_y, | 2494 GLboolean unpack_flip_y, |
1747 GLboolean unpack_premultiply_alpha, | 2495 GLboolean unpack_premultiply_alpha, |
1748 GLboolean unpack_unmultiply_alpha) { | 2496 GLboolean unpack_unmultiply_alpha) { |
| 2497 glCopySubTextureCHROMIUM(GetTextureServiceID(source_id, resources_, false), |
| 2498 GetTextureServiceID(dest_id, resources_, false), |
| 2499 xoffset, yoffset, x, y, width, height, unpack_flip_y, |
| 2500 unpack_premultiply_alpha, unpack_unmultiply_alpha); |
1749 return error::kNoError; | 2501 return error::kNoError; |
1750 } | 2502 } |
1751 | 2503 |
1752 error::Error GLES2DecoderPassthroughImpl::DoCompressedCopyTextureCHROMIUM( | 2504 error::Error GLES2DecoderPassthroughImpl::DoCompressedCopyTextureCHROMIUM( |
1753 GLenum source_id, | 2505 GLenum source_id, |
1754 GLenum dest_id) { | 2506 GLenum dest_id) { |
| 2507 glCompressedCopyTextureCHROMIUM( |
| 2508 GetTextureServiceID(source_id, resources_, false), |
| 2509 GetTextureServiceID(dest_id, resources_, false)); |
1755 return error::kNoError; | 2510 return error::kNoError; |
1756 } | 2511 } |
1757 | 2512 |
1758 error::Error GLES2DecoderPassthroughImpl::DoDrawArraysInstancedANGLE( | 2513 error::Error GLES2DecoderPassthroughImpl::DoDrawArraysInstancedANGLE( |
1759 GLenum mode, | 2514 GLenum mode, |
1760 GLint first, | 2515 GLint first, |
1761 GLsizei count, | 2516 GLsizei count, |
1762 GLsizei primcount) { | 2517 GLsizei primcount) { |
| 2518 glDrawArraysInstancedANGLE(mode, first, count, primcount); |
1763 return error::kNoError; | 2519 return error::kNoError; |
1764 } | 2520 } |
1765 | 2521 |
1766 error::Error GLES2DecoderPassthroughImpl::DoDrawElementsInstancedANGLE( | 2522 error::Error GLES2DecoderPassthroughImpl::DoDrawElementsInstancedANGLE( |
1767 GLenum mode, | 2523 GLenum mode, |
1768 GLsizei count, | 2524 GLsizei count, |
1769 GLenum type, | 2525 GLenum type, |
1770 const void* indices, | 2526 const void* indices, |
1771 GLsizei primcount) { | 2527 GLsizei primcount) { |
| 2528 glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); |
1772 return error::kNoError; | 2529 return error::kNoError; |
1773 } | 2530 } |
1774 | 2531 |
1775 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribDivisorANGLE( | 2532 error::Error GLES2DecoderPassthroughImpl::DoVertexAttribDivisorANGLE( |
1776 GLuint index, | 2533 GLuint index, |
1777 GLuint divisor) { | 2534 GLuint divisor) { |
| 2535 glVertexAttribDivisorANGLE(index, divisor); |
1778 return error::kNoError; | 2536 return error::kNoError; |
1779 } | 2537 } |
1780 | 2538 |
1781 error::Error GLES2DecoderPassthroughImpl::DoProduceTextureCHROMIUM( | 2539 error::Error GLES2DecoderPassthroughImpl::DoProduceTextureCHROMIUM( |
1782 GLenum target, | 2540 GLenum target, |
1783 const volatile GLbyte* mailbox) { | 2541 const volatile GLbyte* mailbox) { |
| 2542 // TODO(geofflang): validation |
| 2543 |
| 2544 GLuint texture_client_id = bound_textures_[active_texture_unit_]; |
| 2545 scoped_refptr<TexturePassthrough> texture; |
| 2546 |
| 2547 auto texture_object_iter = |
| 2548 resources_->texture_object_map.find(texture_client_id); |
| 2549 if (texture_object_iter != resources_->texture_object_map.end()) { |
| 2550 texture = texture_object_iter->second.get(); |
| 2551 } else { |
| 2552 GLuint service_id = |
| 2553 GetTextureServiceID(texture_client_id, resources_, false); |
| 2554 texture = new TexturePassthrough(service_id); |
| 2555 resources_->texture_object_map.insert( |
| 2556 std::make_pair(texture_client_id, texture)); |
| 2557 } |
| 2558 |
| 2559 const Mailbox& mb = Mailbox::FromVolatile( |
| 2560 *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| 2561 mailbox_manager_->ProduceTexture(mb, texture.get()); |
1784 return error::kNoError; | 2562 return error::kNoError; |
1785 } | 2563 } |
1786 | 2564 |
1787 error::Error GLES2DecoderPassthroughImpl::DoProduceTextureDirectCHROMIUM( | 2565 error::Error GLES2DecoderPassthroughImpl::DoProduceTextureDirectCHROMIUM( |
1788 GLuint texture, | 2566 GLuint texture_client_id, |
1789 GLenum target, | 2567 GLenum target, |
1790 const volatile GLbyte* mailbox) { | 2568 const volatile GLbyte* mailbox) { |
| 2569 // TODO(geofflang): validation |
| 2570 |
| 2571 scoped_refptr<TexturePassthrough> texture; |
| 2572 auto texture_object_iter = |
| 2573 resources_->texture_object_map.find(texture_client_id); |
| 2574 if (texture_object_iter != resources_->texture_object_map.end()) { |
| 2575 texture = texture_object_iter->second.get(); |
| 2576 } else { |
| 2577 GLuint service_id = |
| 2578 GetTextureServiceID(texture_client_id, resources_, false); |
| 2579 texture = new TexturePassthrough(service_id); |
| 2580 resources_->texture_object_map.insert( |
| 2581 std::make_pair(texture_client_id, texture)); |
| 2582 } |
| 2583 |
| 2584 const Mailbox& mb = Mailbox::FromVolatile( |
| 2585 *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| 2586 mailbox_manager_->ProduceTexture(mb, texture.get()); |
1791 return error::kNoError; | 2587 return error::kNoError; |
1792 } | 2588 } |
1793 | 2589 |
1794 error::Error GLES2DecoderPassthroughImpl::DoConsumeTextureCHROMIUM( | 2590 error::Error GLES2DecoderPassthroughImpl::DoConsumeTextureCHROMIUM( |
1795 GLenum target, | 2591 GLenum target, |
1796 const volatile GLbyte* mailbox) { | 2592 const volatile GLbyte* mailbox) { |
| 2593 // TODO(geofflang): validation |
| 2594 |
| 2595 const Mailbox& mb = Mailbox::FromVolatile( |
| 2596 *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| 2597 scoped_refptr<TexturePassthrough> texture = static_cast<TexturePassthrough*>( |
| 2598 group_->mailbox_manager()->ConsumeTexture(mb)); |
| 2599 if (texture == nullptr) { |
| 2600 // TODO(geofflang): error, missing mailbox |
| 2601 return error::kNoError; |
| 2602 } |
| 2603 |
| 2604 GLuint client_id = bound_textures_[active_texture_unit_]; |
| 2605 resources_->texture_id_map.SetIDMapping(client_id, texture->service_id()); |
| 2606 resources_->texture_object_map.erase(client_id); |
| 2607 resources_->texture_object_map.insert(std::make_pair(client_id, texture)); |
1797 return error::kNoError; | 2608 return error::kNoError; |
1798 } | 2609 } |
1799 | 2610 |
1800 error::Error GLES2DecoderPassthroughImpl::DoCreateAndConsumeTextureINTERNAL( | 2611 error::Error GLES2DecoderPassthroughImpl::DoCreateAndConsumeTextureINTERNAL( |
1801 GLenum target, | 2612 GLenum target, |
1802 GLuint texture, | 2613 GLuint texture_client_id, |
1803 const volatile GLbyte* mailbox) { | 2614 const volatile GLbyte* mailbox) { |
| 2615 // TODO(geofflang): validation |
| 2616 |
| 2617 if (resources_->texture_id_map.GetServiceID(texture_client_id, nullptr)) { |
| 2618 return error::kInvalidArguments; |
| 2619 } |
| 2620 const Mailbox& mb = Mailbox::FromVolatile( |
| 2621 *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| 2622 scoped_refptr<TexturePassthrough> texture = static_cast<TexturePassthrough*>( |
| 2623 group_->mailbox_manager()->ConsumeTexture(mb)); |
| 2624 if (texture == nullptr) { |
| 2625 // TODO(geofflang): error, missing mailbox |
| 2626 return error::kNoError; |
| 2627 } |
| 2628 |
| 2629 resources_->texture_id_map.SetIDMapping(texture_client_id, |
| 2630 texture->service_id()); |
| 2631 resources_->texture_object_map.erase(texture_client_id); |
| 2632 resources_->texture_object_map.insert( |
| 2633 std::make_pair(texture_client_id, texture)); |
1804 return error::kNoError; | 2634 return error::kNoError; |
1805 } | 2635 } |
1806 | 2636 |
1807 error::Error GLES2DecoderPassthroughImpl::DoBindUniformLocationCHROMIUM( | 2637 error::Error GLES2DecoderPassthroughImpl::DoBindUniformLocationCHROMIUM( |
1808 GLuint program, | 2638 GLuint program, |
1809 GLint location, | 2639 GLint location, |
1810 const char* name) { | 2640 const char* name) { |
| 2641 glBindUniformLocationCHROMIUM(GetProgramServiceID(program, resources_), |
| 2642 location, name); |
1811 return error::kNoError; | 2643 return error::kNoError; |
1812 } | 2644 } |
1813 | 2645 |
1814 error::Error GLES2DecoderPassthroughImpl::DoBindTexImage2DCHROMIUM( | 2646 error::Error GLES2DecoderPassthroughImpl::DoBindTexImage2DCHROMIUM( |
1815 GLenum target, | 2647 GLenum target, |
1816 GLint imageId) { | 2648 GLint imageId) { |
| 2649 // TODO(geofflang): error handling |
| 2650 gl::GLImage* image = image_manager_->LookupImage(imageId); |
| 2651 if (!image->BindTexImage(target)) { |
| 2652 image->CopyTexImage(target); |
| 2653 } |
1817 return error::kNoError; | 2654 return error::kNoError; |
1818 } | 2655 } |
1819 | 2656 |
1820 error::Error GLES2DecoderPassthroughImpl::DoReleaseTexImage2DCHROMIUM( | 2657 error::Error GLES2DecoderPassthroughImpl::DoReleaseTexImage2DCHROMIUM( |
1821 GLenum target, | 2658 GLenum target, |
1822 GLint imageId) { | 2659 GLint imageId) { |
| 2660 // TODO(geofflang): error handling |
| 2661 gl::GLImage* image = image_manager_->LookupImage(imageId); |
| 2662 image->ReleaseTexImage(target); |
1823 return error::kNoError; | 2663 return error::kNoError; |
1824 } | 2664 } |
1825 | 2665 |
1826 error::Error GLES2DecoderPassthroughImpl::DoTraceBeginCHROMIUM( | 2666 error::Error GLES2DecoderPassthroughImpl::DoTraceBeginCHROMIUM( |
1827 const char* category_name, | 2667 const char* category_name, |
1828 const char* trace_name) { | 2668 const char* trace_name) { |
| 2669 NOTIMPLEMENTED(); |
1829 return error::kNoError; | 2670 return error::kNoError; |
1830 } | 2671 } |
1831 | 2672 |
1832 error::Error GLES2DecoderPassthroughImpl::DoTraceEndCHROMIUM() { | 2673 error::Error GLES2DecoderPassthroughImpl::DoTraceEndCHROMIUM() { |
| 2674 NOTIMPLEMENTED(); |
1833 return error::kNoError; | 2675 return error::kNoError; |
1834 } | 2676 } |
1835 | 2677 |
1836 error::Error GLES2DecoderPassthroughImpl::DoDiscardFramebufferEXT( | 2678 error::Error GLES2DecoderPassthroughImpl::DoDiscardFramebufferEXT( |
1837 GLenum target, | 2679 GLenum target, |
1838 GLsizei count, | 2680 GLsizei count, |
1839 const volatile GLenum* attachments) { | 2681 const volatile GLenum* attachments) { |
| 2682 std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| 2683 glDiscardFramebufferEXT(target, count, attachments_copy.data()); |
1840 return error::kNoError; | 2684 return error::kNoError; |
1841 } | 2685 } |
1842 | 2686 |
1843 error::Error GLES2DecoderPassthroughImpl::DoLoseContextCHROMIUM(GLenum current, | 2687 error::Error GLES2DecoderPassthroughImpl::DoLoseContextCHROMIUM(GLenum current, |
1844 GLenum other) { | 2688 GLenum other) { |
| 2689 NOTIMPLEMENTED(); |
1845 return error::kNoError; | 2690 return error::kNoError; |
1846 } | 2691 } |
1847 | 2692 |
1848 error::Error GLES2DecoderPassthroughImpl::DoDescheduleUntilFinishedCHROMIUM() { | 2693 error::Error GLES2DecoderPassthroughImpl::DoDescheduleUntilFinishedCHROMIUM() { |
| 2694 NOTIMPLEMENTED(); |
1849 return error::kNoError; | 2695 return error::kNoError; |
1850 } | 2696 } |
1851 | 2697 |
1852 error::Error GLES2DecoderPassthroughImpl::DoInsertFenceSyncCHROMIUM( | 2698 error::Error GLES2DecoderPassthroughImpl::DoInsertFenceSyncCHROMIUM( |
1853 GLuint64 release_count) { | 2699 GLuint64 release_count) { |
| 2700 if (!fence_sync_release_callback_.is_null()) |
| 2701 fence_sync_release_callback_.Run(release_count); |
1854 return error::kNoError; | 2702 return error::kNoError; |
1855 } | 2703 } |
1856 | 2704 |
1857 error::Error GLES2DecoderPassthroughImpl::DoWaitSyncTokenCHROMIUM( | 2705 error::Error GLES2DecoderPassthroughImpl::DoWaitSyncTokenCHROMIUM( |
1858 CommandBufferNamespace namespace_id, | 2706 CommandBufferNamespace namespace_id, |
1859 CommandBufferId command_buffer_id, | 2707 CommandBufferId command_buffer_id, |
1860 GLuint64 release_count) { | 2708 GLuint64 release_count) { |
1861 return error::kNoError; | 2709 if (wait_fence_sync_callback_.is_null()) { |
| 2710 return error::kNoError; |
| 2711 } |
| 2712 return wait_fence_sync_callback_.Run(namespace_id, command_buffer_id, |
| 2713 release_count) |
| 2714 ? error::kNoError |
| 2715 : error::kDeferCommandUntilLater; |
1862 } | 2716 } |
1863 | 2717 |
1864 error::Error GLES2DecoderPassthroughImpl::DoDrawBuffersEXT( | 2718 error::Error GLES2DecoderPassthroughImpl::DoDrawBuffersEXT( |
1865 GLsizei count, | 2719 GLsizei count, |
1866 const volatile GLenum* bufs) { | 2720 const volatile GLenum* bufs) { |
| 2721 std::vector<GLenum> bufs_copy(bufs, bufs + count); |
| 2722 glDrawBuffersARB(count, bufs_copy.data()); |
1867 return error::kNoError; | 2723 return error::kNoError; |
1868 } | 2724 } |
1869 | 2725 |
1870 error::Error GLES2DecoderPassthroughImpl::DoDiscardBackbufferCHROMIUM() { | 2726 error::Error GLES2DecoderPassthroughImpl::DoDiscardBackbufferCHROMIUM() { |
| 2727 NOTIMPLEMENTED(); |
1871 return error::kNoError; | 2728 return error::kNoError; |
1872 } | 2729 } |
1873 | 2730 |
1874 error::Error GLES2DecoderPassthroughImpl::DoScheduleOverlayPlaneCHROMIUM( | 2731 error::Error GLES2DecoderPassthroughImpl::DoScheduleOverlayPlaneCHROMIUM( |
1875 GLint plane_z_order, | 2732 GLint plane_z_order, |
1876 GLenum plane_transform, | 2733 GLenum plane_transform, |
1877 GLuint overlay_texture_id, | 2734 GLuint overlay_texture_id, |
1878 GLint bounds_x, | 2735 GLint bounds_x, |
1879 GLint bounds_y, | 2736 GLint bounds_y, |
1880 GLint bounds_width, | 2737 GLint bounds_width, |
1881 GLint bounds_height, | 2738 GLint bounds_height, |
1882 GLfloat uv_x, | 2739 GLfloat uv_x, |
1883 GLfloat uv_y, | 2740 GLfloat uv_y, |
1884 GLfloat uv_width, | 2741 GLfloat uv_width, |
1885 GLfloat uv_height) { | 2742 GLfloat uv_height) { |
| 2743 NOTIMPLEMENTED(); |
1886 return error::kNoError; | 2744 return error::kNoError; |
1887 } | 2745 } |
1888 | 2746 |
1889 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerSharedStateCHROMIUM( | 2747 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerSharedStateCHROMIUM( |
1890 GLfloat opacity, | 2748 GLfloat opacity, |
1891 GLboolean is_clipped, | 2749 GLboolean is_clipped, |
1892 const GLfloat* clip_rect, | 2750 const GLfloat* clip_rect, |
1893 GLint sorting_context_id, | 2751 GLint sorting_context_id, |
1894 const GLfloat* transform) { | 2752 const GLfloat* transform) { |
| 2753 NOTIMPLEMENTED(); |
1895 return error::kNoError; | 2754 return error::kNoError; |
1896 } | 2755 } |
1897 | 2756 |
1898 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerCHROMIUM( | 2757 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerCHROMIUM( |
1899 GLuint contents_texture_id, | 2758 GLuint contents_texture_id, |
1900 const GLfloat* contents_rect, | 2759 const GLfloat* contents_rect, |
1901 GLuint background_color, | 2760 GLuint background_color, |
1902 GLuint edge_aa_mask, | 2761 GLuint edge_aa_mask, |
1903 const GLfloat* bounds_rect) { | 2762 const GLfloat* bounds_rect) { |
| 2763 NOTIMPLEMENTED(); |
1904 return error::kNoError; | 2764 return error::kNoError; |
1905 } | 2765 } |
1906 | 2766 |
1907 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerInUseQueryCHROMIUM( | 2767 error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerInUseQueryCHROMIUM( |
1908 GLuint n, | 2768 GLuint n, |
1909 const volatile GLuint* textures) { | 2769 const volatile GLuint* textures) { |
| 2770 NOTIMPLEMENTED(); |
1910 return error::kNoError; | 2771 return error::kNoError; |
1911 } | 2772 } |
1912 | 2773 |
1913 error::Error GLES2DecoderPassthroughImpl::DoCommitOverlayPlanesCHROMIUM() { | 2774 error::Error GLES2DecoderPassthroughImpl::DoCommitOverlayPlanesCHROMIUM() { |
| 2775 NOTIMPLEMENTED(); |
1914 return error::kNoError; | 2776 return error::kNoError; |
1915 } | 2777 } |
1916 | 2778 |
1917 error::Error GLES2DecoderPassthroughImpl::DoSwapInterval(GLint interval) { | 2779 error::Error GLES2DecoderPassthroughImpl::DoSwapInterval(GLint interval) { |
| 2780 context_->SetSwapInterval(interval); |
1918 return error::kNoError; | 2781 return error::kNoError; |
1919 } | 2782 } |
1920 | 2783 |
1921 error::Error GLES2DecoderPassthroughImpl::DoFlushDriverCachesCHROMIUM() { | 2784 error::Error GLES2DecoderPassthroughImpl::DoFlushDriverCachesCHROMIUM() { |
| 2785 NOTIMPLEMENTED(); |
1922 return error::kNoError; | 2786 return error::kNoError; |
1923 } | 2787 } |
1924 | 2788 |
1925 error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadfCHROMIUM( | 2789 error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadfCHROMIUM( |
1926 GLenum matrixMode, | 2790 GLenum matrixMode, |
1927 const volatile GLfloat* m) { | 2791 const volatile GLfloat* m) { |
| 2792 NOTIMPLEMENTED(); |
1928 return error::kNoError; | 2793 return error::kNoError; |
1929 } | 2794 } |
1930 | 2795 |
1931 error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadIdentityCHROMIUM( | 2796 error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadIdentityCHROMIUM( |
1932 GLenum matrixMode) { | 2797 GLenum matrixMode) { |
| 2798 NOTIMPLEMENTED(); |
1933 return error::kNoError; | 2799 return error::kNoError; |
1934 } | 2800 } |
1935 | 2801 |
1936 error::Error GLES2DecoderPassthroughImpl::DoGenPathsCHROMIUM(GLuint path, | 2802 error::Error GLES2DecoderPassthroughImpl::DoGenPathsCHROMIUM(GLuint path, |
1937 GLsizei range) { | 2803 GLsizei range) { |
| 2804 NOTIMPLEMENTED(); |
1938 return error::kNoError; | 2805 return error::kNoError; |
1939 } | 2806 } |
1940 | 2807 |
1941 error::Error GLES2DecoderPassthroughImpl::DoDeletePathsCHROMIUM(GLuint path, | 2808 error::Error GLES2DecoderPassthroughImpl::DoDeletePathsCHROMIUM(GLuint path, |
1942 GLsizei range) { | 2809 GLsizei range) { |
| 2810 NOTIMPLEMENTED(); |
1943 return error::kNoError; | 2811 return error::kNoError; |
1944 } | 2812 } |
1945 | 2813 |
1946 error::Error GLES2DecoderPassthroughImpl::DoIsPathCHROMIUM(GLuint path, | 2814 error::Error GLES2DecoderPassthroughImpl::DoIsPathCHROMIUM(GLuint path, |
1947 uint32_t* result) { | 2815 uint32_t* result) { |
| 2816 NOTIMPLEMENTED(); |
1948 return error::kNoError; | 2817 return error::kNoError; |
1949 } | 2818 } |
1950 | 2819 |
1951 error::Error GLES2DecoderPassthroughImpl::DoPathCommandsCHROMIUM( | 2820 error::Error GLES2DecoderPassthroughImpl::DoPathCommandsCHROMIUM( |
1952 GLuint path, | 2821 GLuint path, |
1953 GLsizei numCommands, | 2822 GLsizei numCommands, |
1954 const GLubyte* commands, | 2823 const GLubyte* commands, |
1955 GLsizei numCoords, | 2824 GLsizei numCoords, |
1956 GLenum coordType, | 2825 GLenum coordType, |
1957 const GLvoid* coords, | 2826 const GLvoid* coords, |
1958 GLsizei coords_bufsize) { | 2827 GLsizei coords_bufsize) { |
| 2828 NOTIMPLEMENTED(); |
1959 return error::kNoError; | 2829 return error::kNoError; |
1960 } | 2830 } |
1961 | 2831 |
1962 error::Error GLES2DecoderPassthroughImpl::DoPathParameterfCHROMIUM( | 2832 error::Error GLES2DecoderPassthroughImpl::DoPathParameterfCHROMIUM( |
1963 GLuint path, | 2833 GLuint path, |
1964 GLenum pname, | 2834 GLenum pname, |
1965 GLfloat value) { | 2835 GLfloat value) { |
| 2836 NOTIMPLEMENTED(); |
1966 return error::kNoError; | 2837 return error::kNoError; |
1967 } | 2838 } |
1968 | 2839 |
1969 error::Error GLES2DecoderPassthroughImpl::DoPathParameteriCHROMIUM( | 2840 error::Error GLES2DecoderPassthroughImpl::DoPathParameteriCHROMIUM( |
1970 GLuint path, | 2841 GLuint path, |
1971 GLenum pname, | 2842 GLenum pname, |
1972 GLint value) { | 2843 GLint value) { |
| 2844 NOTIMPLEMENTED(); |
1973 return error::kNoError; | 2845 return error::kNoError; |
1974 } | 2846 } |
1975 | 2847 |
1976 error::Error GLES2DecoderPassthroughImpl::DoPathStencilFuncCHROMIUM( | 2848 error::Error GLES2DecoderPassthroughImpl::DoPathStencilFuncCHROMIUM( |
1977 GLenum func, | 2849 GLenum func, |
1978 GLint ref, | 2850 GLint ref, |
1979 GLuint mask) { | 2851 GLuint mask) { |
| 2852 NOTIMPLEMENTED(); |
1980 return error::kNoError; | 2853 return error::kNoError; |
1981 } | 2854 } |
1982 | 2855 |
1983 error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathCHROMIUM( | 2856 error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathCHROMIUM( |
1984 GLuint path, | 2857 GLuint path, |
1985 GLenum fillMode, | 2858 GLenum fillMode, |
1986 GLuint mask) { | 2859 GLuint mask) { |
| 2860 NOTIMPLEMENTED(); |
1987 return error::kNoError; | 2861 return error::kNoError; |
1988 } | 2862 } |
1989 | 2863 |
1990 error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathCHROMIUM( | 2864 error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathCHROMIUM( |
1991 GLuint path, | 2865 GLuint path, |
1992 GLint reference, | 2866 GLint reference, |
1993 GLuint mask) { | 2867 GLuint mask) { |
| 2868 NOTIMPLEMENTED(); |
1994 return error::kNoError; | 2869 return error::kNoError; |
1995 } | 2870 } |
1996 | 2871 |
1997 error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathCHROMIUM( | 2872 error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathCHROMIUM( |
1998 GLuint path, | 2873 GLuint path, |
1999 GLenum coverMode) { | 2874 GLenum coverMode) { |
| 2875 NOTIMPLEMENTED(); |
2000 return error::kNoError; | 2876 return error::kNoError; |
2001 } | 2877 } |
2002 | 2878 |
2003 error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathCHROMIUM( | 2879 error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathCHROMIUM( |
2004 GLuint path, | 2880 GLuint path, |
2005 GLenum coverMode) { | 2881 GLenum coverMode) { |
| 2882 NOTIMPLEMENTED(); |
2006 return error::kNoError; | 2883 return error::kNoError; |
2007 } | 2884 } |
2008 | 2885 |
2009 error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathCHROMIUM( | 2886 error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathCHROMIUM( |
2010 GLuint path, | 2887 GLuint path, |
2011 GLenum fillMode, | 2888 GLenum fillMode, |
2012 GLuint mask, | 2889 GLuint mask, |
2013 GLenum coverMode) { | 2890 GLenum coverMode) { |
| 2891 NOTIMPLEMENTED(); |
2014 return error::kNoError; | 2892 return error::kNoError; |
2015 } | 2893 } |
2016 | 2894 |
2017 error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathCHROMIUM( | 2895 error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathCHROMIUM( |
2018 GLuint path, | 2896 GLuint path, |
2019 GLint reference, | 2897 GLint reference, |
2020 GLuint mask, | 2898 GLuint mask, |
2021 GLenum coverMode) { | 2899 GLenum coverMode) { |
| 2900 NOTIMPLEMENTED(); |
2022 return error::kNoError; | 2901 return error::kNoError; |
2023 } | 2902 } |
2024 | 2903 |
2025 error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathInstancedCHROMIUM( | 2904 error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathInstancedCHROMIUM( |
2026 GLsizei numPaths, | 2905 GLsizei numPaths, |
2027 GLenum pathNameType, | 2906 GLenum pathNameType, |
2028 const GLvoid* paths, | 2907 const GLvoid* paths, |
2029 GLsizei pathsBufsize, | 2908 GLsizei pathsBufsize, |
2030 GLuint pathBase, | 2909 GLuint pathBase, |
2031 GLenum fillMode, | 2910 GLenum fillMode, |
2032 GLuint mask, | 2911 GLuint mask, |
2033 GLenum transformType, | 2912 GLenum transformType, |
2034 const GLfloat* transformValues, | 2913 const GLfloat* transformValues, |
2035 GLsizei transformValuesBufsize) { | 2914 GLsizei transformValuesBufsize) { |
| 2915 NOTIMPLEMENTED(); |
2036 return error::kNoError; | 2916 return error::kNoError; |
2037 } | 2917 } |
2038 | 2918 |
2039 error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathInstancedCHROMIUM( | 2919 error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathInstancedCHROMIUM( |
2040 GLsizei numPaths, | 2920 GLsizei numPaths, |
2041 GLenum pathNameType, | 2921 GLenum pathNameType, |
2042 const GLvoid* paths, | 2922 const GLvoid* paths, |
2043 GLsizei pathsBufsize, | 2923 GLsizei pathsBufsize, |
2044 GLuint pathBase, | 2924 GLuint pathBase, |
2045 GLint reference, | 2925 GLint reference, |
2046 GLuint mask, | 2926 GLuint mask, |
2047 GLenum transformType, | 2927 GLenum transformType, |
2048 const GLfloat* transformValues, | 2928 const GLfloat* transformValues, |
2049 GLsizei transformValuesBufsize) { | 2929 GLsizei transformValuesBufsize) { |
| 2930 NOTIMPLEMENTED(); |
2050 return error::kNoError; | 2931 return error::kNoError; |
2051 } | 2932 } |
2052 | 2933 |
2053 error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathInstancedCHROMIUM( | 2934 error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathInstancedCHROMIUM( |
2054 GLsizei numPaths, | 2935 GLsizei numPaths, |
2055 GLenum pathNameType, | 2936 GLenum pathNameType, |
2056 const GLvoid* paths, | 2937 const GLvoid* paths, |
2057 GLsizei pathsBufsize, | 2938 GLsizei pathsBufsize, |
2058 GLuint pathBase, | 2939 GLuint pathBase, |
2059 GLenum coverMode, | 2940 GLenum coverMode, |
2060 GLenum transformType, | 2941 GLenum transformType, |
2061 const GLfloat* transformValues, | 2942 const GLfloat* transformValues, |
2062 GLsizei transformValuesBufsize) { | 2943 GLsizei transformValuesBufsize) { |
| 2944 NOTIMPLEMENTED(); |
2063 return error::kNoError; | 2945 return error::kNoError; |
2064 } | 2946 } |
2065 | 2947 |
2066 error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathInstancedCHROMIUM( | 2948 error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathInstancedCHROMIUM( |
2067 GLsizei numPaths, | 2949 GLsizei numPaths, |
2068 GLenum pathNameType, | 2950 GLenum pathNameType, |
2069 const GLvoid* paths, | 2951 const GLvoid* paths, |
2070 GLsizei pathsBufsize, | 2952 GLsizei pathsBufsize, |
2071 GLuint pathBase, | 2953 GLuint pathBase, |
2072 GLenum coverMode, | 2954 GLenum coverMode, |
2073 GLenum transformType, | 2955 GLenum transformType, |
2074 const GLfloat* transformValues, | 2956 const GLfloat* transformValues, |
2075 GLsizei transformValuesBufsize) { | 2957 GLsizei transformValuesBufsize) { |
| 2958 NOTIMPLEMENTED(); |
2076 return error::kNoError; | 2959 return error::kNoError; |
2077 } | 2960 } |
2078 | 2961 |
2079 error::Error | 2962 error::Error |
2080 GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathInstancedCHROMIUM( | 2963 GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathInstancedCHROMIUM( |
2081 GLsizei numPaths, | 2964 GLsizei numPaths, |
2082 GLenum pathNameType, | 2965 GLenum pathNameType, |
2083 const GLvoid* paths, | 2966 const GLvoid* paths, |
2084 GLsizei pathsBufsize, | 2967 GLsizei pathsBufsize, |
2085 GLuint pathBase, | 2968 GLuint pathBase, |
2086 GLenum fillMode, | 2969 GLenum fillMode, |
2087 GLuint mask, | 2970 GLuint mask, |
2088 GLenum coverMode, | 2971 GLenum coverMode, |
2089 GLenum transformType, | 2972 GLenum transformType, |
2090 const GLfloat* transformValues, | 2973 const GLfloat* transformValues, |
2091 GLsizei transformValuesBufsize) { | 2974 GLsizei transformValuesBufsize) { |
| 2975 NOTIMPLEMENTED(); |
2092 return error::kNoError; | 2976 return error::kNoError; |
2093 } | 2977 } |
2094 | 2978 |
2095 error::Error | 2979 error::Error |
2096 GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathInstancedCHROMIUM( | 2980 GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathInstancedCHROMIUM( |
2097 GLsizei numPaths, | 2981 GLsizei numPaths, |
2098 GLenum pathNameType, | 2982 GLenum pathNameType, |
2099 const GLvoid* paths, | 2983 const GLvoid* paths, |
2100 GLsizei pathsBufsize, | 2984 GLsizei pathsBufsize, |
2101 GLuint pathBase, | 2985 GLuint pathBase, |
2102 GLint reference, | 2986 GLint reference, |
2103 GLuint mask, | 2987 GLuint mask, |
2104 GLenum coverMode, | 2988 GLenum coverMode, |
2105 GLenum transformType, | 2989 GLenum transformType, |
2106 const GLfloat* transformValues, | 2990 const GLfloat* transformValues, |
2107 GLsizei transformValuesBufsize) { | 2991 GLsizei transformValuesBufsize) { |
| 2992 NOTIMPLEMENTED(); |
2108 return error::kNoError; | 2993 return error::kNoError; |
2109 } | 2994 } |
2110 | 2995 |
2111 error::Error GLES2DecoderPassthroughImpl::DoBindFragmentInputLocationCHROMIUM( | 2996 error::Error GLES2DecoderPassthroughImpl::DoBindFragmentInputLocationCHROMIUM( |
2112 GLuint program, | 2997 GLuint program, |
2113 GLint location, | 2998 GLint location, |
2114 const char* name) { | 2999 const char* name) { |
| 3000 NOTIMPLEMENTED(); |
2115 return error::kNoError; | 3001 return error::kNoError; |
2116 } | 3002 } |
2117 | 3003 |
2118 error::Error GLES2DecoderPassthroughImpl::DoProgramPathFragmentInputGenCHROMIUM( | 3004 error::Error GLES2DecoderPassthroughImpl::DoProgramPathFragmentInputGenCHROMIUM( |
2119 GLuint program, | 3005 GLuint program, |
2120 GLint location, | 3006 GLint location, |
2121 GLenum genMode, | 3007 GLenum genMode, |
2122 GLint components, | 3008 GLint components, |
2123 const GLfloat* coeffs, | 3009 const GLfloat* coeffs, |
2124 GLsizei coeffsBufsize) { | 3010 GLsizei coeffsBufsize) { |
| 3011 NOTIMPLEMENTED(); |
2125 return error::kNoError; | 3012 return error::kNoError; |
2126 } | 3013 } |
2127 | 3014 |
2128 error::Error GLES2DecoderPassthroughImpl::DoCoverageModulationCHROMIUM( | 3015 error::Error GLES2DecoderPassthroughImpl::DoCoverageModulationCHROMIUM( |
2129 GLenum components) { | 3016 GLenum components) { |
| 3017 NOTIMPLEMENTED(); |
2130 return error::kNoError; | 3018 return error::kNoError; |
2131 } | 3019 } |
2132 | 3020 |
2133 error::Error GLES2DecoderPassthroughImpl::DoBlendBarrierKHR() { | 3021 error::Error GLES2DecoderPassthroughImpl::DoBlendBarrierKHR() { |
| 3022 NOTIMPLEMENTED(); |
2134 return error::kNoError; | 3023 return error::kNoError; |
2135 } | 3024 } |
2136 | 3025 |
2137 error::Error | 3026 error::Error |
2138 GLES2DecoderPassthroughImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { | 3027 GLES2DecoderPassthroughImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { |
| 3028 NOTIMPLEMENTED(); |
2139 return error::kNoError; | 3029 return error::kNoError; |
2140 } | 3030 } |
2141 | 3031 |
2142 error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationIndexedEXT( | 3032 error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationIndexedEXT( |
2143 GLuint program, | 3033 GLuint program, |
2144 GLuint colorNumber, | 3034 GLuint colorNumber, |
2145 GLuint index, | 3035 GLuint index, |
2146 const char* name) { | 3036 const char* name) { |
| 3037 NOTIMPLEMENTED(); |
2147 return error::kNoError; | 3038 return error::kNoError; |
2148 } | 3039 } |
2149 | 3040 |
2150 error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationEXT( | 3041 error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationEXT( |
2151 GLuint program, | 3042 GLuint program, |
2152 GLuint colorNumber, | 3043 GLuint colorNumber, |
2153 const char* name) { | 3044 const char* name) { |
| 3045 NOTIMPLEMENTED(); |
2154 return error::kNoError; | 3046 return error::kNoError; |
2155 } | 3047 } |
2156 | 3048 |
2157 error::Error GLES2DecoderPassthroughImpl::DoGetFragDataIndexEXT( | 3049 error::Error GLES2DecoderPassthroughImpl::DoGetFragDataIndexEXT( |
2158 GLuint program, | 3050 GLuint program, |
2159 const char* name, | 3051 const char* name, |
2160 GLint* index) { | 3052 GLint* index) { |
| 3053 NOTIMPLEMENTED(); |
2161 return error::kNoError; | 3054 return error::kNoError; |
2162 } | 3055 } |
2163 | 3056 |
2164 error::Error | 3057 error::Error |
2165 GLES2DecoderPassthroughImpl::DoUniformMatrix4fvStreamTextureMatrixCHROMIUM( | 3058 GLES2DecoderPassthroughImpl::DoUniformMatrix4fvStreamTextureMatrixCHROMIUM( |
2166 GLint location, | 3059 GLint location, |
2167 GLboolean transpose, | 3060 GLboolean transpose, |
2168 const volatile GLfloat* defaultValue) { | 3061 const volatile GLfloat* defaultValue) { |
| 3062 NOTIMPLEMENTED(); |
2169 return error::kNoError; | 3063 return error::kNoError; |
2170 } | 3064 } |
2171 | 3065 |
2172 } // namespace gles2 | 3066 } // namespace gles2 |
2173 } // namespace gpu | 3067 } // namespace gpu |
OLD | NEW |