Index: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp |
=================================================================== |
--- Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (revision 114633) |
+++ Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (working copy) |
@@ -199,7 +199,7 @@ |
ASSERT(CCProxy::isImplThread()); |
TRACE_EVENT("CCLayerTreeHost::commitTo", this, 0); |
- m_contentsTextureManager->reduceMemoryToLimit(TextureManager::reclaimLimitBytes(viewportSize())); |
+ m_contentsTextureManager->reduceMemoryToLimit(m_contentsTextureManager->preferredMemoryLimitBytes()); |
m_contentsTextureManager->deleteEvictedTextures(hostImpl->contentsTextureAllocator()); |
} |
@@ -367,7 +367,8 @@ |
m_visible = visible; |
if (!visible && m_layerRendererInitialized) { |
- m_contentsTextureManager->reduceMemoryToLimit(TextureManager::lowLimitBytes(viewportSize())); |
+ // Drop all unprotected textures. |
+ m_contentsTextureManager->reduceMemoryToLimit(0); |
m_contentsTextureManager->unprotectAllTextures(); |
} |
@@ -386,7 +387,7 @@ |
if (m_proxy->layerRendererCapabilities().contextHasCachedFrontBuffer) |
contentsTextureManager()->evictAndDeleteAllTextures(hostImpl->contentsTextureAllocator()); |
else { |
- contentsTextureManager()->reduceMemoryToLimit(TextureManager::reclaimLimitBytes(viewportSize())); |
+ contentsTextureManager()->reduceMemoryToLimit(m_contentsTextureManager->preferredMemoryLimitBytes()); |
contentsTextureManager()->deleteEvictedTextures(hostImpl->contentsTextureAllocator()); |
} |
@@ -488,8 +489,8 @@ |
if (!m_triggerIdlePaints) |
return; |
- size_t preferredLimitBytes = TextureManager::reclaimLimitBytes(m_viewportSize); |
- size_t maxLimitBytes = TextureManager::highLimitBytes(m_viewportSize); |
+ size_t preferredLimitBytes = m_contentsTextureManager->preferredMemoryLimitBytes(); |
+ size_t maxLimitBytes = m_contentsTextureManager->maxMemoryLimitBytes(); |
m_contentsTextureManager->reduceMemoryToLimit(preferredLimitBytes); |
if (m_contentsTextureManager->currentMemoryUseBytes() >= preferredLimitBytes) |
return; |