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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2207253002: Unbind video texture from mailbox after copying to WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");
« no previous file with comments | « gpu/GLES2/extensions/CHROMIUM/CHROMIUM_texture_mailbox.txt ('k') | gpu/command_buffer/service/mailbox_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698