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

Unified Diff: cc/texture_layer_impl.cc

Issue 11888010: Cosmetic cleanup to texture_layer mailboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 11 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
« no previous file with comments | « cc/texture_layer_impl.h ('k') | cc/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_layer_impl.cc
diff --git a/cc/texture_layer_impl.cc b/cc/texture_layer_impl.cc
index d1a48dad3f0d747e2270bb69f0e27953dbb14acd..6ea69bc9ab66fa72d2633f66536874fc688fa358 100644
--- a/cc/texture_layer_impl.cc
+++ b/cc/texture_layer_impl.cc
@@ -36,23 +36,22 @@ TextureLayerImpl::~TextureLayerImpl()
ResourceProvider* provider = layerTreeImpl()->resource_provider();
provider->deleteResource(m_externalTextureResource);
}
- if (m_hasPendingMailbox && !m_pendingMailboxName.empty())
- m_pendingMailboxReleaseCallback.Run(0);
+ if (m_hasPendingMailbox)
+ m_pendingTextureMailbox.RunReleaseCallback(0);
}
-void TextureLayerImpl::setTextureMailbox(const std::string& mailboxName, const base::Callback<void(unsigned)>& releaseCallback)
+void TextureLayerImpl::setTextureMailbox(const TextureMailbox& mailbox)
{
DCHECK(m_usesMailbox);
// Same mailbox name was commited, nothing to do.
- if (m_pendingMailboxName.compare(mailboxName) == 0)
+ if (m_pendingTextureMailbox.Equals(mailbox))
return;
// Two commits without a draw, ack the previous mailbox.
- if (m_hasPendingMailbox && !m_pendingMailboxReleaseCallback.is_null())
- m_pendingMailboxReleaseCallback.Run(0);
+ if (m_hasPendingMailbox)
+ m_pendingTextureMailbox.RunReleaseCallback(0);
- m_pendingMailboxName = mailboxName;
+ m_pendingTextureMailbox = mailbox;
m_hasPendingMailbox = true;
- m_pendingMailboxReleaseCallback = releaseCallback;
}
void TextureLayerImpl::willDraw(ResourceProvider* resourceProvider)
@@ -72,8 +71,8 @@ void TextureLayerImpl::willDraw(ResourceProvider* resourceProvider)
resourceProvider->deleteResource(m_externalTextureResource);
m_externalTextureResource = 0;
}
- if (!m_pendingMailboxName.empty())
- m_externalTextureResource = resourceProvider->createResourceFromTextureMailbox(m_pendingMailboxName, m_pendingMailboxReleaseCallback);
+ if (!m_pendingTextureMailbox.IsEmpty())
+ m_externalTextureResource = resourceProvider->createResourceFromTextureMailbox(m_pendingTextureMailbox);
m_hasPendingMailbox = false;
}
« no previous file with comments | « cc/texture_layer_impl.h ('k') | cc/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698