Index: cc/prioritized_resource.cc |
diff --git a/cc/prioritized_resource.cc b/cc/prioritized_resource.cc |
index 14e0cd7e885761bb4b51ab0c7b2ed0c1a266341b..280d7b55c32a21278565e75e69af2d6cc3de69de 100644 |
--- a/cc/prioritized_resource.cc |
+++ b/cc/prioritized_resource.cc |
@@ -153,7 +153,7 @@ PrioritizedResource::Backing::~Backing() |
void PrioritizedResource::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 PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProv |
bool PrioritizedResource::Backing::resourceHasBeenDeleted() const |
{ |
- DCHECK(Proxy::isImplThread()); |
+ DCHECK(!proxy() || proxy()->isImplThread()); |
return m_resourceHasBeenDeleted; |
} |
bool PrioritizedResource::Backing::canBeRecycled() const |
{ |
- DCHECK(Proxy::isImplThread()); |
+ DCHECK(!proxy() || proxy()->isImplThread()); |
return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree; |
} |
void PrioritizedResource::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 PrioritizedResource::Backing::updatePriority() |
void PrioritizedResource::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 PrioritizedResource::returnBackingTexture() |
m_manager->returnBackingTexture(this); |
} |
+const Proxy* PrioritizedResource::Backing::proxy() const |
+{ |
+ if (!m_owner || !m_owner->resourceManager()) |
+ return 0; |
+ return m_owner->resourceManager()->proxyForDebug(); |
+} |
+ |
} // namespace cc |