Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index dc73f3b895b6e484ab1bde6423c7d721a3bef514..dda25ecb79ad4b24337fa6a00cda38c3bbd4b5e6 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -76,6 +76,8 @@ ThreadProxy::ThreadProxy( |
textures_acquired_(true), |
in_composite_and_readback_(false), |
manage_tiles_pending_(false), |
+ commit_waits_for_activation_(false), |
+ inside_commit_(false), |
weak_factory_on_impl_thread_(this), |
weak_factory_(this), |
begin_frame_sent_to_main_thread_completion_event_on_impl_thread_(NULL), |
@@ -506,6 +508,12 @@ void ThreadProxy::SetNeedsRedraw(gfx::Rect damage_rect) { |
damage_rect)); |
} |
+void ThreadProxy::SetNextCommitWaitsForActivation() { |
+ DCHECK(IsMainThread()); |
+ DCHECK(!inside_commit_); |
+ commit_waits_for_activation_ = true; |
+} |
+ |
void ThreadProxy::SetDeferCommits(bool defer_commits) { |
DCHECK(IsMainThread()); |
DCHECK_NE(defer_commits_, defer_commits); |
@@ -933,10 +941,12 @@ void ThreadProxy::ScheduledActionCommit() { |
current_resource_update_controller_on_impl_thread_->Finalize(); |
current_resource_update_controller_on_impl_thread_.reset(); |
+ inside_commit_ = true; |
layer_tree_host_impl_->BeginCommit(); |
layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
layer_tree_host_impl_->CommitComplete(); |
+ inside_commit_ = false; |
SetInputThrottledUntilCommitOnImplThread(false); |
@@ -945,8 +955,7 @@ void ThreadProxy::ScheduledActionCommit() { |
next_frame_is_newly_committed_frame_on_impl_thread_ = true; |
if (layer_tree_host_->settings().impl_side_painting && |
- layer_tree_host_->BlocksPendingCommit() && |
- layer_tree_host_impl_->pending_tree()) { |
+ commit_waits_for_activation_) { |
// For some layer types in impl-side painting, the commit is held until |
// the pending tree is activated. It's also possible that the |
// pending tree has already activated if there was no work to be done. |
@@ -959,6 +968,8 @@ void ThreadProxy::ScheduledActionCommit() { |
commit_completion_event_on_impl_thread_ = NULL; |
} |
+ commit_waits_for_activation_ = false; |
+ |
commit_complete_time_ = base::TimeTicks::HighResNow(); |
begin_frame_to_commit_duration_history_.InsertSample( |
commit_complete_time_ - begin_frame_sent_to_main_thread_time_); |