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

Unified Diff: cc/prioritized_texture.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165064 Created 8 years, 2 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: cc/prioritized_texture.cc
diff --git a/cc/prioritized_texture.cc b/cc/prioritized_texture.cc
index 56d50f2b9701ca1e9b706b30404aa69989ca54f3..b76e736ac5338f26ceeed355ec5665ed9a32685c 100644
--- a/cc/prioritized_texture.cc
+++ b/cc/prioritized_texture.cc
@@ -153,7 +153,7 @@ PrioritizedTexture::Backing::~Backing()
void PrioritizedTexture::Backing::deleteResource(ResourceProvider* resourceProvider)
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
DCHECK(!m_resourceHasBeenDeleted);
#ifndef NDEBUG
DCHECK(resourceProvider == m_resourceProvider);
@@ -166,19 +166,19 @@ void PrioritizedTexture::Backing::deleteResource(ResourceProvider* resourceProvi
bool PrioritizedTexture::Backing::resourceHasBeenDeleted() const
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
return m_resourceHasBeenDeleted;
}
bool PrioritizedTexture::Backing::canBeRecycled() const
{
- DCHECK(Proxy::isImplThread());
+ DCHECK(!proxy() || proxy()->isImplThread());
return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree;
}
void PrioritizedTexture::Backing::updatePriority()
{
- DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked());
+ DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked());
if (m_owner) {
m_priorityAtLastPriorityUpdate = m_owner->requestPriority();
m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityCutoff();
@@ -190,7 +190,7 @@ void PrioritizedTexture::Backing::updatePriority()
void PrioritizedTexture::Backing::updateInDrawingImplTree()
{
- DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked());
+ DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked());
m_inDrawingImplTree = !!owner();
if (!m_inDrawingImplTree)
DCHECK(m_priorityAtLastPriorityUpdate == PriorityCalculator::lowestPriority());
@@ -203,4 +203,11 @@ void PrioritizedTexture::returnBackingTexture()
m_manager->returnBackingTexture(this);
}
+const Proxy* PrioritizedTexture::Backing::proxy() const
+{
+ if (!m_owner || !m_owner->textureManager())
+ return 0;
+ return m_owner->textureManager()->proxyForDebug();
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698