Chromium Code Reviews| 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 5a79a41c2ecb7d0ec4497e1132a35ab5bd15bde7..cd9c4d8d38ba6c19ffcb27df3b9e6820451fe787 100644 |
| --- a/gpu/command_buffer/service/mailbox_manager_sync.cc |
| +++ b/gpu/command_buffer/service/mailbox_manager_sync.cc |
| @@ -191,7 +191,7 @@ bool MailboxManagerSync::UsesSync() { |
| return true; |
| } |
| -Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) { |
| +TextureBase* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) { |
|
piman
2016/09/07 17:38:31
nit: you can use covariant returns and return Text
Geoff Lang
2016/09/07 18:14:49
Done.
|
| base::AutoLock lock(g_lock.Get()); |
| TextureGroup* group = TextureGroup::FromName(mailbox); |
| if (!group) |
| @@ -218,9 +218,12 @@ Texture* MailboxManagerSync::ConsumeTexture(const Mailbox& mailbox) { |
| } |
| void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox, |
| - Texture* texture) { |
| + TextureBase* texture_base) { |
| base::AutoLock lock(g_lock.Get()); |
| + Texture* texture = texture_base->AsTexture(); |
| + DCHECK(texture != nullptr); |
| + |
| TextureToGroupMap::iterator tex_it = texture_to_group_.find(texture); |
| TextureGroup* group_for_mailbox = TextureGroup::FromName(mailbox); |
| TextureGroup* group_for_texture = NULL; |
| @@ -262,8 +265,12 @@ void MailboxManagerSync::ProduceTexture(const Mailbox& mailbox, |
| DCHECK(texture->mailbox_manager_ == this); |
| } |
| -void MailboxManagerSync::TextureDeleted(Texture* texture) { |
| +void MailboxManagerSync::TextureDeleted(TextureBase* texture_base) { |
| base::AutoLock lock(g_lock.Get()); |
| + |
| + Texture* texture = texture_base->AsTexture(); |
| + DCHECK(texture != nullptr); |
| + |
| TextureToGroupMap::iterator tex_it = texture_to_group_.find(texture); |
| DCHECK(tex_it != texture_to_group_.end()); |
| TextureGroup* group_for_texture = tex_it->second.group.get(); |
| @@ -272,11 +279,13 @@ void MailboxManagerSync::TextureDeleted(Texture* texture) { |
| texture_to_group_.erase(tex_it); |
| } |
| -void MailboxManagerSync::UpdateDefinitionLocked( |
| - Texture* texture, |
| - TextureGroupRef* group_ref) { |
| +void MailboxManagerSync::UpdateDefinitionLocked(TextureBase* texture_base, |
| + TextureGroupRef* group_ref) { |
| g_lock.Get().AssertAcquired(); |
| + Texture* texture = texture_base->AsTexture(); |
| + DCHECK(texture != nullptr); |
| + |
| if (SkipTextureWorkarounds(texture)) |
| return; |