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

Side by Side Diff: cc/trees/thread_proxy.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Tweaks; Address more comments; Created 7 years, 6 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 unified diff | Download patch
« cc/scheduler/scheduler.cc ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/thread_proxy.h" 5 #include "cc/trees/thread_proxy.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 } 1094 }
1095 1095
1096 base::TimeDelta ThreadProxy::DrawDurationEstimate() { 1096 base::TimeDelta ThreadProxy::DrawDurationEstimate() {
1097 base::TimeDelta historical_estimate = 1097 base::TimeDelta historical_estimate =
1098 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile); 1098 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile);
1099 base::TimeDelta padding = base::TimeDelta::FromMicroseconds( 1099 base::TimeDelta padding = base::TimeDelta::FromMicroseconds(
1100 kDrawDurationEstimatePaddingInMicroseconds); 1100 kDrawDurationEstimatePaddingInMicroseconds);
1101 return historical_estimate + padding; 1101 return historical_estimate + padding;
1102 } 1102 }
1103 1103
1104 void ThreadProxy::PostBeginFrameDeadline(const base::Closure &closure,
1105 base::TimeTicks deadline) {
1106 base::TimeDelta delta = deadline - base::TimeTicks::Now();
1107 if (delta <= base::TimeDelta()) {
1108 closure.Run();
1109 return;
1110 }
1111 Proxy::ImplThreadTaskRunner()->PostDelayedTask(FROM_HERE, closure, delta);
1112 }
1113
1104 void ThreadProxy::ReadyToFinalizeTextureUpdates() { 1114 void ThreadProxy::ReadyToFinalizeTextureUpdates() {
1105 DCHECK(IsImplThread()); 1115 DCHECK(IsImplThread());
1106 scheduler_on_impl_thread_->FinishCommit(); 1116 scheduler_on_impl_thread_->FinishCommit();
1107 } 1117 }
1108 1118
1109 void ThreadProxy::DidCommitAndDrawFrame() { 1119 void ThreadProxy::DidCommitAndDrawFrame() {
1110 DCHECK(IsMainThread()); 1120 DCHECK(IsMainThread());
1111 if (!layer_tree_host_) 1121 if (!layer_tree_host_)
1112 return; 1122 return;
1113 layer_tree_host_->DidCommitAndDrawFrame(); 1123 layer_tree_host_->DidCommitAndDrawFrame();
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 !layer_tree_host_impl_->pending_tree()) { 1447 !layer_tree_host_impl_->pending_tree()) {
1438 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", 1448 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation",
1439 TRACE_EVENT_SCOPE_THREAD); 1449 TRACE_EVENT_SCOPE_THREAD);
1440 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); 1450 DCHECK(layer_tree_host_impl_->settings().impl_side_painting);
1441 completion_event_for_commit_held_on_tree_activation_->Signal(); 1451 completion_event_for_commit_held_on_tree_activation_->Signal();
1442 completion_event_for_commit_held_on_tree_activation_ = NULL; 1452 completion_event_for_commit_held_on_tree_activation_ = NULL;
1443 } 1453 }
1444 } 1454 }
1445 1455
1446 } // namespace cc 1456 } // namespace cc
OLDNEW
« cc/scheduler/scheduler.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