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

Unified Diff: cc/trees/thread_proxy.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
« cc/trees/layer_tree_host_unittest_context.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index dda25ecb79ad4b24337fa6a00cda38c3bbd4b5e6..e69ad30de139983d5d6b8a8b7aa8bdd776e9adcc 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -685,6 +685,8 @@ void ThreadProxy::ScheduledActionSendBeginFrameToMainThread() {
layer_tree_host_impl_->CurrentPhysicalTimeTicks();
begin_frame_state->scroll_info =
layer_tree_host_impl_->ProcessScrollDeltas();
+ begin_frame_state->ui_resource_eviction_count =
+ layer_tree_host_impl_->ui_resource_eviction_count();
if (!layer_tree_host_impl_->settings().impl_side_painting) {
DCHECK_GT(layer_tree_host_impl_->memory_allocation_limit_bytes(), 0u);
@@ -751,11 +753,15 @@ void ThreadProxy::BeginFrameOnMainThread(
layer_tree_host_->WillBeginFrame();
+ bool recreated_evicted_ui_resources = false;
if (begin_frame_state) {
layer_tree_host_->UpdateClientAnimations(
begin_frame_state->monotonic_frame_begin_time);
layer_tree_host_->AnimateLayers(
begin_frame_state->monotonic_frame_begin_time);
+ recreated_evicted_ui_resources =
+ layer_tree_host_->SetUIResourceEvictionCount(
+ begin_frame_state->ui_resource_eviction_count);
}
// Unlink any backings that the impl thread has evicted, so that we know to
@@ -773,7 +779,9 @@ void ThreadProxy::BeginFrameOnMainThread(
commit_requested_ = false;
commit_request_sent_to_impl_thread_ = false;
bool can_cancel_this_commit =
- can_cancel_commit_ && !in_composite_and_readback_;
+ can_cancel_commit_ &&
+ !in_composite_and_readback_ &&
+ !recreated_evicted_ui_resources;
can_cancel_commit_ = true;
scoped_ptr<ResourceUpdateQueue> queue =
@@ -1353,7 +1361,8 @@ size_t ThreadProxy::MaxPartialTextureUpdates() const {
}
ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
- : memory_allocation_limit_bytes(0) {}
+ : memory_allocation_limit_bytes(0),
+ ui_resource_eviction_count(0) {}
ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() {}
« cc/trees/layer_tree_host_unittest_context.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698