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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 23548022: [cc] Evict UIResources when the renderer is not visible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix names Created 7 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
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 0d4fbf9fd0806d37a567c2559c45470da83ad913..ae050e61a48f890ecef926615ea4a0f1b934f4db 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -33,6 +33,7 @@ LayerTreeImpl::LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl)
min_page_scale_factor_(0),
max_page_scale_factor_(0),
scrolling_layer_id_from_previous_tree_(0),
+ ui_resource_eviction_count_recreated_(0),
contents_textures_purged_(false),
viewport_size_invalid_(false),
needs_update_draw_properties_(true),
@@ -126,6 +127,9 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
else
target_tree->ResetContentsTexturesPurged();
+ target_tree->SetUIResourceEvictionCountRecreated(
+ ui_resource_eviction_count_recreated());
+
if (ViewportSizeInvalid())
target_tree->SetViewportSizeInvalid();
else
@@ -383,6 +387,16 @@ void LayerTreeImpl::DidBecomeActive() {
FindRootScrollLayer();
}
+void LayerTreeImpl::SetUIResourceEvictionCountRecreated(
+ uint64 ui_resource_eviction_count_recreated) {
+ if (ui_resource_eviction_count_recreated ==
+ ui_resource_eviction_count_recreated_)
+ return;
+
+ ui_resource_eviction_count_recreated_ = ui_resource_eviction_count_recreated;
+ layer_tree_host_impl_->OnCanDrawStateChangedForTree();
+}
+
bool LayerTreeImpl::ContentsTexturesPurged() const {
return contents_textures_purged_;
}
@@ -624,6 +638,9 @@ void LayerTreeImpl::ProcessUIResourceRequestQueue() {
case UIResourceRequest::UIResourceDelete:
layer_tree_host_impl_->DeleteUIResource(req.id);
break;
+ case UIResourceRequest::UIResourceEvictionRecreated:
+ SetUIResourceEvictionCountRecreated(req.eviction_count_recreated);
+ break;
case UIResourceRequest::UIResourceInvalidRequest:
NOTREACHED();
break;

Powered by Google App Engine
This is Rietveld 408576698