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

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

Issue 165393003: gpu: Generate mailboxes on client side (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 414ecc6adc5da22b004695dc2b8a9af3831d540e..ffa66ed346331407b83933eab49fcf9a51cc616c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -10005,10 +10005,15 @@ error::Error GLES2DecoderImpl::HandleGenMailboxCHROMIUM(
}
void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) {
+ const GLbyte* data) {
TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureCHROMIUM",
"context", logger_.GetLogPrefix(),
- "mailbox[0]", static_cast<unsigned char>(mailbox[0]));
+ "mailbox[0]", static_cast<unsigned char>(data[0]));
+
+ const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
+ DLOG_IF(ERROR, !mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a "
+ "mailbox that was not generated by "
+ "GenMailboxCHROMIUM.";
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
@@ -10027,17 +10032,18 @@ void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target,
return;
}
- group_->mailbox_manager()->ProduceTexture(
- target,
- *reinterpret_cast<const Mailbox*>(mailbox),
- produced);
+ group_->mailbox_manager()->ProduceTexture(target, mailbox, produced);
}
void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) {
+ const GLbyte* data) {
TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoConsumeTextureCHROMIUM",
"context", logger_.GetLogPrefix(),
- "mailbox[0]", static_cast<unsigned char>(mailbox[0]));
+ "mailbox[0]", static_cast<unsigned char>(data[0]));
+ const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
+ DLOG_IF(ERROR, !mailbox.Verify()) << "ConsumeTextureCHROMIUM was passed a "
+ "mailbox that was not generated by "
+ "GenMailboxCHROMIUM.";
scoped_refptr<TextureRef> texture_ref =
texture_manager()->GetTextureInfoForTargetUnlessDefault(&state_, target);
@@ -10054,10 +10060,7 @@ void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
"glConsumeTextureCHROMIUM", "unknown texture for target");
return;
}
- Texture* texture =
- group_->mailbox_manager()->ConsumeTexture(
- target,
- *reinterpret_cast<const Mailbox*>(mailbox));
+ Texture* texture = group_->mailbox_manager()->ConsumeTexture(target, mailbox);
if (!texture) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,

Powered by Google App Engine
This is Rietveld 408576698