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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 23621021: (not for review yet) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 220083f77f30b11cc53a38d723df0856f2da10b1..a88822896bfa2d61d890a47ee68fde90b4f37774 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -61,7 +61,7 @@ RendererCapabilities::RendererCapabilities()
RendererCapabilities::~RendererCapabilities() {}
UIResourceRequest::UIResourceRequest()
- : type(UIResourceInvalidRequest), id(0), bitmap(NULL) {}
+ : type(UIResourceInvalidRequest), id(0), bitmap(NULL), ack(0) {}
UIResourceRequest::~UIResourceRequest() {}
@@ -370,6 +370,13 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->ProcessUIResourceRequestQueue();
}
+ // If all UI resource evictions will not be acknowledged by this commit, then
+ // another commit is required.
+ if (ui_resource_eviction_count_last_acked_ !=
+ host_impl->ui_resource_eviction_count()) {
+ host_impl->SetNeedsCommit();
+ }
+
DCHECK(!sync_tree->ViewportSizeInvalid());
if (new_impl_tree_has_no_evicted_resources) {
@@ -1165,4 +1172,18 @@ void LayerTreeHost::RecreateUIResources(bool resource_lost) {
}
}
+void LayerTreeHost::SetUIResourceEvictionCountToAck(uint64 ui_resource_eviction_count) {
+ if (ui_resource_eviction_count_last_acked_ == ui_resource_eviction_count)
+ return;
+
+ bool resource_lost = false;
+ RecreateUIResources(resource_lost);
+
+ UIResourceRequest request;
+ request.type = UIResourceRequest::UIResourceEvictionAck;
+ request.ack = ui_resource_eviction_count;
+ ui_resource_request_queue_.push_back(request);
+ ui_resource_eviction_count_last_acked_ = ui_resource_eviction_count;
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698