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