| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index dc009c82bfd34e95ce3297b6a083858d5db9cb86..490033208bdcf0a42bb1150dc065790efadd99f1 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -1070,6 +1070,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
|
| void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target,
|
| const GLbyte* key);
|
| void ProduceTextureRef(const char* func_name,
|
| + bool clear,
|
| TextureRef* texture_ref,
|
| GLenum target,
|
| const GLbyte* data);
|
| @@ -15812,7 +15813,8 @@ void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target,
|
|
|
| TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
|
| &state_, target);
|
| - ProduceTextureRef("glProduceTextureCHROMIUM", texture_ref, target, data);
|
| + ProduceTextureRef("glProduceTextureCHROMIUM", false, texture_ref, target,
|
| + data);
|
| }
|
|
|
| void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id,
|
| @@ -15821,11 +15823,12 @@ void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id,
|
| "context", logger_.GetLogPrefix(),
|
| "mailbox[0]", static_cast<unsigned char>(data[0]));
|
|
|
| - ProduceTextureRef("glProduceTextureDirectCHROMIUM", GetTexture(client_id),
|
| - target, data);
|
| + ProduceTextureRef("glProduceTextureDirectCHROMIUM", !client_id,
|
| + GetTexture(client_id), target, data);
|
| }
|
|
|
| void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
|
| + bool clear,
|
| TextureRef* texture_ref,
|
| GLenum target,
|
| const GLbyte* data) {
|
| @@ -15834,6 +15837,13 @@ void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
|
| "mailbox that was not generated by "
|
| "GenMailboxCHROMIUM.";
|
|
|
| + if (clear) {
|
| + DCHECK(!texture_ref);
|
| +
|
| + group_->mailbox_manager()->ProduceTexture(mailbox, nullptr);
|
| + return;
|
| + }
|
| +
|
| if (!texture_ref) {
|
| LOCAL_SET_GL_ERROR(
|
| GL_INVALID_OPERATION, func_name, "unknown texture for target");
|
|
|