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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1412923004: Revert of Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 3417528dbb9fe3ad43799787a5441b687ddd4fdc..56c4c905ce96573c9e3e44db3ca52e2437ff06e0 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -129,6 +129,16 @@ void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) {
TRACE_EVENT_ASYNC_END0("cc", "LayerTreeHostImpl::SetVisible", id);
}
+size_t GetDefaultMemoryAllocationLimit() {
+ // TODO(ccameron): (http://crbug.com/137094) This 64MB default is a straggler
+ // from the old texture manager and is just to give us a default memory
+ // allocation before we get a callback from the GPU memory manager. We
+ // should probaby either:
+ // - wait for the callback before rendering anything instead
+ // - push this into the GPU memory manager somehow.
+ return 64 * 1024 * 1024;
+}
+
} // namespace
LayerTreeHostImpl::FrameData::FrameData()
@@ -177,7 +187,10 @@ LayerTreeHostImpl::LayerTreeHostImpl(
tile_priorities_dirty_(false),
settings_(settings),
visible_(false),
- cached_managed_memory_policy_(settings.memory_policy_),
+ cached_managed_memory_policy_(
+ GetDefaultMemoryAllocationLimit(),
+ gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
+ ManagedMemoryPolicy::kDefaultNumResourcesLimit),
is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() &&
!settings.single_thread_proxy_scheduler),
// Must be initialized after is_synchronous_single_threaded_ and
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698