summaryrefslogtreecommitdiffstats
path: root/cc/trees/thread_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/thread_proxy.cc')
-rw-r--r--cc/trees/thread_proxy.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index dc73f3b..dda25ec 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_);