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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2321883002: cc: Remove SetMemoryPolicy from OutputSurface and Display. (Closed)
Patch Set: nits Created 4 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/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('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 fa545257850693febbe7d0367e435741e7dca7d3..3fb0a8f9c19a8c873a05a597d99c4431b7e1ab70 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -212,7 +212,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
tile_priorities_dirty_(false),
settings_(settings),
visible_(false),
- cached_managed_memory_policy_(settings.memory_policy_),
+ cached_managed_memory_policy_(settings.gpu_memory_policy),
is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() &&
!settings.single_thread_proxy_scheduler),
// Must be initialized after is_synchronous_single_threaded_ and
@@ -2105,10 +2105,6 @@ ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
return actual;
}
-size_t LayerTreeHostImpl::memory_allocation_limit_bytes() const {
- return ActualManagedMemoryPolicy().bytes_limit_when_visible;
-}
-
void LayerTreeHostImpl::ReleaseTreeResources() {
active_tree_->ReleaseResources();
if (pending_tree_)
@@ -2307,6 +2303,12 @@ bool LayerTreeHostImpl::InitializeRenderer(OutputSurface* output_surface) {
return false;
}
+ // When using software compositing, change to the limits specified for it.
+ // Since this is a one way trip, we don't need to worry about going back to
+ // GPU compositing.
+ if (!output_surface->context_provider())
+ SetMemoryPolicy(settings_.software_memory_policy);
+
output_surface_ = output_surface;
resource_provider_ = base::MakeUnique<ResourceProvider>(
output_surface_->context_provider(), shared_bitmap_manager_,
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698