| Index: gpu/command_buffer/service/mailbox_manager_sync.cc
|
| diff --git a/gpu/command_buffer/service/mailbox_manager_sync.cc b/gpu/command_buffer/service/mailbox_manager_sync.cc
|
| index a9110de18faf265f5d0c9b6d7578b74dad5daf6d..d92d29f93ca5871530a49a7f611eb12cd2748f79 100644
|
| --- a/gpu/command_buffer/service/mailbox_manager_sync.cc
|
| +++ b/gpu/command_buffer/service/mailbox_manager_sync.cc
|
| @@ -195,6 +195,10 @@ bool MailboxManagerSync::UsesSync() {
|
|
|
| Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
|
| base::AutoLock lock(g_lock.Get());
|
| + // Relax the cross-thread access restriction to non-thread-safe RefCount.
|
| + // The lock above protects non-thread-safe RefCount in TextureGroup.
|
| + base::ScopedAllowCrossThreadRefCountAccess
|
| + scoped_allow_cross_thread_ref_count_access;
|
| TextureGroup* group = TextureGroup::FromName(mailbox);
|
| if (!group)
|
| return NULL;
|
| @@ -222,6 +226,10 @@ Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) {
|
| void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
|
| TextureBase* texture_base) {
|
| base::AutoLock lock(g_lock.Get());
|
| + // Relax the cross-thread access restriction to non-thread-safe RefCount.
|
| + // The lock above protects non-thread-safe RefCount in TextureGroup.
|
| + base::ScopedAllowCrossThreadRefCountAccess
|
| + scoped_allow_cross_thread_ref_count_access;
|
|
|
| Texture* texture = static_cast<Texture*>(texture_base);
|
| DCHECK(texture != nullptr);
|
| @@ -269,6 +277,10 @@ void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox,
|
|
|
| void MailboxManagerSync::TextureDeleted(TextureBase* texture_base) {
|
| base::AutoLock lock(g_lock.Get());
|
| + // Relax the cross-thread access restriction to non-thread-safe RefCount.
|
| + // The lock above protects non-thread-safe RefCount in TextureGroup.
|
| + base::ScopedAllowCrossThreadRefCountAccess
|
| + scoped_allow_cross_thread_ref_count_access;
|
|
|
| Texture* texture = static_cast<Texture*>(texture_base);
|
| DCHECK(texture != nullptr);
|
| @@ -316,6 +328,10 @@ void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base,
|
|
|
| void MailboxManagerSync::PushTextureUpdates(const SyncToken& token) {
|
| base::AutoLock lock(g_lock.Get());
|
| + // Relax the cross-thread access restriction to non-thread-safe RefCount.
|
| + // The lock above protects non-thread-safe RefCount in TextureGroup.
|
| + base::ScopedAllowCrossThreadRefCountAccess
|
| + scoped_allow_cross_thread_ref_count_access;
|
|
|
| for (TextureToGroupMap::iterator it = texture_to_group_.begin();
|
| it != texture_to_group_.end(); it++) {
|
| @@ -329,6 +345,10 @@ void MailboxManagerSync::PullTextureUpdates(const SyncToken& token) {
|
| std::vector<TextureUpdatePair> needs_update;
|
| {
|
| base::AutoLock lock(g_lock.Get());
|
| + // Relax the cross-thread access restriction to non-thread-safe RefCount.
|
| + // The lock above protects non-thread-safe RefCount in TextureGroup.
|
| + base::ScopedAllowCrossThreadRefCountAccess
|
| + scoped_allow_cross_thread_ref_count_access;
|
| AcquireFenceLocked(token);
|
|
|
| for (TextureToGroupMap::iterator it = texture_to_group_.begin();
|
|
|