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 a72fcdcbf606d50b2c1eb825ea3f4fe0bba0d64c..ef59f3352492ed712f2c3b1211d0f986d2c85c0d 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -935,7 +935,14 @@ class GLES2DecoderImpl : public GLES2Decoder, |
GLsizei height); |
void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key); |
+ void DoProduceTextureBindlessCHROMIUM(GLuint texture, GLenum target, |
+ const GLbyte* key); |
+ void ProduceTextureRef(std::string func_name, TextureRef* texture_ref, |
+ GLenum target, const GLbyte* data); |
+ |
void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); |
+ void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, |
+ GLuint client_id); |
void DoBindTexImage2DCHROMIUM( |
GLenum target, |
@@ -10184,13 +10191,28 @@ void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target, |
"context", logger_.GetLogPrefix(), |
"mailbox[0]", static_cast<unsigned char>(data[0])); |
+ TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
+ &state_, target); |
+ ProduceTextureRef("ProduceTextureCHROMIUM", texture_ref, target, data); |
+} |
+ |
+void GLES2DecoderImpl::DoProduceTextureBindlessCHROMIUM(GLuint client_id, |
+ GLenum target, const GLbyte* data) { |
+ TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureBindlessCHROMIUM", |
+ "context", logger_.GetLogPrefix(), |
+ "mailbox[0]", static_cast<unsigned char>(data[0])); |
+ |
+ ProduceTextureRef("ProduceTextureBindlessCHROMIUM", GetTexture(client_id), |
+ target, data); |
+} |
+ |
+void GLES2DecoderImpl::ProduceTextureRef(std::string func_name, |
+ TextureRef* texture_ref, GLenum target, const GLbyte* data) { |
const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
- DLOG_IF(ERROR, !mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a " |
+ DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a " |
"mailbox that was not generated by " |
"GenMailboxCHROMIUM."; |
- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
- &state_, target); |
if (!texture_ref) { |
LOCAL_SET_GL_ERROR( |
GL_INVALID_OPERATION, |
@@ -10273,6 +10295,40 @@ void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target, |
} |
} |
+void GLES2DecoderImpl::DoCreateAndConsumeTextureCHROMIUM(GLenum target, |
+ const GLbyte* data, GLuint client_id) { |
+ TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoCreateAndConsumeTextureCHROMIUM", |
+ "context", logger_.GetLogPrefix(), |
+ "mailbox[0]", static_cast<unsigned char>(data[0])); |
+ const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
+ DLOG_IF(ERROR, !mailbox.Verify()) << "CreateAndConsumeTextureCHROMIUM was " |
+ "passed a mailbox that was not " |
+ "generated by GenMailboxCHROMIUM."; |
+ |
+ TextureRef* texture_ref = GetTexture(client_id); |
+ if (texture_ref) { |
+ LOCAL_SET_GL_ERROR( |
+ GL_INVALID_OPERATION, |
+ "glCreateAndConsumeTextureCHROMIUM", "client id already in use"); |
+ return; |
+ } |
+ Texture* texture = group_->mailbox_manager()->ConsumeTexture(target, mailbox); |
+ if (!texture) { |
+ LOCAL_SET_GL_ERROR( |
+ GL_INVALID_OPERATION, |
+ "glCreateAndConsumeTextureCHROMIUM", "invalid mailbox name"); |
+ return; |
+ } |
+ if (texture->target() != target) { |
+ LOCAL_SET_GL_ERROR( |
+ GL_INVALID_OPERATION, |
+ "glCreateAndConsumeTextureCHROMIUM", "invalid target"); |
+ return; |
+ } |
+ |
+ texture_ref = texture_manager()->Consume(client_id, texture); |
+} |
+ |
void GLES2DecoderImpl::DoInsertEventMarkerEXT( |
GLsizei length, const GLchar* marker) { |
if (!marker) { |