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

Unified Diff: gpu/command_buffer/service/mailbox_manager_sync.cc

Issue 2315313003: Add a base class of Texture for interfacing with the mailbox manager. (Closed)
Patch Set: Address piman's comments Created 4 years, 3 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: 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..979700a19e38a321f608787bd54735a72b621501 100644
--- a/gpu/command_buffer/service/mailbox_manager_sync.cc
+++ b/gpu/command_buffer/service/mailbox_manager_sync.cc
@@ -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 = static_cast<Texture*>(texture_base);
+ 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 = static_cast<Texture*>(texture_base);
+ 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 = static_cast<Texture*>(texture_base);
+ DCHECK(texture != nullptr);
+
if (SkipTextureWorkarounds(texture))
return;
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.h ('k') | gpu/command_buffer/service/mailbox_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698