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

Unified Diff: cc/layers/texture_layer.cc

Issue 1937173002: Revert of Pepper takes ownership of a mailbox before passing it to the texture layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index eab540ecb9743cb087a6e48ae2586e2c6b96a94f..b5b31732ac88dd356dd6974d448dd4135b6602a9 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -152,6 +152,26 @@
bool allow_mailbox_reuse = false;
SetTextureMailboxInternal(mailbox, std::move(release_callback),
requires_commit, allow_mailbox_reuse);
+}
+
+static void IgnoreReleaseCallback(const gpu::SyncToken& sync_token, bool lost) {
+}
+
+void TextureLayer::SetTextureMailboxWithoutReleaseCallback(
+ const TextureMailbox& mailbox) {
+ // We allow reuse of the mailbox if there is a new sync point signalling new
+ // content, and the release callback goes nowhere since we'll be calling it
+ // multiple times for the same mailbox.
+ DCHECK(!mailbox.IsValid() || !holder_ref_ ||
+ !mailbox.Equals(holder_ref_->holder()->mailbox()) ||
+ mailbox.sync_token() != holder_ref_->holder()->mailbox().sync_token());
+ std::unique_ptr<SingleReleaseCallback> release;
+ bool requires_commit = true;
+ bool allow_mailbox_reuse = true;
+ if (mailbox.IsValid())
+ release = SingleReleaseCallback::Create(base::Bind(&IgnoreReleaseCallback));
+ SetTextureMailboxInternal(mailbox, std::move(release), requires_commit,
+ allow_mailbox_reuse);
}
void TextureLayer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698