Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index dda25ecb79ad4b24337fa6a00cda38c3bbd4b5e6..06298c0d27c66f719785f4b32bd5e3f0c4c5db0e 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -691,6 +691,8 @@ void ThreadProxy::ScheduledActionSendBeginFrameToMainThread() { |
} |
begin_frame_state->memory_allocation_limit_bytes = |
layer_tree_host_impl_->memory_allocation_limit_bytes(); |
+ begin_frame_state->evicted_ui_resources = |
+ layer_tree_host_impl_->EvictedUIResourcesExist(); |
Proxy::MainThreadTaskRunner()->PostTask( |
FROM_HERE, |
base::Bind(&ThreadProxy::BeginFrameOnMainThread, |
@@ -765,6 +767,13 @@ void ThreadProxy::BeginFrameOnMainThread( |
UnlinkAndClearEvictedBackings(); |
} |
+ // Recreate all UI resources if there were evicted UI resources when the impl |
aelias_OOO_until_Jul13
2013/09/10 20:02:33
Hmm, I don't know of anything that guarantees no c
ccameron
2013/09/10 21:27:49
Only forced commits will happen, which I'm told is
|
+ // thread initiated the commit. |
+ bool evicted_ui_resources = |
+ begin_frame_state ? begin_frame_state->evicted_ui_resources : false; |
+ if (evicted_ui_resources) |
+ layer_tree_host_->RecreateUIResources(); |
+ |
layer_tree_host_->Layout(); |
// Clear the commit flag after updating animations and layout here --- objects |
@@ -773,7 +782,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_ && |
+ !evicted_ui_resources; |
can_cancel_commit_ = true; |
scoped_ptr<ResourceUpdateQueue> queue = |
@@ -1353,7 +1364,7 @@ size_t ThreadProxy::MaxPartialTextureUpdates() const { |
} |
ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
- : memory_allocation_limit_bytes(0) {} |
+ : memory_allocation_limit_bytes(0), evicted_ui_resources(false) {} |
ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() {} |
@@ -1458,6 +1469,7 @@ void ThreadProxy::RenewTreePriority() { |
// evicted resources or there is an invalid viewport size. |
if (layer_tree_host_impl_->active_tree()->ContentsTexturesPurged() || |
layer_tree_host_impl_->active_tree()->ViewportSizeInvalid() || |
+ layer_tree_host_impl_->EvictedUIResourcesExist() || |
input_throttled_until_commit_) |
priority = NEW_CONTENT_TAKES_PRIORITY; |