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 base::TimeDelta begin_main_frame_to_commit_duration_estimate = |
1009 BeginMainFrameToCommitDurationEstimate(); | |
brianderson
2014/07/02 22:39:29
Can you add a comment indicating why you are takin
Dominik Grewe
2014/07/03 13:16:38
Done here and below.
| |
1010 base::TimeDelta begin_main_frame_to_commit_duration = | |
1011 impl().timing_history.DidCommit(); | |
1012 impl() | |
1013 .layer_tree_host_impl->rendering_stats_instrumentation() | |
1014 ->AddBeginMainFrameToCommitDuration( | |
1015 begin_main_frame_to_commit_duration, | |
1016 begin_main_frame_to_commit_duration_estimate); | |
1009 } | 1017 } |
1010 | 1018 |
1011 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { | 1019 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { |
1012 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); | 1020 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); |
1013 DCHECK(IsImplThread()); | 1021 DCHECK(IsImplThread()); |
1014 impl().layer_tree_host_impl->UpdateVisibleTiles(); | 1022 impl().layer_tree_host_impl->UpdateVisibleTiles(); |
1015 } | 1023 } |
1016 | 1024 |
1017 void ThreadProxy::ScheduledActionActivatePendingTree() { | 1025 void ThreadProxy::ScheduledActionActivatePendingTree() { |
1018 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTree"); | 1026 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", | 1138 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate", |
1131 draw_duration_underestimate, | 1139 draw_duration_underestimate, |
1132 base::TimeDelta::FromMilliseconds(1), | 1140 base::TimeDelta::FromMilliseconds(1), |
1133 base::TimeDelta::FromMilliseconds(100), | 1141 base::TimeDelta::FromMilliseconds(100), |
1134 50); | 1142 50); |
1135 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", | 1143 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", |
1136 draw_duration_overestimate, | 1144 draw_duration_overestimate, |
1137 base::TimeDelta::FromMilliseconds(1), | 1145 base::TimeDelta::FromMilliseconds(1), |
1138 base::TimeDelta::FromMilliseconds(100), | 1146 base::TimeDelta::FromMilliseconds(100), |
1139 50); | 1147 50); |
1148 | |
1149 impl() | |
1150 .layer_tree_host_impl->rendering_stats_instrumentation() | |
1151 ->AddDrawDuration(draw_duration, draw_duration_estimate); | |
1140 } | 1152 } |
1141 | 1153 |
1142 DCHECK_NE(INVALID_RESULT, result); | 1154 DCHECK_NE(INVALID_RESULT, result); |
1143 return result; | 1155 return result; |
1144 } | 1156 } |
1145 | 1157 |
1146 void ThreadProxy::ScheduledActionManageTiles() { | 1158 void ThreadProxy::ScheduledActionManageTiles() { |
1147 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); | 1159 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); |
1148 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1160 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1149 impl().layer_tree_host_impl->ManageTiles(); | 1161 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) { | 1438 if (impl().completion_event_for_commit_held_on_tree_activation) { |
1427 TRACE_EVENT_INSTANT0( | 1439 TRACE_EVENT_INSTANT0( |
1428 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); | 1440 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); |
1429 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1441 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1430 impl().completion_event_for_commit_held_on_tree_activation->Signal(); | 1442 impl().completion_event_for_commit_held_on_tree_activation->Signal(); |
1431 impl().completion_event_for_commit_held_on_tree_activation = NULL; | 1443 impl().completion_event_for_commit_held_on_tree_activation = NULL; |
1432 } | 1444 } |
1433 | 1445 |
1434 UpdateBackgroundAnimateTicking(); | 1446 UpdateBackgroundAnimateTicking(); |
1435 | 1447 |
1436 impl().timing_history.DidActivatePendingTree(); | 1448 base::TimeDelta commit_to_activate_duration_estimate = |
1449 CommitToActivateDurationEstimate(); | |
1450 base::TimeDelta commit_to_activate_duration = | |
1451 impl().timing_history.DidActivatePendingTree(); | |
1452 impl() | |
1453 .layer_tree_host_impl->rendering_stats_instrumentation() | |
1454 ->AddCommitToActivateDuration(commit_to_activate_duration, | |
1455 commit_to_activate_duration_estimate); | |
1437 } | 1456 } |
1438 | 1457 |
1439 void ThreadProxy::DidManageTiles() { | 1458 void ThreadProxy::DidManageTiles() { |
1440 DCHECK(IsImplThread()); | 1459 DCHECK(IsImplThread()); |
1441 impl().scheduler->DidManageTiles(); | 1460 impl().scheduler->DidManageTiles(); |
1442 } | 1461 } |
1443 | 1462 |
1444 } // namespace cc | 1463 } // namespace cc |
OLD | NEW |