Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc |
| index 2b19cded504e80a1ce62225870e1529b3826f793..c41227bbe46f409ca00a80b22842c9b61c8a4a00 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc |
| @@ -9,13 +9,77 @@ |
| namespace gpu { |
| namespace gles2 { |
| +namespace { |
| + |
| +template <typename ClientType, typename ServiceType, typename GenFunction> |
| +error::Error GenHelper(GLsizei n, |
| + const volatile ClientType* client_ids, |
| + ClientServiceMap<ClientType, ServiceType>* id_map, |
| + GenFunction gen_function) { |
| + std::vector<ServiceType> service_ids(n, 0); |
| + gen_function(n, service_ids.data()); |
| + for (GLsizei ii = 0; ii < n; ++ii) { |
| + ClientType client_id = client_ids[ii]; |
| + if (id_map->GetServiceID(client_ids[ii], nullptr)) { |
| + return error::kInvalidArguments; |
| + } |
| + id_map->SetIDMapping(client_id, service_ids[ii]); |
| + } |
| + |
| + return error::kNoError; |
| +} |
| + |
| +template <typename ClientType, typename ServiceType, typename GenFunction> |
| +error::Error CreateHelper(ClientType client_id, |
| + ClientServiceMap<ClientType, ServiceType>* id_map, |
| + GenFunction create_function) { |
| + if (id_map->GetServiceID(client_id, nullptr)) { |
| + return error::kInvalidArguments; |
| + } |
| + ServiceType service_id = create_function(); |
| + id_map->SetIDMapping(client_id, service_id); |
| + return error::kNoError; |
| +} |
| + |
| +template <typename ClientType, typename ServiceType, typename DeleteFunction> |
| +error::Error DeleteHelper(GLsizei n, |
| + const volatile ClientType* client_ids, |
| + ClientServiceMap<ClientType, ServiceType>* id_map, |
| + DeleteFunction delete_function) { |
| + std::vector<ServiceType> service_ids(n, 0); |
| + for (GLsizei ii = 0; ii < n; ++ii) { |
| + ClientType client_id = client_ids[ii]; |
| + service_ids[ii] = id_map->GetServiceIDOrReserve(client_id); |
| + id_map->RemoveClientID(client_id); |
| + } |
| + |
| + delete_function(n, service_ids.data()); |
| + |
| + return error::kNoError; |
| +} |
| + |
| +template <typename ClientType, typename ServiceType, typename DeleteFunction> |
| +error::Error DeleteHelper(ClientType client_id, |
| + ClientServiceMap<ClientType, ServiceType>* id_map, |
| + DeleteFunction delete_function) { |
| + delete_function(id_map->GetServiceIDOrReserve(client_id)); |
| + id_map->RemoveClientID(client_id); |
| + return error::kNoError; |
| +} |
| + |
| +} // anonymous namespace |
| + |
| // Implementations of commands |
| error::Error GLES2DecoderPassthroughImpl::DoActiveTexture(GLenum texture) { |
| + glActiveTexture(texture); |
| + active_texture_unit_ = static_cast<size_t>(texture) - GL_TEXTURE0; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoAttachShader(GLuint program, |
| GLuint shader) { |
| + glAttachShader(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + resources_->shader_id_map.GetServiceIDOrReserve(shader)); |
| return error::kNoError; |
| } |
| @@ -23,17 +87,22 @@ error::Error GLES2DecoderPassthroughImpl::DoBindAttribLocation( |
| GLuint program, |
| GLuint index, |
| const char* name) { |
| + glBindAttribLocation( |
| + resources_->program_id_map.GetServiceIDOrReserve(program), index, name); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindBuffer(GLenum target, |
| GLuint buffer) { |
| + glBindBuffer(target, resources_->buffer_id_map.GetServiceIDOrReserve(buffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindBufferBase(GLenum target, |
| GLuint index, |
| GLuint buffer) { |
| + glBindBufferBase(target, index, |
| + resources_->buffer_id_map.GetServiceIDOrReserve(buffer)); |
| return error::kNoError; |
| } |
| @@ -42,34 +111,53 @@ error::Error GLES2DecoderPassthroughImpl::DoBindBufferRange(GLenum target, |
| GLuint buffer, |
| GLintptr offset, |
| GLsizeiptr size) { |
| + glBindBufferRange(target, index, |
| + resources_->buffer_id_map.GetServiceIDOrReserve(buffer), |
| + offset, size); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindFramebuffer( |
| GLenum target, |
| GLuint framebuffer) { |
| + glBindFramebufferEXT(target, |
| + framebuffer_id_map_.GetServiceIDOrReserve(framebuffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindRenderbuffer( |
| GLenum target, |
| GLuint renderbuffer) { |
| + glBindRenderbufferEXT( |
| + target, |
| + resources_->renderbuffer_id_map.GetServiceIDOrReserve(renderbuffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindSampler(GLuint unit, |
| GLuint sampler) { |
| + glBindSampler(unit, |
| + resources_->sampler_id_map.GetServiceIDOrReserve(sampler)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindTexture(GLenum target, |
| GLuint texture) { |
| + glBindTexture(target, |
| + resources_->texture_id_map.GetServiceIDOrReserve(texture)); |
| + if (target == GL_TEXTURE_2D && |
| + active_texture_unit_ < bound_textures_.size()) { |
| + bound_textures_[active_texture_unit_] = texture; |
| + } |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindTransformFeedback( |
| GLenum target, |
| GLuint transformfeedback) { |
| + glBindTransformFeedback( |
| + target, |
| + transform_feedback_id_map_.GetServiceIDOrReserve(transformfeedback)); |
| return error::kNoError; |
| } |
| @@ -77,21 +165,25 @@ error::Error GLES2DecoderPassthroughImpl::DoBlendColor(GLclampf red, |
| GLclampf green, |
| GLclampf blue, |
| GLclampf alpha) { |
| + glBlendColor(red, green, blue, alpha); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBlendEquation(GLenum mode) { |
| + glBlendEquation(mode); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBlendEquationSeparate( |
| GLenum modeRGB, |
| GLenum modeAlpha) { |
| + glBlendEquationSeparate(modeRGB, modeAlpha); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBlendFunc(GLenum sfactor, |
| GLenum dfactor) { |
| + glBlendFunc(sfactor, dfactor); |
| return error::kNoError; |
| } |
| @@ -99,6 +191,7 @@ error::Error GLES2DecoderPassthroughImpl::DoBlendFuncSeparate(GLenum srcRGB, |
| GLenum dstRGB, |
| GLenum srcAlpha, |
| GLenum dstAlpha) { |
| + glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| return error::kNoError; |
| } |
| @@ -106,6 +199,7 @@ error::Error GLES2DecoderPassthroughImpl::DoBufferData(GLenum target, |
| GLsizeiptr size, |
| const void* data, |
| GLenum usage) { |
| + glBufferData(target, size, data, usage); |
| return error::kNoError; |
| } |
| @@ -113,16 +207,19 @@ error::Error GLES2DecoderPassthroughImpl::DoBufferSubData(GLenum target, |
| GLintptr offset, |
| GLsizeiptr size, |
| const void* data) { |
| + glBufferSubData(target, offset, size, data); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCheckFramebufferStatus( |
| GLenum target, |
| uint32_t* result) { |
| + *result = glCheckFramebufferStatusEXT(target); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoClear(GLbitfield mask) { |
| + glClear(mask); |
| return error::kNoError; |
| } |
| @@ -130,6 +227,7 @@ error::Error GLES2DecoderPassthroughImpl::DoClearBufferfi(GLenum buffer, |
| GLint drawbuffers, |
| GLfloat depth, |
| GLint stencil) { |
| + glClearBufferfi(buffer, drawbuffers, depth, stencil); |
| return error::kNoError; |
| } |
| @@ -137,6 +235,7 @@ error::Error GLES2DecoderPassthroughImpl::DoClearBufferfv( |
| GLenum buffer, |
| GLint drawbuffers, |
| const volatile GLfloat* value) { |
| + glClearBufferfv(buffer, drawbuffers, const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -144,6 +243,7 @@ error::Error GLES2DecoderPassthroughImpl::DoClearBufferiv( |
| GLenum buffer, |
| GLint drawbuffers, |
| const volatile GLint* value) { |
| + glClearBufferiv(buffer, drawbuffers, const_cast<const GLint*>(value)); |
| return error::kNoError; |
| } |
| @@ -151,6 +251,7 @@ error::Error GLES2DecoderPassthroughImpl::DoClearBufferuiv( |
| GLenum buffer, |
| GLint drawbuffers, |
| const volatile GLuint* value) { |
| + glClearBufferuiv(buffer, drawbuffers, const_cast<const GLuint*>(value)); |
| return error::kNoError; |
| } |
| @@ -158,14 +259,17 @@ error::Error GLES2DecoderPassthroughImpl::DoClearColor(GLclampf red, |
| GLclampf green, |
| GLclampf blue, |
| GLclampf alpha) { |
| + glClearColor(red, green, blue, alpha); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoClearDepthf(GLclampf depth) { |
| + glClearDepthf(depth); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoClearStencil(GLint s) { |
| + glClearStencil(s); |
| return error::kNoError; |
| } |
| @@ -173,6 +277,7 @@ error::Error GLES2DecoderPassthroughImpl::DoClientWaitSync(GLuint sync, |
| GLbitfield flags, |
| GLuint64 timeout, |
| GLenum* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
|
Zhenyao Mo
2016/09/09 21:22:11
Use NOTIMPLEMENTED() instead. here and all other p
Geoff Lang
2016/09/12 14:21:29
Done.
|
| return error::kNoError; |
| } |
| @@ -180,10 +285,12 @@ error::Error GLES2DecoderPassthroughImpl::DoColorMask(GLboolean red, |
| GLboolean green, |
| GLboolean blue, |
| GLboolean alpha) { |
| + glColorMask(red, green, blue, alpha); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCompileShader(GLuint shader) { |
| + glCompileShader(resources_->shader_id_map.GetServiceIDOrReserve(shader)); |
| return error::kNoError; |
| } |
| @@ -196,6 +303,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage2D( |
| GLint border, |
| GLsizei imageSize, |
| const void* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -209,6 +317,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage2D( |
| GLenum format, |
| GLsizei imageSize, |
| const void* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -222,6 +331,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCompressedTexImage3D( |
| GLint border, |
| GLsizei imageSize, |
| const void* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -237,6 +347,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCompressedTexSubImage3D( |
| GLenum format, |
| GLsizei imageSize, |
| const void* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -246,6 +357,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCopyBufferSubData( |
| GLintptr readoffset, |
| GLintptr writeoffset, |
| GLsizeiptr size) { |
| + glCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size); |
| return error::kNoError; |
| } |
| @@ -258,6 +370,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCopyTexImage2D( |
| GLsizei width, |
| GLsizei height, |
| GLint border) { |
| + glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); |
| return error::kNoError; |
| } |
| @@ -269,6 +382,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage2D(GLenum target, |
| GLint y, |
| GLsizei width, |
| GLsizei height) { |
| + glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
| return error::kNoError; |
| } |
| @@ -281,100 +395,149 @@ error::Error GLES2DecoderPassthroughImpl::DoCopyTexSubImage3D(GLenum target, |
| GLint y, |
| GLsizei width, |
| GLsizei height) { |
| + glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, |
| + height); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCreateProgram(GLuint client_id) { |
| - return error::kNoError; |
| + return CreateHelper(client_id, &resources_->program_id_map, |
| + []() { return glCreateProgram(); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCreateShader(GLenum type, |
| GLuint client_id) { |
| - return error::kNoError; |
| + return CreateHelper(client_id, &resources_->shader_id_map, |
| + [type]() { return glCreateShader(type); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCullFace(GLenum mode) { |
| + glCullFace(mode); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteBuffers( |
| GLsizei n, |
| const volatile GLuint* buffers) { |
| - return error::kNoError; |
| + return DeleteHelper( |
| + n, buffers, &resources_->buffer_id_map, |
| + [](GLsizei n, GLuint* buffers) { glDeleteBuffersARB(n, buffers); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteFramebuffers( |
| GLsizei n, |
| const volatile GLuint* framebuffers) { |
| - return error::kNoError; |
| + return DeleteHelper(n, framebuffers, &framebuffer_id_map_, |
| + [](GLsizei n, GLuint* framebuffers) { |
| + glDeleteFramebuffersEXT(n, framebuffers); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteProgram(GLuint program) { |
| - return error::kNoError; |
| + return DeleteHelper(program, &resources_->program_id_map, |
| + [](GLuint program) { glDeleteProgram(program); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteRenderbuffers( |
| GLsizei n, |
| const volatile GLuint* renderbuffers) { |
| - return error::kNoError; |
| + return DeleteHelper(n, renderbuffers, &resources_->renderbuffer_id_map, |
| + [](GLsizei n, GLuint* renderbuffers) { |
| + glDeleteRenderbuffersEXT(n, renderbuffers); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteSamplers( |
| GLsizei n, |
| const volatile GLuint* samplers) { |
| - return error::kNoError; |
| + return DeleteHelper( |
| + n, samplers, &resources_->sampler_id_map, |
| + [](GLsizei n, GLuint* samplers) { glDeleteSamplers(n, samplers); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteSync(GLuint sync) { |
| - return error::kNoError; |
| + return DeleteHelper(sync, &resources_->sync_id_map, [](uintptr_t sync) { |
| + glDeleteSync(reinterpret_cast<GLsync>(sync)); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteShader(GLuint shader) { |
| - return error::kNoError; |
| + return DeleteHelper(shader, &resources_->shader_id_map, |
| + [](GLuint shader) { glDeleteShader(shader); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteTextures( |
| GLsizei n, |
| const volatile GLuint* textures) { |
| - return error::kNoError; |
| + // Textures that are currently associated with a mailbox are stored in the |
| + // texture_object_map_ and are deleted automatically when they are |
| + // unreferenced. Only delete textures that are not in this map. |
| + std::vector<GLuint> non_mailbox_client_ids; |
| + for (GLsizei ii = 0; ii < n; ++ii) { |
| + GLuint client_id = textures[ii]; |
| + auto texture_object_iter = resources_->texture_object_map.find(client_id); |
| + if (texture_object_iter == resources_->texture_object_map.end()) { |
| + // Delete with DeleteHelper |
| + non_mailbox_client_ids.push_back(client_id); |
| + } else { |
| + // Deleted when unreferenced |
| + resources_->texture_id_map.RemoveClientID(client_id); |
| + resources_->texture_object_map.erase(client_id); |
| + } |
| + } |
| + return DeleteHelper( |
| + non_mailbox_client_ids.size(), non_mailbox_client_ids.data(), |
| + &resources_->texture_id_map, |
| + [](GLsizei n, GLuint* textures) { glDeleteTextures(n, textures); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteTransformFeedbacks( |
| GLsizei n, |
| const volatile GLuint* ids) { |
| - return error::kNoError; |
| + return DeleteHelper(n, ids, &transform_feedback_id_map_, |
| + [](GLsizei n, GLuint* transform_feedbacks) { |
| + glDeleteTransformFeedbacks(n, transform_feedbacks); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDepthFunc(GLenum func) { |
| + glDepthFunc(func); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDepthMask(GLboolean flag) { |
| + glDepthMask(flag); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDepthRangef(GLclampf zNear, |
| GLclampf zFar) { |
| + glDepthRangef(zNear, zFar); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDetachShader(GLuint program, |
| GLuint shader) { |
| + glDetachShader(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + resources_->shader_id_map.GetServiceIDOrReserve(shader)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDisable(GLenum cap) { |
| + glDisable(cap); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDisableVertexAttribArray( |
| GLuint index) { |
| + glDisableVertexAttribArray(index); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDrawArrays(GLenum mode, |
| GLint first, |
| GLsizei count) { |
| + glDrawArrays(mode, first, count); |
| return error::kNoError; |
| } |
| @@ -382,29 +545,35 @@ error::Error GLES2DecoderPassthroughImpl::DoDrawElements(GLenum mode, |
| GLsizei count, |
| GLenum type, |
| const void* indices) { |
| + glDrawElements(mode, count, type, indices); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoEnable(GLenum cap) { |
| + glEnable(cap); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoEnableVertexAttribArray( |
| GLuint index) { |
| + glEnableVertexAttribArray(index); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoFenceSync(GLenum condition, |
| GLbitfield flags, |
| GLuint client_id) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoFinish() { |
| + glFinish(); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoFlush() { |
| + glFlush(); |
| return error::kNoError; |
| } |
| @@ -413,6 +582,19 @@ error::Error GLES2DecoderPassthroughImpl::DoFramebufferRenderbuffer( |
| GLenum attachment, |
| GLenum renderbuffertarget, |
| GLuint renderbuffer) { |
| + // TODO: Handle this case in ANGLE by adding a WebGL validation mode. |
|
Zhenyao Mo
2016/09/09 21:22:11
change all TODO to TODO(geofflang)
Geoff Lang
2016/09/12 14:21:29
Done.
|
| + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { |
| + glFramebufferRenderbufferEXT( |
| + target, GL_DEPTH_ATTACHMENT, renderbuffertarget, |
| + resources_->renderbuffer_id_map.GetServiceIDOrReserve(renderbuffer)); |
| + glFramebufferRenderbufferEXT( |
| + target, GL_STENCIL_ATTACHMENT, renderbuffertarget, |
| + resources_->renderbuffer_id_map.GetServiceIDOrReserve(renderbuffer)); |
| + } else { |
| + glFramebufferRenderbufferEXT( |
| + target, attachment, renderbuffertarget, |
| + resources_->renderbuffer_id_map.GetServiceIDOrReserve(renderbuffer)); |
| + } |
| return error::kNoError; |
| } |
| @@ -422,6 +604,9 @@ error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2D( |
| GLenum textarget, |
| GLuint texture, |
| GLint level) { |
| + glFramebufferTexture2DEXT( |
| + target, attachment, textarget, |
| + resources_->texture_id_map.GetServiceIDOrReserve(texture), level); |
| return error::kNoError; |
| } |
| @@ -431,51 +616,71 @@ error::Error GLES2DecoderPassthroughImpl::DoFramebufferTextureLayer( |
| GLuint texture, |
| GLint level, |
| GLint layer) { |
| + glFramebufferTextureLayer( |
| + target, attachment, |
| + resources_->texture_id_map.GetServiceIDOrReserve(texture), level, layer); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoFrontFace(GLenum mode) { |
| + glFrontFace(mode); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenBuffers( |
| GLsizei n, |
| volatile GLuint* buffers) { |
| - return error::kNoError; |
| + return GenHelper( |
| + n, buffers, &resources_->buffer_id_map, |
| + [](GLsizei n, GLuint* buffers) { glGenBuffersARB(n, buffers); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenerateMipmap(GLenum target) { |
| + glGenerateMipmapEXT(target); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenFramebuffers( |
| GLsizei n, |
| volatile GLuint* framebuffers) { |
| - return error::kNoError; |
| + return GenHelper(n, framebuffers, &framebuffer_id_map_, |
| + [](GLsizei n, GLuint* framebuffers) { |
| + glGenFramebuffersEXT(n, framebuffers); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenRenderbuffers( |
| GLsizei n, |
| volatile GLuint* renderbuffers) { |
| - return error::kNoError; |
| + return GenHelper(n, renderbuffers, &resources_->renderbuffer_id_map, |
| + [](GLsizei n, GLuint* renderbuffers) { |
| + glGenRenderbuffersEXT(n, renderbuffers); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenSamplers( |
| GLsizei n, |
| volatile GLuint* samplers) { |
| - return error::kNoError; |
| + return GenHelper( |
| + n, samplers, &resources_->sampler_id_map, |
| + [](GLsizei n, GLuint* samplers) { glGenSamplers(n, samplers); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenTextures( |
| GLsizei n, |
| volatile GLuint* textures) { |
| - return error::kNoError; |
| + return GenHelper( |
| + n, textures, &resources_->texture_id_map, |
| + [](GLsizei n, GLuint* textures) { glGenTextures(n, textures); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenTransformFeedbacks( |
| GLsizei n, |
| volatile GLuint* ids) { |
| - return error::kNoError; |
| + return GenHelper(n, ids, &transform_feedback_id_map_, |
| + [](GLsizei n, GLuint* transform_feedbacks) { |
| + glGenTransformFeedbacks(n, transform_feedbacks); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetActiveAttrib(GLuint program, |
| @@ -483,6 +688,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetActiveAttrib(GLuint program, |
| GLint* size, |
| GLenum* type, |
| std::string* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -492,6 +698,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniform( |
| GLint* size, |
| GLenum* type, |
| std::string* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -502,6 +709,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockiv( |
| GLsizei bufSize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -509,6 +717,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformBlockName( |
| GLuint program, |
| GLuint index, |
| std::string* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -520,6 +729,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetActiveUniformsiv( |
| GLsizei bufSize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -528,12 +738,14 @@ error::Error GLES2DecoderPassthroughImpl::DoGetAttachedShaders( |
| GLsizei maxcount, |
| GLsizei* count, |
| GLuint* shaders) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetAttribLocation(GLuint program, |
| const char* name, |
| GLint* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -541,6 +753,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetBooleanv(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLboolean* params) { |
| + // TODO: new-style getter |
| + glGetBooleanv(pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -550,6 +765,11 @@ error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteri64v( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint64* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| + // TODO: new-style getter |
| + // TODO: missing glGetBufferParameteri64v? |
| + // glGetBufferParameteri64v(target, pname, params); |
|
Zhenyao Mo
2016/09/09 21:22:11
command buffer is 32bit, so unnecessary.
Geoff Lang
2016/09/12 14:21:29
Ok, I'll have to come back to this one, may requir
|
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -559,10 +779,14 @@ error::Error GLES2DecoderPassthroughImpl::DoGetBufferParameteriv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetBufferParameteriv(target, pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetError(uint32_t* result) { |
| + *result = glGetError(); |
| return error::kNoError; |
| } |
| @@ -570,6 +794,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetFloatv(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLfloat* params) { |
| + // TODO: new-style getter |
| + glGetFloatv(pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -577,6 +804,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetFragDataLocation( |
| GLuint program, |
| const char* name, |
| GLint* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -587,6 +815,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetFramebufferAttachmentParameteriv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -594,6 +825,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetInteger64v(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint64* params) { |
| + // TODO: new-style getter |
| + glGetInteger64v(pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -602,6 +836,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetIntegeri_v(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* data) { |
| + // TODO: new-style getter |
| + glGetIntegeri_v(pname, index, data); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -610,6 +847,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetInteger64i_v(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint64* data) { |
| + // TODO: new-style getter |
| + glGetInteger64i_v(pname, index, data); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -617,6 +857,13 @@ error::Error GLES2DecoderPassthroughImpl::DoGetIntegerv(GLenum pname, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetIntegerv(pname, params); |
| + *length = 1; |
| + // HACK: WebGL initialization requires this query |
| + if (pname == GL_MAX_VIEWPORT_DIMS) { |
| + *length = 2; |
| + } |
| return error::kNoError; |
| } |
| @@ -626,6 +873,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetInternalformativ(GLenum target, |
| GLsizei bufSize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetInternalformativ(target, format, pname, bufSize, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -634,12 +884,24 @@ error::Error GLES2DecoderPassthroughImpl::DoGetProgramiv(GLuint program, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetProgramiv(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoLog( |
| GLuint program, |
| std::string* infolog) { |
| + GLint info_log_len = 0; |
| + glGetProgramiv(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + GL_INFO_LOG_LENGTH, &info_log_len); |
| + |
| + std::vector<char> buffer(info_log_len, 0); |
| + glGetProgramInfoLog(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + info_log_len, nullptr, buffer.data()); |
| + *infolog = std::string(buffer.data()); |
| return error::kNoError; |
| } |
| @@ -649,6 +911,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetRenderbufferParameteriv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -658,6 +921,10 @@ error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameterfv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLfloat* params) { |
| + // TODO: new-style getter |
| + glGetSamplerParameterfv( |
| + resources_->sampler_id_map.GetServiceIDOrReserve(sampler), pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -667,6 +934,10 @@ error::Error GLES2DecoderPassthroughImpl::DoGetSamplerParameteriv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| + // TODO: new-style getter |
| + // glGetRenderbufferParameterivEXT(target, pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -675,12 +946,22 @@ error::Error GLES2DecoderPassthroughImpl::DoGetShaderiv(GLuint shader, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetShaderiv(resources_->shader_id_map.GetServiceIDOrReserve(shader), pname, |
| + params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetShaderInfoLog( |
| GLuint shader, |
| std::string* infolog) { |
| + GLuint service_id = resources_->shader_id_map.GetServiceIDOrReserve(shader); |
| + GLint info_log_len = 0; |
| + glGetShaderiv(service_id, GL_INFO_LOG_LENGTH, &info_log_len); |
| + std::vector<char> buffer(info_log_len, 0); |
| + glGetShaderInfoLog(service_id, info_log_len, nullptr, buffer.data()); |
| + *infolog = std::string(buffer.data()); |
| return error::kNoError; |
| } |
| @@ -689,17 +970,21 @@ error::Error GLES2DecoderPassthroughImpl::DoGetShaderPrecisionFormat( |
| GLenum precisiontype, |
| GLint* range, |
| GLint* precision) { |
| + glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetShaderSource( |
| GLuint shader, |
| std::string* source) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetString(GLenum name, |
| const char** result) { |
| + // TODO: Append additional CHROMIUM extension strings? |
| + *result = reinterpret_cast<const char*>(glGetString(name)); |
| return error::kNoError; |
| } |
| @@ -708,6 +993,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetSynciv(GLuint sync, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* values) { |
| + glGetSynciv(reinterpret_cast<GLsync>( |
| + resources_->sync_id_map.GetServiceIDOrReserve(sync)), |
| + pname, bufsize, length, values); |
| return error::kNoError; |
| } |
| @@ -716,6 +1004,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetTexParameterfv(GLenum target, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLfloat* params) { |
| + // TODO: new-style getter |
| + glGetTexParameterfv(target, pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -724,6 +1015,9 @@ error::Error GLES2DecoderPassthroughImpl::DoGetTexParameteriv(GLenum target, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetTexParameteriv(target, pname, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -733,6 +1027,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVarying( |
| GLsizei* size, |
| GLenum* type, |
| std::string* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -740,6 +1035,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlockIndex( |
| GLuint program, |
| const char* name, |
| GLint* index) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -748,6 +1044,10 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformfv(GLuint program, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLfloat* params) { |
| + // TODO: new-style getter |
| + glGetUniformfv(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + location, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -756,6 +1056,10 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformiv(GLuint program, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + // TODO: new-style getter |
| + glGetUniformiv(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + location, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -764,6 +1068,10 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformuiv(GLuint program, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLuint* params) { |
| + // TODO: new-style getter |
| + glGetUniformuiv(resources_->program_id_map.GetServiceIDOrReserve(program), |
| + location, params); |
| + *length = 1; |
| return error::kNoError; |
| } |
| @@ -774,6 +1082,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformIndices( |
| GLsizei bufSize, |
| GLsizei* length, |
| GLuint* indices) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -781,6 +1090,8 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformLocation( |
| GLuint program, |
| const char* name, |
| GLint* location) { |
| + *location = glGetUniformLocation( |
| + resources_->program_id_map.GetServiceIDOrReserve(program), name); |
| return error::kNoError; |
| } |
| @@ -789,6 +1100,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribfv(GLuint index, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLfloat* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -797,6 +1109,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribiv(GLuint index, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -805,6 +1118,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIiv(GLuint index, |
| GLsizei bufsize, |
| GLsizei* length, |
| GLint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -814,6 +1128,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribIuiv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLuint* params) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -823,10 +1138,12 @@ error::Error GLES2DecoderPassthroughImpl::DoGetVertexAttribPointerv( |
| GLsizei bufsize, |
| GLsizei* length, |
| GLuint* pointer) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoHint(GLenum target, GLenum mode) { |
| + glHint(target, mode); |
| return error::kNoError; |
| } |
| @@ -834,6 +1151,8 @@ error::Error GLES2DecoderPassthroughImpl::DoInvalidateFramebuffer( |
| GLenum target, |
| GLsizei count, |
| const volatile GLenum* attachments) { |
| + std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| + glInvalidateFramebuffer(target, count, attachments_copy.data()); |
| return error::kNoError; |
| } |
| @@ -845,83 +1164,111 @@ error::Error GLES2DecoderPassthroughImpl::DoInvalidateSubFramebuffer( |
| GLint y, |
| GLsizei width, |
| GLsizei height) { |
| + std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| + glInvalidateSubFramebuffer(target, count, attachments_copy.data(), x, y, |
| + width, height); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsBuffer(GLuint buffer, |
| uint32_t* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| + *result = glIsBuffer(resources_->buffer_id_map.GetServiceIDOrReserve(buffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsEnabled(GLenum cap, |
| uint32_t* result) { |
| + *result = glIsEnabled(cap); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsFramebuffer(GLuint framebuffer, |
| uint32_t* result) { |
| + *result = glIsFramebufferEXT( |
| + framebuffer_id_map_.GetServiceIDOrReserve(framebuffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsProgram(GLuint program, |
| uint32_t* result) { |
| + *result = |
| + glIsProgram(resources_->program_id_map.GetServiceIDOrReserve(program)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsRenderbuffer(GLuint renderbuffer, |
| uint32_t* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| + *result = glIsRenderbufferEXT( |
| + resources_->buffer_id_map.GetServiceIDOrReserve(renderbuffer)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsSampler(GLuint sampler, |
| uint32_t* result) { |
| + *result = |
| + glIsSampler(resources_->sampler_id_map.GetServiceIDOrReserve(sampler)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsShader(GLuint shader, |
| uint32_t* result) { |
| + *result = glIsShader(resources_->shader_id_map.GetServiceIDOrReserve(shader)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsSync(GLuint sync, |
| uint32_t* result) { |
| + *result = glIsSync(reinterpret_cast<GLsync>( |
| + resources_->sync_id_map.GetServiceIDOrReserve(sync))); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsTexture(GLuint texture, |
| uint32_t* result) { |
| + *result = |
| + glIsTexture(resources_->texture_id_map.GetServiceIDOrReserve(texture)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsTransformFeedback( |
| GLuint transformfeedback, |
| uint32_t* result) { |
| + *result = glIsTransformFeedback( |
| + transform_feedback_id_map_.GetServiceIDOrReserve(transformfeedback)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoLineWidth(GLfloat width) { |
| + glLineWidth(width); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoLinkProgram(GLuint program) { |
| + glLinkProgram(resources_->program_id_map.GetServiceIDOrReserve(program)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoPauseTransformFeedback() { |
| + glPauseTransformFeedback(); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoPixelStorei(GLenum pname, |
| GLint param) { |
| + glPixelStorei(pname, param); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoPolygonOffset(GLfloat factor, |
| GLfloat units) { |
| + glPolygonOffset(factor, units); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoReadBuffer(GLenum src) { |
| + glReadBuffer(src); |
| return error::kNoError; |
| } |
| @@ -934,10 +1281,33 @@ error::Error GLES2DecoderPassthroughImpl::DoReadPixels(GLint x, |
| GLsizei bufsize, |
| GLsizei* length, |
| void* pixels) { |
| + glReadPixels(x, y, width, height, format, type, pixels); |
| + |
| + // HACK: Calculate the length here without taking into account the unpack |
| + // parameters. |
| + // Move into an ANGLE extension. |
| + size_t componentCount = 4; |
| + switch (format) { |
| + case GL_RGBA: |
| + componentCount = 4; |
| + break; |
| + case GL_RGB: |
| + componentCount = 3; |
| + break; |
| + case GL_RG: |
| + componentCount = 2; |
| + break; |
| + case GL_RED: |
| + componentCount = 1; |
| + break; |
| + } |
| + *length = width * height * componentCount * 4; |
| + |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoReleaseShaderCompiler() { |
| + glReleaseShaderCompiler(); |
| return error::kNoError; |
| } |
| @@ -946,21 +1316,26 @@ error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorage( |
| GLenum internalformat, |
| GLsizei width, |
| GLsizei height) { |
| + glRenderbufferStorageEXT(target, internalformat, width, height); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoResumeTransformFeedback() { |
| + glResumeTransformFeedback(); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSampleCoverage(GLclampf value, |
| GLboolean invert) { |
| + glSampleCoverage(value, invert); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterf(GLuint sampler, |
| GLenum pname, |
| GLfloat param) { |
| + glSamplerParameterf(resources_->sampler_id_map.GetServiceIDOrReserve(sampler), |
| + pname, param); |
| return error::kNoError; |
| } |
| @@ -968,12 +1343,18 @@ error::Error GLES2DecoderPassthroughImpl::DoSamplerParameterfv( |
| GLuint sampler, |
| GLenum pname, |
| const volatile GLfloat* params) { |
| + // TODO: new-style setter, needs to make only one copy |
| + glSamplerParameterfv( |
| + resources_->sampler_id_map.GetServiceIDOrReserve(sampler), pname, |
| + const_cast<const GLfloat*>(params)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteri(GLuint sampler, |
| GLenum pname, |
| GLint param) { |
| + glSamplerParameteri(resources_->sampler_id_map.GetServiceIDOrReserve(sampler), |
| + pname, param); |
| return error::kNoError; |
| } |
| @@ -981,6 +1362,10 @@ error::Error GLES2DecoderPassthroughImpl::DoSamplerParameteriv( |
| GLuint sampler, |
| GLenum pname, |
| const volatile GLint* params) { |
| + // TODO: new-style setter, needs to make only one copy |
| + glSamplerParameteriv( |
| + resources_->sampler_id_map.GetServiceIDOrReserve(sampler), pname, |
| + const_cast<const GLint*>(params)); |
| return error::kNoError; |
| } |
| @@ -997,6 +1382,7 @@ error::Error GLES2DecoderPassthroughImpl::DoShaderBinary(GLsizei n, |
| GLenum binaryformat, |
| const void* binary, |
| GLsizei length) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1004,12 +1390,15 @@ error::Error GLES2DecoderPassthroughImpl::DoShaderSource(GLuint shader, |
| GLsizei count, |
| const char** string, |
| const GLint* length) { |
| + glShaderSource(resources_->shader_id_map.GetServiceIDOrReserve(shader), count, |
| + string, length); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoStencilFunc(GLenum func, |
| GLint ref, |
| GLuint mask) { |
| + glStencilFunc(func, ref, mask); |
| return error::kNoError; |
| } |
| @@ -1017,21 +1406,25 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilFuncSeparate(GLenum face, |
| GLenum func, |
| GLint ref, |
| GLuint mask) { |
| + glStencilFuncSeparate(face, func, ref, mask); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoStencilMask(GLuint mask) { |
| + glStencilMask(mask); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoStencilMaskSeparate(GLenum face, |
| GLuint mask) { |
| + glStencilMaskSeparate(face, mask); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoStencilOp(GLenum fail, |
| GLenum zfail, |
| GLenum zpass) { |
| + glStencilOp(fail, zfail, zpass); |
| return error::kNoError; |
| } |
| @@ -1039,6 +1432,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilOpSeparate(GLenum face, |
| GLenum fail, |
| GLenum zfail, |
| GLenum zpass) { |
| + glStencilOpSeparate(face, fail, zfail, zpass); |
| return error::kNoError; |
| } |
| @@ -1052,6 +1446,9 @@ error::Error GLES2DecoderPassthroughImpl::DoTexImage2D(GLenum target, |
| GLenum type, |
| GLsizei imagesize, |
| const void* pixels) { |
| + // TODO: validate using imagesize |
| + glTexImage2D(target, level, internalformat, width, height, border, format, |
| + type, pixels); |
| return error::kNoError; |
| } |
| @@ -1066,12 +1463,16 @@ error::Error GLES2DecoderPassthroughImpl::DoTexImage3D(GLenum target, |
| GLenum type, |
| GLsizei imagesize, |
| const void* pixels) { |
| + // TODO: validate using imagesize |
| + glTexImage3D(target, level, internalformat, width, height, depth, border, |
| + format, type, pixels); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoTexParameterf(GLenum target, |
| GLenum pname, |
| GLfloat param) { |
| + glTexParameterf(target, pname, param); |
| return error::kNoError; |
| } |
| @@ -1079,6 +1480,8 @@ error::Error GLES2DecoderPassthroughImpl::DoTexParameterfv( |
| GLenum target, |
| GLenum pname, |
| const volatile GLfloat* params) { |
| + // TODO: new-style setter, needs to make only one copy |
| + glTexParameterfv(target, pname, const_cast<const GLfloat*>(params)); |
| return error::kNoError; |
| } |
| @@ -1093,6 +1496,8 @@ error::Error GLES2DecoderPassthroughImpl::DoTexParameteriv( |
| GLenum target, |
| GLenum pname, |
| const volatile GLint* params) { |
| + // TODO: new-style setter, needs to make only one copy |
| + glTexParameteriv(target, pname, const_cast<const GLint*>(params)); |
| return error::kNoError; |
| } |
| @@ -1102,6 +1507,7 @@ error::Error GLES2DecoderPassthroughImpl::DoTexStorage3D(GLenum target, |
| GLsizei width, |
| GLsizei height, |
| GLsizei depth) { |
| + glTexStorage3D(target, levels, internalFormat, width, height, depth); |
| return error::kNoError; |
| } |
| @@ -1115,6 +1521,9 @@ error::Error GLES2DecoderPassthroughImpl::DoTexSubImage2D(GLenum target, |
| GLenum type, |
| GLsizei imagesize, |
| const void* pixels) { |
| + // TODO: validate using imagesize |
| + glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, |
| + pixels); |
| return error::kNoError; |
| } |
| @@ -1130,6 +1539,9 @@ error::Error GLES2DecoderPassthroughImpl::DoTexSubImage3D(GLenum target, |
| GLenum type, |
| GLsizei imagesize, |
| const void* pixels) { |
| + // TODO: validate using imagesize |
| + glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, |
| + depth, format, type, pixels); |
| return error::kNoError; |
| } |
| @@ -1138,11 +1550,15 @@ error::Error GLES2DecoderPassthroughImpl::DoTransformFeedbackVaryings( |
| GLsizei count, |
| const char** varyings, |
| GLenum buffermode) { |
| + glTransformFeedbackVaryings( |
| + resources_->program_id_map.GetServiceIDOrReserve(program), count, |
| + varyings, buffermode); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform1f(GLint location, |
| GLfloat x) { |
| + glUniform1f(location, x); |
| return error::kNoError; |
| } |
| @@ -1150,10 +1566,12 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform1fv( |
| GLint location, |
| GLsizei count, |
| const volatile GLfloat* v) { |
| + glUniform1fv(location, count, const_cast<const GLfloat*>(v)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform1i(GLint location, GLint x) { |
| + glUniform1i(location, x); |
| return error::kNoError; |
| } |
| @@ -1161,11 +1579,13 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform1iv( |
| GLint location, |
| GLsizei count, |
| const volatile GLint* v) { |
| + glUniform1iv(location, count, const_cast<const GLint*>(v)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform1ui(GLint location, |
| GLuint x) { |
| + glUniform1ui(location, x); |
| return error::kNoError; |
| } |
| @@ -1173,12 +1593,14 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform1uiv( |
| GLint location, |
| GLsizei count, |
| const volatile GLuint* v) { |
| + glUniform1uiv(location, count, const_cast<const GLuint*>(v)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform2f(GLint location, |
| GLfloat x, |
| GLfloat y) { |
| + glUniform2f(location, x, y); |
| return error::kNoError; |
| } |
| @@ -1186,12 +1608,14 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform2fv( |
| GLint location, |
| GLsizei count, |
| const volatile GLfloat* v) { |
| + glUniform2fv(location, count, const_cast<const GLfloat*>(v)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform2i(GLint location, |
| GLint x, |
| GLint y) { |
| + glUniform2i(location, x, y); |
| return error::kNoError; |
| } |
| @@ -1199,12 +1623,14 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform2iv( |
| GLint location, |
| GLsizei count, |
| const volatile GLint* v) { |
| + glUniform2iv(location, count, const_cast<const GLint*>(v)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUniform2ui(GLint location, |
| GLuint x, |
| GLuint y) { |
| + glUniform2ui(location, x, y); |
| return error::kNoError; |
| } |
| @@ -1212,6 +1638,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform2uiv( |
| GLint location, |
| GLsizei count, |
| const volatile GLuint* v) { |
| + glUniform2uiv(location, count, const_cast<const GLuint*>(v)); |
| return error::kNoError; |
| } |
| @@ -1219,6 +1646,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3f(GLint location, |
| GLfloat x, |
| GLfloat y, |
| GLfloat z) { |
| + glUniform3f(location, x, y, z); |
| return error::kNoError; |
| } |
| @@ -1226,6 +1654,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3fv( |
| GLint location, |
| GLsizei count, |
| const volatile GLfloat* v) { |
| + glUniform3fv(location, count, const_cast<const GLfloat*>(v)); |
| return error::kNoError; |
| } |
| @@ -1233,6 +1662,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3i(GLint location, |
| GLint x, |
| GLint y, |
| GLint z) { |
| + glUniform3i(location, x, y, z); |
| return error::kNoError; |
| } |
| @@ -1240,6 +1670,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3iv( |
| GLint location, |
| GLsizei count, |
| const volatile GLint* v) { |
| + glUniform3iv(location, count, const_cast<const GLint*>(v)); |
| return error::kNoError; |
| } |
| @@ -1247,6 +1678,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3ui(GLint location, |
| GLuint x, |
| GLuint y, |
| GLuint z) { |
| + glUniform3ui(location, x, y, z); |
| return error::kNoError; |
| } |
| @@ -1254,6 +1686,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform3uiv( |
| GLint location, |
| GLsizei count, |
| const volatile GLuint* v) { |
| + glUniform3uiv(location, count, const_cast<const GLuint*>(v)); |
| return error::kNoError; |
| } |
| @@ -1262,6 +1695,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4f(GLint location, |
| GLfloat y, |
| GLfloat z, |
| GLfloat w) { |
| + glUniform4f(location, x, y, z, w); |
| return error::kNoError; |
| } |
| @@ -1269,6 +1703,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4fv( |
| GLint location, |
| GLsizei count, |
| const volatile GLfloat* v) { |
| + glUniform4fv(location, count, const_cast<const GLfloat*>(v)); |
| return error::kNoError; |
| } |
| @@ -1277,6 +1712,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4i(GLint location, |
| GLint y, |
| GLint z, |
| GLint w) { |
| + glUniform4i(location, x, y, z, w); |
| return error::kNoError; |
| } |
| @@ -1284,6 +1720,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4iv( |
| GLint location, |
| GLsizei count, |
| const volatile GLint* v) { |
| + glUniform4iv(location, count, const_cast<const GLint*>(v)); |
| return error::kNoError; |
| } |
| @@ -1292,6 +1729,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4ui(GLint location, |
| GLuint y, |
| GLuint z, |
| GLuint w) { |
| + glUniform4ui(location, x, y, z, w); |
| return error::kNoError; |
| } |
| @@ -1299,6 +1737,7 @@ error::Error GLES2DecoderPassthroughImpl::DoUniform4uiv( |
| GLint location, |
| GLsizei count, |
| const volatile GLuint* v) { |
| + glUniform4uiv(location, count, const_cast<const GLuint*>(v)); |
| return error::kNoError; |
| } |
| @@ -1306,6 +1745,9 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformBlockBinding( |
| GLuint program, |
| GLuint index, |
| GLuint binding) { |
| + glUniformBlockBinding( |
| + resources_->program_id_map.GetServiceIDOrReserve(program), index, |
| + binding); |
| return error::kNoError; |
| } |
| @@ -1314,6 +1756,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix2fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1322,6 +1766,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x3fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix2x3fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1330,6 +1776,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix2x4fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix2x4fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1338,6 +1786,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix3fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1346,6 +1796,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x2fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix3x2fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1354,6 +1806,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix3x4fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix3x4fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1362,6 +1816,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix4fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1370,6 +1826,8 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x2fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix4x2fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| @@ -1378,37 +1836,45 @@ error::Error GLES2DecoderPassthroughImpl::DoUniformMatrix4x3fv( |
| GLsizei count, |
| GLboolean transpose, |
| const volatile GLfloat* value) { |
| + glUniformMatrix4x3fv(location, count, transpose, |
| + const_cast<const GLfloat*>(value)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUseProgram(GLuint program) { |
| + glUseProgram(resources_->program_id_map.GetServiceIDOrReserve(program)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoValidateProgram(GLuint program) { |
| + glValidateProgram(resources_->program_id_map.GetServiceIDOrReserve(program)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1f(GLuint indx, |
| GLfloat x) { |
| + glVertexAttrib1f(indx, x); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib1fv( |
| GLuint indx, |
| const volatile GLfloat* values) { |
| + glVertexAttrib1fv(indx, const_cast<const GLfloat*>(values)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2f(GLuint indx, |
| GLfloat x, |
| GLfloat y) { |
| + glVertexAttrib2f(indx, x, y); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib2fv( |
| GLuint indx, |
| const volatile GLfloat* values) { |
| + glVertexAttrib2fv(indx, const_cast<const GLfloat*>(values)); |
| return error::kNoError; |
| } |
| @@ -1416,12 +1882,14 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3f(GLuint indx, |
| GLfloat x, |
| GLfloat y, |
| GLfloat z) { |
| + glVertexAttrib3f(indx, x, y, z); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib3fv( |
| GLuint indx, |
| const volatile GLfloat* values) { |
| + glVertexAttrib3fv(indx, const_cast<const GLfloat*>(values)); |
| return error::kNoError; |
| } |
| @@ -1430,12 +1898,14 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4f(GLuint indx, |
| GLfloat y, |
| GLfloat z, |
| GLfloat w) { |
| + glVertexAttrib4f(indx, x, y, z, w); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttrib4fv( |
| GLuint indx, |
| const volatile GLfloat* values) { |
| + glVertexAttrib4fv(indx, const_cast<const GLfloat*>(values)); |
| return error::kNoError; |
| } |
| @@ -1444,12 +1914,14 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4i(GLuint indx, |
| GLint y, |
| GLint z, |
| GLint w) { |
| + glVertexAttribI4i(indx, x, y, z, w); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4iv( |
| GLuint indx, |
| const volatile GLint* values) { |
| + glVertexAttribI4iv(indx, const_cast<const GLint*>(values)); |
| return error::kNoError; |
| } |
| @@ -1458,12 +1930,14 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4ui(GLuint indx, |
| GLuint y, |
| GLuint z, |
| GLuint w) { |
| + glVertexAttribI4ui(indx, x, y, z, w); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttribI4uiv( |
| GLuint indx, |
| const volatile GLuint* values) { |
| + glVertexAttribI4uiv(indx, const_cast<const GLuint*>(values)); |
| return error::kNoError; |
| } |
| @@ -1473,6 +1947,7 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttribIPointer( |
| GLenum type, |
| GLsizei stride, |
| const void* ptr) { |
| + glVertexAttribIPointer(indx, size, type, stride, ptr); |
| return error::kNoError; |
| } |
| @@ -1483,6 +1958,7 @@ error::Error GLES2DecoderPassthroughImpl::DoVertexAttribPointer( |
| GLboolean normalized, |
| GLsizei stride, |
| const void* ptr) { |
| + glVertexAttribPointer(indx, size, type, normalized, stride, ptr); |
| return error::kNoError; |
| } |
| @@ -1490,12 +1966,14 @@ error::Error GLES2DecoderPassthroughImpl::DoViewport(GLint x, |
| GLint y, |
| GLsizei width, |
| GLsizei height) { |
| + glViewport(x, y, width, height); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoWaitSync(GLuint sync, |
| GLbitfield flags, |
| GLuint64 timeout) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1510,6 +1988,8 @@ error::Error GLES2DecoderPassthroughImpl::DoBlitFramebufferCHROMIUM( |
| GLint dstY1, |
| GLbitfield mask, |
| GLenum filter) { |
| + glBlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, |
| + mask, filter); |
| return error::kNoError; |
| } |
| @@ -1520,6 +2000,8 @@ GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleCHROMIUM( |
| GLenum internalformat, |
| GLsizei width, |
| GLsizei height) { |
| + glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, |
| + height); |
| return error::kNoError; |
| } |
| @@ -1529,6 +2011,8 @@ error::Error GLES2DecoderPassthroughImpl::DoRenderbufferStorageMultisampleEXT( |
| GLenum internalformat, |
| GLsizei width, |
| GLsizei height) { |
| + glRenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, |
| + height); |
| return error::kNoError; |
| } |
| @@ -1539,6 +2023,7 @@ error::Error GLES2DecoderPassthroughImpl::DoFramebufferTexture2DMultisampleEXT( |
| GLuint texture, |
| GLint level, |
| GLsizei samples) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1555,81 +2040,108 @@ error::Error GLES2DecoderPassthroughImpl::DoTexStorage2DEXT( |
| error::Error GLES2DecoderPassthroughImpl::DoGenQueriesEXT( |
| GLsizei n, |
| volatile GLuint* queries) { |
| - return error::kNoError; |
| + return GenHelper(n, queries, &query_id_map_, [](GLsizei n, GLuint* queries) { |
| + glGenQueries(n, queries); |
| + }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteQueriesEXT( |
| GLsizei n, |
| const volatile GLuint* queries) { |
| - return error::kNoError; |
| + return DeleteHelper( |
| + n, queries, &query_id_map_, |
| + [](GLsizei n, GLuint* queries) { glDeleteQueries(n, queries); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoQueryCounterEXT(GLuint id, |
| GLenum target) { |
| + glQueryCounter(query_id_map_.GetServiceIDOrReserve(id), target); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBeginQueryEXT(GLenum target, |
| GLuint id) { |
| + // TODO: Track active queries |
| + glBeginQuery(target, query_id_map_.GetServiceIDOrReserve(id)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBeginTransformFeedback( |
| GLenum primitivemode) { |
| + glBeginTransformFeedback(primitivemode); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoEndQueryEXT(GLenum target) { |
| + // TODO: Track active queries |
| + glEndQuery(target); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoEndTransformFeedback() { |
| + glEndTransformFeedback(); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSetDisjointValueSyncCHROMIUM( |
| DisjointValueSync* sync) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoInsertEventMarkerEXT( |
| GLsizei length, |
| const char* marker) { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoPushGroupMarkerEXT( |
| GLsizei length, |
| const char* marker) { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoPopGroupMarkerEXT() { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenVertexArraysOES( |
| GLsizei n, |
| volatile GLuint* arrays) { |
| - return error::kNoError; |
| + return GenHelper( |
| + n, arrays, &vertex_array_id_map_, |
| + [](GLsizei n, GLuint* arrays) { glGenVertexArraysOES(n, arrays); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeleteVertexArraysOES( |
| GLsizei n, |
| const volatile GLuint* arrays) { |
| - return error::kNoError; |
| + return DeleteHelper( |
| + n, arrays, &vertex_array_id_map_, |
| + [](GLsizei n, GLuint* arrays) { glDeleteVertexArraysOES(n, arrays); }); |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsVertexArrayOES(GLuint array, |
| uint32_t* result) { |
| + *result = |
| + glIsVertexArrayOES(vertex_array_id_map_.GetServiceIDOrReserve(array)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindVertexArrayOES(GLuint array) { |
| + glBindVertexArrayOES(vertex_array_id_map_.GetServiceIDOrReserve(array)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSwapBuffers() { |
| + gfx::SwapResult result = surface_->SwapBuffers(); |
| + if (result == gfx::SwapResult::SWAP_FAILED) { |
| + LOG(ERROR) << "Context lost because SwapBuffers failed."; |
| + } |
| + // TODO: force the context loss? |
| return error::kNoError; |
| } |
| @@ -1639,11 +2151,13 @@ error::Error GLES2DecoderPassthroughImpl::DoGetMaxValueInBufferCHROMIUM( |
| GLenum type, |
| GLuint offset, |
| uint32_t* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoEnableFeatureCHROMIUM( |
| const char* feature) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1652,10 +2166,12 @@ error::Error GLES2DecoderPassthroughImpl::DoMapBufferRange(GLenum target, |
| GLsizeiptr size, |
| GLbitfield access, |
| void** ptr) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoUnmapBuffer(GLenum target) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1663,28 +2179,154 @@ error::Error GLES2DecoderPassthroughImpl::DoResizeCHROMIUM(GLuint width, |
| GLuint height, |
| GLfloat scale_factor, |
| GLboolean alpha) { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetRequestableExtensionsCHROMIUM( |
| const char** extensions) { |
| + *extensions = ""; |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoRequestExtensionCHROMIUM( |
| const char* extension) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| +namespace { |
| + |
| +template <typename T> |
| +void InsertValueIntoBuffer(std::vector<uint8_t>* data, |
| + const T& value, |
| + size_t offset) { |
| + DCHECK_LE(offset + sizeof(T), data->size()); |
| + memcpy(data->data() + offset, &value, sizeof(T)); |
| +} |
| + |
| +template <typename T> |
| +void AppendValueToBuffer(std::vector<uint8_t>* data, const T& value) { |
| + size_t old_size = data->size(); |
| + data->resize(old_size + sizeof(T)); |
| + memcpy(data->data() + old_size, &value, sizeof(T)); |
| +} |
| + |
| +void AppendStringToBuffer(std::vector<uint8_t>* data, |
| + const char* str, |
| + size_t len) { |
| + size_t old_size = data->size(); |
| + data->resize(old_size + len); |
| + memcpy(data->data() + old_size, str, len); |
| +} |
| + |
| +} // anonymous namespace |
|
Zhenyao Mo
2016/09/09 21:22:10
Can we move this to the top of the file?
Geoff Lang
2016/09/12 14:21:29
Done.
|
| + |
| error::Error GLES2DecoderPassthroughImpl::DoGetProgramInfoCHROMIUM( |
| GLuint program, |
| std::vector<uint8_t>* data) { |
| + GLuint service_program = |
| + resources_->program_id_map.GetServiceIDOrReserve(program); |
|
Zhenyao Mo
2016/09/09 21:22:11
We can't reserve a program id, can we? Should we u
Geoff Lang
2016/09/12 14:21:29
Done.
|
| + |
| + GLint num_attributes = 0; |
| + glGetProgramiv(service_program, GL_ACTIVE_ATTRIBUTES, &num_attributes); |
| + |
| + GLint num_uniforms = 0; |
| + glGetProgramiv(service_program, GL_ACTIVE_UNIFORMS, &num_uniforms); |
| + |
| + data->resize(sizeof(ProgramInfoHeader) + |
| + ((num_attributes + num_uniforms) * sizeof(ProgramInput)), |
| + 0); |
| + |
| + GLint link_status = 0; |
| + glGetProgramiv(service_program, GL_LINK_STATUS, &link_status); |
|
Zhenyao Mo
2016/09/09 21:22:11
Should we return early if link_status is 0?
Geoff Lang
2016/09/12 14:21:29
I think that it's safe to always do the queries.
Zhenyao Mo
2016/09/12 18:15:35
You are saying we will only call this function if
|
| + |
| + ProgramInfoHeader header; |
| + header.link_status = link_status; |
| + header.num_attribs = num_attributes; |
| + header.num_uniforms = num_uniforms; |
| + InsertValueIntoBuffer(data, header, 0); |
| + |
| + GLint active_attribute_max_length = 0; |
| + glGetProgramiv(service_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, |
| + &active_attribute_max_length); |
| + |
| + std::vector<char> attrib_name_buf(active_attribute_max_length, 0); |
| + for (GLint attrib_index = 0; attrib_index < num_attributes; attrib_index++) { |
| + GLsizei length = 0; |
| + GLint size = 0; |
| + GLenum type = GL_NONE; |
| + glGetActiveAttrib(service_program, attrib_index, attrib_name_buf.size(), |
| + &length, &size, &type, attrib_name_buf.data()); |
| + |
| + ProgramInput input; |
| + input.size = size; |
| + input.type = type; |
| + |
| + int32_t location = |
| + glGetAttribLocation(service_program, attrib_name_buf.data()); |
| + input.location_offset = data->size(); |
| + AppendValueToBuffer(data, location); |
| + |
| + input.name_offset = data->size(); |
| + input.name_length = length; |
| + AppendStringToBuffer(data, attrib_name_buf.data(), length); |
| + |
| + InsertValueIntoBuffer( |
| + data, input, |
| + sizeof(ProgramInfoHeader) + (attrib_index * sizeof(ProgramInput))); |
| + } |
| + |
| + GLint active_uniform_max_length = 0; |
| + glGetProgramiv(service_program, GL_ACTIVE_UNIFORM_MAX_LENGTH, |
| + &active_uniform_max_length); |
| + |
| + std::vector<char> uniform_name_buf(active_uniform_max_length, 0); |
| + for (GLint uniform_index = 0; uniform_index < num_uniforms; uniform_index++) { |
| + GLsizei length = 0; |
| + GLint size = 0; |
| + GLenum type = GL_NONE; |
| + glGetActiveUniform(service_program, uniform_index, uniform_name_buf.size(), |
| + &length, &size, &type, uniform_name_buf.data()); |
| + |
| + ProgramInput input; |
| + input.size = size; |
| + input.type = type; |
| + |
| + input.location_offset = data->size(); |
| + int32_t base_location = |
| + glGetUniformLocation(service_program, uniform_name_buf.data()); |
| + AppendValueToBuffer(data, base_location); |
| + |
| + GLSLArrayName parsed_service_name(uniform_name_buf.data()); |
| + if (size > 1 || parsed_service_name.IsArrayName()) { |
| + for (GLint location_index = 1; location_index < size; location_index++) { |
| + std::string array_element_name = parsed_service_name.base_name() + "[" + |
| + base::IntToString(location_index) + |
| + "]"; |
| + int32_t element_location = |
| + glGetUniformLocation(service_program, array_element_name.c_str()); |
| + AppendValueToBuffer(data, element_location); |
| + } |
| + } |
| + |
| + input.name_offset = data->size(); |
| + input.name_length = length; |
| + AppendStringToBuffer(data, uniform_name_buf.data(), length); |
| + |
| + InsertValueIntoBuffer(data, input, sizeof(ProgramInfoHeader) + |
| + ((num_attributes + uniform_index) * |
| + sizeof(ProgramInput))); |
| + } |
| + |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetUniformBlocksCHROMIUM( |
| GLuint program, |
| std::vector<uint8_t>* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1692,18 +2334,21 @@ error::Error |
| GLES2DecoderPassthroughImpl::DoGetTransformFeedbackVaryingsCHROMIUM( |
| GLuint program, |
| std::vector<uint8_t>* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetUniformsES3CHROMIUM( |
| GLuint program, |
| std::vector<uint8_t>* data) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGetTranslatedShaderSourceANGLE( |
| GLuint shader, |
| std::string* source) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1712,6 +2357,11 @@ error::Error GLES2DecoderPassthroughImpl::DoPostSubBufferCHROMIUM( |
| GLint y, |
| GLint width, |
| GLint height) { |
| + gfx::SwapResult result = surface_->PostSubBuffer(x, y, width, height); |
| + if (result == gfx::SwapResult::SWAP_FAILED) { |
| + LOG(ERROR) << "Context lost because PostSubBuffer failed."; |
| + } |
| + // TODO: force the context loss? |
| return error::kNoError; |
| } |
| @@ -1723,6 +2373,11 @@ error::Error GLES2DecoderPassthroughImpl::DoCopyTextureCHROMIUM( |
| GLboolean unpack_flip_y, |
| GLboolean unpack_premultiply_alpha, |
| GLboolean unpack_unmultiply_alpha) { |
| + glCopyTextureCHROMIUM( |
| + resources_->texture_id_map.GetServiceIDOrReserve(source_id), |
| + resources_->texture_id_map.GetServiceIDOrReserve(dest_id), internalformat, |
| + dest_type, unpack_flip_y, unpack_premultiply_alpha, |
| + unpack_unmultiply_alpha); |
| return error::kNoError; |
| } |
| @@ -1738,12 +2393,20 @@ error::Error GLES2DecoderPassthroughImpl::DoCopySubTextureCHROMIUM( |
| GLboolean unpack_flip_y, |
| GLboolean unpack_premultiply_alpha, |
| GLboolean unpack_unmultiply_alpha) { |
| + glCopySubTextureCHROMIUM( |
| + resources_->texture_id_map.GetServiceIDOrReserve(source_id), |
| + resources_->texture_id_map.GetServiceIDOrReserve(dest_id), xoffset, |
| + yoffset, x, y, width, height, unpack_flip_y, unpack_premultiply_alpha, |
| + unpack_unmultiply_alpha); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCompressedCopyTextureCHROMIUM( |
| GLenum source_id, |
| GLenum dest_id) { |
| + glCompressedCopyTextureCHROMIUM( |
| + resources_->texture_id_map.GetServiceIDOrReserve(source_id), |
| + resources_->texture_id_map.GetServiceIDOrReserve(dest_id)); |
| return error::kNoError; |
| } |
| @@ -1752,6 +2415,7 @@ error::Error GLES2DecoderPassthroughImpl::DoDrawArraysInstancedANGLE( |
| GLint first, |
| GLsizei count, |
| GLsizei primcount) { |
| + glDrawArraysInstancedANGLE(mode, first, count, primcount); |
| return error::kNoError; |
| } |
| @@ -1761,38 +2425,111 @@ error::Error GLES2DecoderPassthroughImpl::DoDrawElementsInstancedANGLE( |
| GLenum type, |
| const void* indices, |
| GLsizei primcount) { |
| + glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoVertexAttribDivisorANGLE( |
| GLuint index, |
| GLuint divisor) { |
| + glVertexAttribDivisorANGLE(index, divisor); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoProduceTextureCHROMIUM( |
| GLenum target, |
| const volatile GLbyte* mailbox) { |
| + // TODO: validation |
| + |
| + GLuint texture = bound_textures_[active_texture_unit_]; |
| + TexturePassthrough* texture_passthrough = nullptr; |
| + |
| + auto texture_object_iter = resources_->texture_object_map.find(texture); |
| + if (texture_object_iter != resources_->texture_object_map.end()) { |
| + texture_passthrough = texture_object_iter->second.get(); |
| + } else { |
| + GLuint service_id = |
| + resources_->texture_id_map.GetServiceIDOrReserve(texture); |
| + texture_passthrough = new TexturePassthrough(service_id); |
| + resources_->texture_object_map.insert( |
| + std::make_pair(texture, texture_passthrough)); |
| + } |
| + |
| + const Mailbox& mb = Mailbox::FromVolatile( |
| + *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| + mailbox_manager_->ProduceTexture(mb, texture_passthrough); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoProduceTextureDirectCHROMIUM( |
| - GLuint texture, |
| + GLuint texture_client_id, |
| GLenum target, |
| const volatile GLbyte* mailbox) { |
| + // TODO: validation |
| + |
| + TexturePassthrough* texture = nullptr; |
| + auto texture_object_iter = |
| + resources_->texture_object_map.find(texture_client_id); |
| + if (texture_object_iter != resources_->texture_object_map.end()) { |
| + texture = texture_object_iter->second.get(); |
| + } else { |
| + GLuint service_id = |
| + resources_->texture_id_map.GetServiceIDOrReserve(texture_client_id); |
| + texture = new TexturePassthrough(service_id); |
| + resources_->texture_object_map.insert( |
| + std::make_pair(texture_client_id, texture)); |
| + } |
| + |
| + const Mailbox& mb = Mailbox::FromVolatile( |
| + *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| + mailbox_manager_->ProduceTexture(mb, texture); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoConsumeTextureCHROMIUM( |
| GLenum target, |
| const volatile GLbyte* mailbox) { |
| + // TODO: validation |
| + |
| + const Mailbox& mb = Mailbox::FromVolatile( |
| + *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| + TexturePassthrough* texture = static_cast<TexturePassthrough*>( |
| + group_->mailbox_manager()->ConsumeTexture(mb)); |
| + if (texture == nullptr) { |
| + // TODO: error, missing mailbox |
| + return error::kNoError; |
| + } |
| + |
| + GLuint client_id = bound_textures_[active_texture_unit_]; |
| + resources_->texture_id_map.SetIDMapping(client_id, texture->service_id()); |
| + resources_->texture_object_map.erase(client_id); |
| + resources_->texture_object_map.insert(std::make_pair(client_id, texture)); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCreateAndConsumeTextureINTERNAL( |
| GLenum target, |
| - GLuint texture, |
| + GLuint texture_client_id, |
| const volatile GLbyte* mailbox) { |
| + // TODO: validation |
| + |
| + if (resources_->texture_id_map.GetServiceID(texture_client_id, nullptr)) { |
| + return error::kInvalidArguments; |
| + } |
| + const Mailbox& mb = Mailbox::FromVolatile( |
| + *reinterpret_cast<const volatile Mailbox*>(mailbox)); |
| + TexturePassthrough* texture = static_cast<TexturePassthrough*>( |
| + group_->mailbox_manager()->ConsumeTexture(mb)); |
| + if (texture == nullptr) { |
| + // TODO: error, missing mailbox |
| + return error::kNoError; |
| + } |
| + |
| + resources_->texture_id_map.SetIDMapping(texture_client_id, |
| + texture->service_id()); |
| + resources_->texture_object_map.erase(texture_client_id); |
| + resources_->texture_object_map.insert( |
| + std::make_pair(texture_client_id, texture)); |
| return error::kNoError; |
| } |
| @@ -1800,28 +2537,41 @@ error::Error GLES2DecoderPassthroughImpl::DoBindUniformLocationCHROMIUM( |
| GLuint program, |
| GLint location, |
| const char* name) { |
| + glBindUniformLocationCHROMIUM( |
| + resources_->program_id_map.GetServiceIDOrReserve(program), location, |
| + name); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBindTexImage2DCHROMIUM( |
| GLenum target, |
| GLint imageId) { |
| + // TODO: error handling |
| + gl::GLImage* image = image_manager_->LookupImage(imageId); |
| + if (!image->BindTexImage(target)) { |
| + image->CopyTexImage(target); |
| + } |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoReleaseTexImage2DCHROMIUM( |
| GLenum target, |
| GLint imageId) { |
| + // TODO: error handling |
| + gl::GLImage* image = image_manager_->LookupImage(imageId); |
| + image->ReleaseTexImage(target); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoTraceBeginCHROMIUM( |
| const char* category_name, |
| const char* trace_name) { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoTraceEndCHROMIUM() { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1829,20 +2579,26 @@ error::Error GLES2DecoderPassthroughImpl::DoDiscardFramebufferEXT( |
| GLenum target, |
| GLsizei count, |
| const volatile GLenum* attachments) { |
| + std::vector<GLenum> attachments_copy(attachments, attachments + count); |
| + glDiscardFramebufferEXT(target, count, attachments_copy.data()); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoLoseContextCHROMIUM(GLenum current, |
| GLenum other) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDescheduleUntilFinishedCHROMIUM() { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoInsertFenceSyncCHROMIUM( |
| GLuint64 release_count) { |
| + if (!fence_sync_release_callback_.is_null()) |
| + fence_sync_release_callback_.Run(release_count); |
| return error::kNoError; |
| } |
| @@ -1850,16 +2606,25 @@ error::Error GLES2DecoderPassthroughImpl::DoWaitSyncTokenCHROMIUM( |
| CommandBufferNamespace namespace_id, |
| CommandBufferId command_buffer_id, |
| GLuint64 release_count) { |
| - return error::kNoError; |
| + if (wait_fence_sync_callback_.is_null()) { |
| + return error::kNoError; |
| + } |
| + return wait_fence_sync_callback_.Run(namespace_id, command_buffer_id, |
| + release_count) |
| + ? error::kNoError |
| + : error::kDeferCommandUntilLater; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDrawBuffersEXT( |
| GLsizei count, |
| const volatile GLenum* bufs) { |
| + std::vector<GLenum> bufs_copy(bufs, bufs + count); |
| + glDrawBuffersARB(count, bufs_copy.data()); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDiscardBackbufferCHROMIUM() { |
| + // CHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1875,6 +2640,7 @@ error::Error GLES2DecoderPassthroughImpl::DoScheduleOverlayPlaneCHROMIUM( |
| GLfloat uv_y, |
| GLfloat uv_width, |
| GLfloat uv_height) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1884,6 +2650,7 @@ error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerSharedStateCHROMIUM( |
| const GLfloat* clip_rect, |
| GLint sorting_context_id, |
| const GLfloat* transform) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1893,50 +2660,60 @@ error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerCHROMIUM( |
| GLuint background_color, |
| GLuint edge_aa_mask, |
| const GLfloat* bounds_rect) { |
| + CHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoScheduleCALayerInUseQueryCHROMIUM( |
| GLuint n, |
| const volatile GLuint* textures) { |
| + CHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCommitOverlayPlanesCHROMIUM() { |
| + CHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoSwapInterval(GLint interval) { |
| + context_->SetSwapInterval(interval); |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoFlushDriverCachesCHROMIUM() { |
| + // DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadfCHROMIUM( |
| GLenum matrixMode, |
| const volatile GLfloat* m) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoMatrixLoadIdentityCHROMIUM( |
| GLenum matrixMode) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoGenPathsCHROMIUM(GLuint path, |
| GLsizei range) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoDeletePathsCHROMIUM(GLuint path, |
| GLsizei range) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoIsPathCHROMIUM(GLuint path, |
| uint32_t* result) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1948,6 +2725,7 @@ error::Error GLES2DecoderPassthroughImpl::DoPathCommandsCHROMIUM( |
| GLenum coordType, |
| const GLvoid* coords, |
| GLsizei coords_bufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1955,6 +2733,7 @@ error::Error GLES2DecoderPassthroughImpl::DoPathParameterfCHROMIUM( |
| GLuint path, |
| GLenum pname, |
| GLfloat value) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1962,6 +2741,7 @@ error::Error GLES2DecoderPassthroughImpl::DoPathParameteriCHROMIUM( |
| GLuint path, |
| GLenum pname, |
| GLint value) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1969,6 +2749,7 @@ error::Error GLES2DecoderPassthroughImpl::DoPathStencilFuncCHROMIUM( |
| GLenum func, |
| GLint ref, |
| GLuint mask) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1976,6 +2757,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathCHROMIUM( |
| GLuint path, |
| GLenum fillMode, |
| GLuint mask) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -1983,18 +2765,21 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathCHROMIUM( |
| GLuint path, |
| GLint reference, |
| GLuint mask) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathCHROMIUM( |
| GLuint path, |
| GLenum coverMode) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathCHROMIUM( |
| GLuint path, |
| GLenum coverMode) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2003,6 +2788,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathCHROMIUM( |
| GLenum fillMode, |
| GLuint mask, |
| GLenum coverMode) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2011,6 +2797,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathCHROMIUM( |
| GLint reference, |
| GLuint mask, |
| GLenum coverMode) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2025,6 +2812,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilFillPathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2039,6 +2827,7 @@ error::Error GLES2DecoderPassthroughImpl::DoStencilStrokePathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2052,6 +2841,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCoverFillPathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2065,6 +2855,7 @@ error::Error GLES2DecoderPassthroughImpl::DoCoverStrokePathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2081,6 +2872,7 @@ GLES2DecoderPassthroughImpl::DoStencilThenCoverFillPathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2097,6 +2889,7 @@ GLES2DecoderPassthroughImpl::DoStencilThenCoverStrokePathInstancedCHROMIUM( |
| GLenum transformType, |
| const GLfloat* transformValues, |
| GLsizei transformValuesBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2104,6 +2897,7 @@ error::Error GLES2DecoderPassthroughImpl::DoBindFragmentInputLocationCHROMIUM( |
| GLuint program, |
| GLint location, |
| const char* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2114,20 +2908,24 @@ error::Error GLES2DecoderPassthroughImpl::DoProgramPathFragmentInputGenCHROMIUM( |
| GLint components, |
| const GLfloat* coeffs, |
| GLsizei coeffsBufsize) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoCoverageModulationCHROMIUM( |
| GLenum components) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error GLES2DecoderPassthroughImpl::DoBlendBarrierKHR() { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| error::Error |
| GLES2DecoderPassthroughImpl::DoApplyScreenSpaceAntialiasingCHROMIUM() { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2136,6 +2934,7 @@ error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationIndexedEXT( |
| GLuint colorNumber, |
| GLuint index, |
| const char* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2143,6 +2942,7 @@ error::Error GLES2DecoderPassthroughImpl::DoBindFragDataLocationEXT( |
| GLuint program, |
| GLuint colorNumber, |
| const char* name) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2150,6 +2950,7 @@ error::Error GLES2DecoderPassthroughImpl::DoGetFragDataIndexEXT( |
| GLuint program, |
| const char* name, |
| GLint* index) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |
| @@ -2158,6 +2959,7 @@ GLES2DecoderPassthroughImpl::DoUniformMatrix4fvStreamTextureMatrixCHROMIUM( |
| GLint location, |
| GLboolean transpose, |
| const volatile GLfloat* defaultValue) { |
| + DCHECK(false) << "UNIMPLEMENTED"; |
| return error::kNoError; |
| } |