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

Unified Diff: cc/prioritized_texture.cc

Issue 11079007: Fix issue incremental upload can evict textures being drawn (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve against The Great Renaming 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
« no previous file with comments | « cc/prioritized_texture.h ('k') | cc/prioritized_texture_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/prioritized_texture.cc
diff --git a/cc/prioritized_texture.cc b/cc/prioritized_texture.cc
index 2940e925227420bcf189cb22b1b853115003d336..f1a7cf4578db2f60c9b78276310f14f3ccc89f44 100644
--- a/cc/prioritized_texture.cc
+++ b/cc/prioritized_texture.cc
@@ -129,8 +129,8 @@ CCPrioritizedTexture::Backing::Backing(unsigned id, CCResourceProvider* resource
: CCTexture(id, size, format)
, m_owner(0)
, m_priorityAtLastPriorityUpdate(CCPriorityCalculator::lowestPriority())
- , m_ownerExistedAtLastPriorityUpdate(false)
, m_wasAbovePriorityCutoffAtLastPriorityUpdate(false)
+ , m_inDrawingImplTree(false)
, m_resourceHasBeenDeleted(false)
#ifndef NDEBUG
, m_resourceProvider(resourceProvider)
@@ -163,18 +163,30 @@ bool CCPrioritizedTexture::Backing::resourceHasBeenDeleted() const
return m_resourceHasBeenDeleted;
}
+bool CCPrioritizedTexture::Backing::canBeRecycled() const
+{
+ ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
+ return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree;
+}
+
void CCPrioritizedTexture::Backing::updatePriority()
{
ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
if (m_owner) {
- m_ownerExistedAtLastPriorityUpdate = true;
m_priorityAtLastPriorityUpdate = m_owner->requestPriority();
m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityCutoff();
} else {
- m_ownerExistedAtLastPriorityUpdate = false;
m_priorityAtLastPriorityUpdate = CCPriorityCalculator::lowestPriority();
m_wasAbovePriorityCutoffAtLastPriorityUpdate = false;
}
}
+void CCPrioritizedTexture::Backing::updateInDrawingImplTree()
+{
+ ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
+ m_inDrawingImplTree = !!owner();
+ if (!m_inDrawingImplTree)
+ ASSERT(m_priorityAtLastPriorityUpdate == CCPriorityCalculator::lowestPriority());
+}
+
} // namespace cc
« no previous file with comments | « cc/prioritized_texture.h ('k') | cc/prioritized_texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698