OLD | NEW |
---|---|
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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
998 // Delay this step until afer the main thread has been released as it's | 998 // Delay this step until afer the main thread has been released as it's |
999 // often a good bit of work to update the tree and prepare the new frame. | 999 // often a good bit of work to update the tree and prepare the new frame. |
1000 impl().layer_tree_host_impl->CommitComplete(); | 1000 impl().layer_tree_host_impl->CommitComplete(); |
1001 | 1001 |
1002 SetInputThrottledUntilCommitOnImplThread(false); | 1002 SetInputThrottledUntilCommitOnImplThread(false); |
1003 | 1003 |
1004 UpdateBackgroundAnimateTicking(); | 1004 UpdateBackgroundAnimateTicking(); |
1005 | 1005 |
1006 impl().next_frame_is_newly_committed_frame = true; | 1006 impl().next_frame_is_newly_committed_frame = true; |
1007 | 1007 |
1008 impl().timing_history.DidCommit(); | 1008 // Compute the estimate before we add the new duration so we can compare the |
1009 // estimated duration for this frame to the actual value. | |
1010 base::TimeDelta begin_main_frame_to_commit_duration_estimate = | |
1011 BeginMainFrameToCommitDurationEstimate(); | |
1012 base::TimeDelta begin_main_frame_to_commit_duration = | |
1013 impl().timing_history.DidCommit(); | |
1014 impl() | |
1015 .layer_tree_host_impl->rendering_stats_instrumentation() | |
danakj
2014/07/11 18:16:18
I don't think ThreadProxy should be reaching throu
ernstm
2014/07/14 13:12:38
ThreadProxy could access RenderingStatsInstrumenta
Dominik Grewe
2014/07/14 13:37:52
As far as I understand, this method is always runn
ernstm
2014/07/14 14:05:26
I liked the version that exposes rendering_stats_i
| |
1016 ->AddBeginMainFrameToCommitDuration( | |
1017 begin_main_frame_to_commit_duration, | |
1018 begin_main_frame_to_commit_duration_estimate); | |
1009 } | 1019 } |
1010 | 1020 |
1011 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { | 1021 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { |
1012 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); | 1022 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); |
1013 DCHECK(IsImplThread()); | 1023 DCHECK(IsImplThread()); |
1014 impl().layer_tree_host_impl->UpdateVisibleTiles(); | 1024 impl().layer_tree_host_impl->UpdateVisibleTiles(); |
1015 } | 1025 } |
1016 | 1026 |
1017 void ThreadProxy::ScheduledActionActivatePendingTree() { | 1027 void ThreadProxy::ScheduledActionActivatePendingTree() { |
1018 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTree"); | 1028 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTree"); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1130 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate", | 1140 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate", |
1131 draw_duration_underestimate, | 1141 draw_duration_underestimate, |
1132 base::TimeDelta::FromMilliseconds(1), | 1142 base::TimeDelta::FromMilliseconds(1), |
1133 base::TimeDelta::FromMilliseconds(100), | 1143 base::TimeDelta::FromMilliseconds(100), |
1134 50); | 1144 50); |
1135 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", | 1145 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", |
1136 draw_duration_overestimate, | 1146 draw_duration_overestimate, |
1137 base::TimeDelta::FromMilliseconds(1), | 1147 base::TimeDelta::FromMilliseconds(1), |
1138 base::TimeDelta::FromMilliseconds(100), | 1148 base::TimeDelta::FromMilliseconds(100), |
1139 50); | 1149 50); |
1150 | |
1151 impl() | |
1152 .layer_tree_host_impl->rendering_stats_instrumentation() | |
1153 ->AddDrawDuration(draw_duration, draw_duration_estimate); | |
1140 } | 1154 } |
1141 | 1155 |
1142 DCHECK_NE(INVALID_RESULT, result); | 1156 DCHECK_NE(INVALID_RESULT, result); |
1143 return result; | 1157 return result; |
1144 } | 1158 } |
1145 | 1159 |
1146 void ThreadProxy::ScheduledActionManageTiles() { | 1160 void ThreadProxy::ScheduledActionManageTiles() { |
1147 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); | 1161 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); |
1148 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1162 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1149 impl().layer_tree_host_impl->ManageTiles(); | 1163 impl().layer_tree_host_impl->ManageTiles(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1426 if (impl().completion_event_for_commit_held_on_tree_activation) { | 1440 if (impl().completion_event_for_commit_held_on_tree_activation) { |
1427 TRACE_EVENT_INSTANT0( | 1441 TRACE_EVENT_INSTANT0( |
1428 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); | 1442 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); |
1429 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1443 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1430 impl().completion_event_for_commit_held_on_tree_activation->Signal(); | 1444 impl().completion_event_for_commit_held_on_tree_activation->Signal(); |
1431 impl().completion_event_for_commit_held_on_tree_activation = NULL; | 1445 impl().completion_event_for_commit_held_on_tree_activation = NULL; |
1432 } | 1446 } |
1433 | 1447 |
1434 UpdateBackgroundAnimateTicking(); | 1448 UpdateBackgroundAnimateTicking(); |
1435 | 1449 |
1436 impl().timing_history.DidActivatePendingTree(); | 1450 // Compute the estimate before we add the new duration so we can compare the |
1451 // estimated duration for this frame to the actual value. | |
1452 base::TimeDelta commit_to_activate_duration_estimate = | |
1453 CommitToActivateDurationEstimate(); | |
1454 base::TimeDelta commit_to_activate_duration = | |
1455 impl().timing_history.DidActivatePendingTree(); | |
1456 impl() | |
1457 .layer_tree_host_impl->rendering_stats_instrumentation() | |
1458 ->AddCommitToActivateDuration(commit_to_activate_duration, | |
1459 commit_to_activate_duration_estimate); | |
1437 } | 1460 } |
1438 | 1461 |
1439 void ThreadProxy::DidManageTiles() { | 1462 void ThreadProxy::DidManageTiles() { |
1440 DCHECK(IsImplThread()); | 1463 DCHECK(IsImplThread()); |
1441 impl().scheduler->DidManageTiles(); | 1464 impl().scheduler->DidManageTiles(); |
1442 } | 1465 } |
1443 | 1466 |
1444 } // namespace cc | 1467 } // namespace cc |
OLD | NEW |