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

Unified Diff: cc/trees/thread_proxy.cc

Issue 914403003: cc: Add main frame timing info to frame timing tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/thread_proxy.h ('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 ff2ca46615e8e2971beeb4b28d791fa6e5dce06c..bb9e3b01a75723170673632b8405a24542ca9f3f 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -366,6 +366,8 @@ void ThreadProxy::DidSwapBuffersCompleteOnImplThread() {
void ThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) {
impl().layer_tree_host_impl->WillBeginImplFrame(args);
+ impl().last_begin_impl_frame_args =
+ impl().layer_tree_host_impl->CurrentBeginFrameArgs();
}
void ThreadProxy::OnCanDrawStateChanged(bool can_draw) {
@@ -691,6 +693,7 @@ void ThreadProxy::ScheduledActionSendBeginMainFrame() {
impl().layer_tree_host_impl->memory_allocation_priority_cutoff();
begin_main_frame_state->evicted_ui_resources =
impl().layer_tree_host_impl->EvictedUIResourcesExist();
+ impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args;
brianderson 2015/03/20 21:14:05 If main_frame_before_activation_enabled is true in
vmpstr 2015/03/20 22:31:27 What's the expected behavior (if say this is made
brianderson 2015/03/20 23:01:58 Yes, we would have overlapping frames and we would
vmpstr 2015/03/23 20:26:43 Done.
Proxy::MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ThreadProxy::BeginMainFrame,
@@ -935,8 +938,10 @@ void ThreadProxy::BeginMainFrameAbortedOnImplThread(
DCHECK(impl().scheduler->CommitPending());
DCHECK(!impl().layer_tree_host_impl->pending_tree());
- if (CommitEarlyOutHandledCommit(reason))
+ if (CommitEarlyOutHandledCommit(reason)) {
SetInputThrottledUntilCommitOnImplThread(false);
+ RecordMainFrameTiming();
+ }
impl().layer_tree_host_impl->BeginMainFrameAborted(reason);
impl().scheduler->BeginMainFrameAborted(reason);
}
@@ -1356,6 +1361,7 @@ void ThreadProxy::DidActivateSyncTree() {
}
impl().timing_history.DidActivateSyncTree();
+ RecordMainFrameTiming();
brianderson 2015/03/20 21:14:06 Regarding the interval / prediction issue, we shou
vmpstr 2015/03/20 22:31:27 I think that's an excellent idea. I'm guessing the
brianderson 2015/03/20 23:01:58 There are no plans to get rid of it. It's especial
mithro-old 2015/03/23 00:15:08 I agree with Brian here.
vmpstr 2015/03/23 20:26:43 Done.
}
void ThreadProxy::DidPrepareTiles() {
@@ -1370,4 +1376,13 @@ void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() {
main_thread_weak_ptr_));
}
+void ThreadProxy::RecordMainFrameTiming() {
+ // Last begin main frame args records the frame args that we last sent to the
+ // main thread. Last begin impl frame args, on the other hand, records the
+ // last time we started an impl frame which should be the frame during which
+ // this call is being run.
+ impl().layer_tree_host_impl->RecordMainFrameTiming(
+ impl().last_begin_main_frame_args, impl().last_begin_impl_frame_args);
brianderson 2015/03/20 21:14:06 Although this is slightly wrong right now because
vmpstr 2015/03/20 22:31:27 Acknowledged.
+}
+
} // namespace cc
« cc/trees/thread_proxy.h ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698