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..9939f34555e72016b401e72601db1ea79914eeef 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,21 @@ 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::UIResourcesEvictedHaveNotBeenRecreated() const { |
+ return layer_tree_host_impl_->ui_resource_eviction_count() != |
+ ui_resource_eviction_count_recreated_; |
+} |
+ |
bool LayerTreeImpl::ContentsTexturesPurged() const { |
return contents_textures_purged_; |
} |
@@ -624,6 +643,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; |