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

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11637022: Send memory management policies to the tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 685effb47e7a80462231a78598cc5a6abaa6a54b..24258a85be805fd5957ccca308666f107e8b7877 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -215,9 +215,9 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre
, m_visible(true)
, m_contentsTexturesPurged(false)
, m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationLimit(),
- PriorityCalculator::allowEverythingCutoff(),
+ ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
0,
- PriorityCalculator::allowNothingCutoff())
+ ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING)
, m_backgroundColor(0)
, m_hasTransparentBackground(false)
, m_needsAnimateLayers(false)
@@ -790,7 +790,8 @@ void LayerTreeHostImpl::enforceManagedMemoryPolicy(const ManagedMemoryPolicy& po
{
bool evictedResources = m_client->reduceContentsTextureMemoryOnImplThread(
m_visible ? policy.bytesLimitWhenVisible : policy.bytesLimitWhenNotVisible,
- m_visible ? policy.priorityCutoffWhenVisible : policy.priorityCutoffWhenNotVisible);
+ ManagedMemoryPolicy::priorityCutoffValue(
+ m_visible ? policy.priorityCutoffWhenVisible : policy.priorityCutoffWhenNotVisible));
if (evictedResources) {
setContentsTexturesPurged();
m_client->setNeedsCommitOnImplThread();
@@ -802,8 +803,9 @@ void LayerTreeHostImpl::enforceManagedMemoryPolicy(const ManagedMemoryPolicy& po
// TODO(nduca): Pass something useful into the memory manager.
LOG(INFO) << "Setting up initial tile manager policy";
GlobalStateThatImpactsTilePriority new_state(m_tileManager->GlobalState());
- new_state.memory_limit_in_bytes = PrioritizedResourceManager::defaultMemoryAllocationLimit();
- new_state.memory_limit_policy = ALLOW_ANYTHING;
+ new_state.memory_limit_in_bytes = m_visible ? policy.bytesLimitWhenVisible : policy.bytesLimitWhenNotVisible;
+ new_state.memory_limit_policy = ManagedMemoryPolicy::priorityCutoffToMemoryLimitPolicy(
+ m_visible ? policy.priorityCutoffWhenVisible : policy.priorityCutoffWhenNotVisible);
m_tileManager->SetGlobalState(new_state);
nduca 2012/12/19 21:46:32 I think we might want a to just pass the enforce c
}
}
@@ -1697,6 +1699,9 @@ void LayerTreeHostImpl::sendManagedMemoryStats(
if (!renderer())
return;
+ // XXX - these numbers are coming from the priorized texture manager.
+ // If we have a tile manager, the numbers should come from there!
+
// Round the numbers being sent up to the next 8MB, to throttle the rate
// at which we spam the GPU process.
static const size_t roundingStep = 8 * 1024 * 1024;

Powered by Google App Engine
This is Rietveld 408576698