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

Unified Diff: cc/output/texture_mailbox_deleter.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: Folded sync_point into sync_tokens 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/output/texture_mailbox_deleter.cc
diff --git a/cc/output/texture_mailbox_deleter.cc b/cc/output/texture_mailbox_deleter.cc
index 7729c4ec7a17b6dc200eafacd619edce65aa1ebb..642495fc063840b808d1cddc36616dcfa56b02b2 100644
--- a/cc/output/texture_mailbox_deleter.cc
+++ b/cc/output/texture_mailbox_deleter.cc
@@ -11,27 +11,30 @@
#include "cc/output/context_provider.h"
#include "cc/resources/single_release_callback.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/sync_token.h"
namespace cc {
static void DeleteTextureOnImplThread(
const scoped_refptr<ContextProvider>& context_provider,
unsigned texture_id,
- uint32 sync_point,
+ const gpu::SyncToken& sync_token,
bool is_lost) {
- if (sync_point)
- context_provider->ContextGL()->WaitSyncPointCHROMIUM(sync_point);
+ if (sync_token.HasData()) {
+ context_provider->ContextGL()->WaitSyncTokenCHROMIUM(
+ sync_token.GetConstData());
+ }
context_provider->ContextGL()->DeleteTextures(1, &texture_id);
}
static void PostTaskFromMainToImplThread(
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
ReleaseCallback run_impl_callback,
- unsigned sync_point,
+ const gpu::SyncToken& sync_token,
bool is_lost) {
// This posts the task to RunDeleteTextureOnImplThread().
impl_task_runner->PostTask(
- FROM_HERE, base::Bind(run_impl_callback, sync_point, is_lost));
+ FROM_HERE, base::Bind(run_impl_callback, sync_token, is_lost));
}
TextureMailboxDeleter::TextureMailboxDeleter(
@@ -40,7 +43,7 @@ TextureMailboxDeleter::TextureMailboxDeleter(
TextureMailboxDeleter::~TextureMailboxDeleter() {
for (size_t i = 0; i < impl_callbacks_.size(); ++i)
- impl_callbacks_.at(i)->Run(0, true);
+ impl_callbacks_.at(i)->Run(gpu::SyncToken(), true);
}
scoped_ptr<SingleReleaseCallback> TextureMailboxDeleter::GetReleaseCallback(
@@ -78,12 +81,12 @@ scoped_ptr<SingleReleaseCallback> TextureMailboxDeleter::GetReleaseCallback(
void TextureMailboxDeleter::RunDeleteTextureOnImplThread(
SingleReleaseCallback* impl_callback,
- unsigned sync_point,
+ const gpu::SyncToken& sync_token,
bool is_lost) {
for (size_t i = 0; i < impl_callbacks_.size(); ++i) {
if (impl_callbacks_.at(i) == impl_callback) {
// Run the callback, then destroy it here on the impl thread.
- impl_callbacks_.at(i)->Run(sync_point, is_lost);
+ impl_callbacks_.at(i)->Run(sync_token, is_lost);
impl_callbacks_.erase(impl_callbacks_.begin() + i);
return;
}

Powered by Google App Engine
This is Rietveld 408576698