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

Unified Diff: cc/CCPrioritizedTexture.cpp

Issue 10947017: Enable removing uploads to evicted textures from texture upload queues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 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
« no previous file with comments | « cc/CCPrioritizedTexture.h ('k') | cc/CCPrioritizedTextureManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCPrioritizedTexture.cpp
diff --git a/cc/CCPrioritizedTexture.cpp b/cc/CCPrioritizedTexture.cpp
index 270ceba292b5906d5fa4d939cc05dbb0180bd370..2940e925227420bcf189cb22b1b853115003d336 100644
--- a/cc/CCPrioritizedTexture.cpp
+++ b/cc/CCPrioritizedTexture.cpp
@@ -69,6 +69,11 @@ bool CCPrioritizedTexture::requestLate()
return m_manager->requestLate(this);
}
+bool CCPrioritizedTexture::backingResourceWasEvicted() const
+{
+ return m_backing ? m_backing->resourceHasBeenDeleted() : false;
+}
+
void CCPrioritizedTexture::acquireBackingTexture(CCResourceProvider* resourceProvider)
{
ASSERT(m_isAbovePriorityCutoff);
@@ -120,18 +125,42 @@ void CCPrioritizedTexture::setToSelfManagedMemoryPlaceholder(size_t bytes)
m_bytes = bytes;
}
-CCPrioritizedTexture::Backing::Backing(unsigned id, IntSize size, GC3Denum format)
+CCPrioritizedTexture::Backing::Backing(unsigned id, CCResourceProvider* resourceProvider, IntSize size, GC3Denum format)
: CCTexture(id, size, format)
, m_owner(0)
, m_priorityAtLastPriorityUpdate(CCPriorityCalculator::lowestPriority())
, m_ownerExistedAtLastPriorityUpdate(false)
, m_wasAbovePriorityCutoffAtLastPriorityUpdate(false)
+ , m_resourceHasBeenDeleted(false)
+#ifndef NDEBUG
+ , m_resourceProvider(resourceProvider)
+#endif
{
}
CCPrioritizedTexture::Backing::~Backing()
{
ASSERT(!m_owner);
+ ASSERT(m_resourceHasBeenDeleted);
+}
+
+void CCPrioritizedTexture::Backing::deleteResource(CCResourceProvider* resourceProvider)
+{
+ ASSERT(CCProxy::isImplThread());
+ ASSERT(!m_resourceHasBeenDeleted);
+#ifndef NDEBUG
+ ASSERT(resourceProvider == m_resourceProvider);
+#endif
+
+ resourceProvider->deleteResource(id());
+ setId(0);
+ m_resourceHasBeenDeleted = true;
+}
+
+bool CCPrioritizedTexture::Backing::resourceHasBeenDeleted() const
+{
+ ASSERT(CCProxy::isImplThread());
+ return m_resourceHasBeenDeleted;
}
void CCPrioritizedTexture::Backing::updatePriority()
« no previous file with comments | « cc/CCPrioritizedTexture.h ('k') | cc/CCPrioritizedTextureManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698