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

Unified Diff: components/exo/buffer.cc

Issue 2627753003: exo: Fix use of invalid texture mailbox. (Closed)
Patch Set: make CopyTexImage consistent with BindTexImage Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/buffer.cc
diff --git a/components/exo/buffer.cc b/components/exo/buffer.cc
index c5c35b1a4761b27402b5aae69864d15007d411e3..3096c04f210248c4884d8d4c4fd6ef339a881d1c 100644
--- a/components/exo/buffer.cc
+++ b/components/exo/buffer.cc
@@ -464,9 +464,9 @@ bool Buffer::ProduceTransferableResource(
Texture* texture = contents_texture_.get();
// This binds the latest contents of this buffer to |texture|.
- resource->mailbox_holder = gpu::MailboxHolder(
- texture->mailbox(), texture->BindTexImage(), texture_target_);
-
+ gpu::SyncToken sync_token = texture->BindTexImage();
+ resource->mailbox_holder =
+ gpu::MailboxHolder(texture->mailbox(), sync_token, texture_target_);
resource->is_overlay_candidate = is_overlay_candidate_;
// The contents texture will be released when no longer used by the
@@ -491,12 +491,11 @@ bool Buffer::ProduceTransferableResource(
Texture* texture = texture_.get();
// The contents texture will be released when copy has completed.
- resource->mailbox_holder = gpu::MailboxHolder(
- texture->mailbox(),
- contents_texture->CopyTexImage(
- texture, base::Bind(&Buffer::ReleaseContentsTexture, AsWeakPtr(),
- base::Passed(&contents_texture_))),
- GL_TEXTURE_2D);
+ gpu::SyncToken sync_token = contents_texture->CopyTexImage(
+ texture, base::Bind(&Buffer::ReleaseContentsTexture, AsWeakPtr(),
+ base::Passed(&contents_texture_)));
+ resource->mailbox_holder =
+ gpu::MailboxHolder(texture->mailbox(), sync_token, GL_TEXTURE_2D);
resource->is_overlay_candidate = false;
// The mailbox texture will be released when no longer used by the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698