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..66578d0f512f188309f983dcf0e4a606408d2a41 100644 |
--- a/cc/output/texture_mailbox_deleter.cc |
+++ b/cc/output/texture_mailbox_deleter.cc |
@@ -11,6 +11,7 @@ |
#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 { |
@@ -18,9 +19,12 @@ 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_point || sync_token.HasData()) { |
+ context_provider->ContextGL()->WaitSyncPointCHROMIUM( |
+ sync_point, sync_token.GetConstData()); |
+ } |
context_provider->ContextGL()->DeleteTextures(1, &texture_id); |
} |
@@ -28,10 +32,12 @@ 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_point, sync_token, is_lost)); |
} |
TextureMailboxDeleter::TextureMailboxDeleter( |
@@ -40,7 +46,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(0, gpu::SyncToken(), true); |
} |
scoped_ptr<SingleReleaseCallback> TextureMailboxDeleter::GetReleaseCallback( |
@@ -79,11 +85,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_point, sync_token, is_lost); |
impl_callbacks_.erase(impl_callbacks_.begin() + i); |
return; |
} |