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

Unified Diff: cc/layers/texture_layer.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 2 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: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index c9fb61b86a053b278e00d76eb04d32960a8dc3a2..e78707c29766167d3093deebf1bec5f0600abcc6 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -154,7 +154,9 @@ void TextureLayer::SetTextureMailbox(
mailbox, release_callback.Pass(), requires_commit, allow_mailbox_reuse);
}
-static void IgnoreReleaseCallback(uint32 sync_point, bool lost) {}
+static void IgnoreReleaseCallback(uint32 sync_point,
+ const gpu::SyncToken& sync_token,
+ bool lost) {}
void TextureLayer::SetTextureMailboxWithoutReleaseCallback(
const TextureMailbox& mailbox) {
@@ -163,7 +165,9 @@ void TextureLayer::SetTextureMailboxWithoutReleaseCallback(
// multiple times for the same mailbox.
DCHECK(!mailbox.IsValid() || !holder_ref_ ||
!mailbox.Equals(holder_ref_->holder()->mailbox()) ||
- mailbox.sync_point() != holder_ref_->holder()->mailbox().sync_point());
+ mailbox.sync_point() !=
+ holder_ref_->holder()->mailbox().sync_point() ||
+ mailbox.sync_token() != holder_ref_->holder()->mailbox().sync_token());
scoped_ptr<SingleReleaseCallback> release;
bool requires_commit = true;
bool allow_mailbox_reuse = true;
@@ -268,8 +272,8 @@ TextureLayer::TextureMailboxHolder::TextureMailboxHolder(
mailbox_(mailbox),
release_callback_(release_callback.Pass()),
sync_point_(mailbox.sync_point()),
- is_lost_(false) {
-}
+ sync_token_(mailbox.sync_token()),
+ is_lost_(false) {}
TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() {
DCHECK_EQ(0u, internal_references_);
@@ -283,10 +287,13 @@ TextureLayer::TextureMailboxHolder::Create(
new TextureMailboxHolder(mailbox, release_callback.Pass())));
}
-void TextureLayer::TextureMailboxHolder::Return(uint32 sync_point,
- bool is_lost) {
+void TextureLayer::TextureMailboxHolder::Return(
+ uint32 sync_point,
+ const gpu::SyncToken& sync_token,
+ bool is_lost) {
base::AutoLock lock(arguments_lock_);
sync_point_ = sync_point;
+ sync_token_ = sync_token;
is_lost_ = is_lost;
}
@@ -307,7 +314,7 @@ void TextureLayer::TextureMailboxHolder::InternalAddRef() {
void TextureLayer::TextureMailboxHolder::InternalRelease() {
DCHECK(main_thread_checker_.CalledOnValidThread());
if (!--internal_references_) {
- release_callback_->Run(sync_point_, is_lost_);
+ release_callback_->Run(sync_point_, sync_token_, is_lost_);
mailbox_ = TextureMailbox();
release_callback_ = nullptr;
}
@@ -315,9 +322,10 @@ void TextureLayer::TextureMailboxHolder::InternalRelease() {
void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread(
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
bool is_lost,
BlockingTaskRunner* main_thread_task_runner) {
- Return(sync_point, is_lost);
+ Return(sync_point, sync_token, is_lost);
main_thread_task_runner->PostTask(
FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this));
}

Powered by Google App Engine
This is Rietveld 408576698