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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 // Delay this step until afer the main thread has been released as it's | 1010 // Delay this step until afer the main thread has been released as it's |
1011 // often a good bit of work to update the tree and prepare the new frame. | 1011 // often a good bit of work to update the tree and prepare the new frame. |
1012 impl().layer_tree_host_impl->CommitComplete(); | 1012 impl().layer_tree_host_impl->CommitComplete(); |
1013 | 1013 |
1014 SetInputThrottledUntilCommitOnImplThread(false); | 1014 SetInputThrottledUntilCommitOnImplThread(false); |
1015 | 1015 |
1016 UpdateBackgroundAnimateTicking(); | 1016 UpdateBackgroundAnimateTicking(); |
1017 | 1017 |
1018 impl().next_frame_is_newly_committed_frame = true; | 1018 impl().next_frame_is_newly_committed_frame = true; |
1019 | 1019 |
1020 impl().timing_history.DidCommit(); | 1020 // Compute the estimate before we add the new duration so we can compare the |
| 1021 // estimated duration for this frame to the actual value. |
| 1022 base::TimeDelta begin_main_frame_to_commit_duration_estimate = |
| 1023 BeginMainFrameToCommitDurationEstimate(); |
| 1024 base::TimeDelta begin_main_frame_to_commit_duration = |
| 1025 impl().timing_history.DidCommit(); |
| 1026 impl().layer_tree_host_impl->AddBeginMainFrameToCommitDurationEstimate( |
| 1027 begin_main_frame_to_commit_duration, |
| 1028 begin_main_frame_to_commit_duration_estimate); |
1021 } | 1029 } |
1022 | 1030 |
1023 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { | 1031 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { |
1024 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); | 1032 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); |
1025 DCHECK(IsImplThread()); | 1033 DCHECK(IsImplThread()); |
1026 impl().layer_tree_host_impl->UpdateVisibleTiles(); | 1034 impl().layer_tree_host_impl->UpdateVisibleTiles(); |
1027 } | 1035 } |
1028 | 1036 |
1029 void ThreadProxy::ScheduledActionActivateSyncTree() { | 1037 void ThreadProxy::ScheduledActionActivateSyncTree() { |
1030 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivateSyncTree"); | 1038 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivateSyncTree"); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate", | 1149 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate", |
1142 draw_duration_underestimate, | 1150 draw_duration_underestimate, |
1143 base::TimeDelta::FromMilliseconds(1), | 1151 base::TimeDelta::FromMilliseconds(1), |
1144 base::TimeDelta::FromMilliseconds(100), | 1152 base::TimeDelta::FromMilliseconds(100), |
1145 50); | 1153 50); |
1146 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", | 1154 UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate", |
1147 draw_duration_overestimate, | 1155 draw_duration_overestimate, |
1148 base::TimeDelta::FromMilliseconds(1), | 1156 base::TimeDelta::FromMilliseconds(1), |
1149 base::TimeDelta::FromMilliseconds(100), | 1157 base::TimeDelta::FromMilliseconds(100), |
1150 50); | 1158 50); |
| 1159 |
| 1160 impl().layer_tree_host_impl->AddDrawDurationEstimate( |
| 1161 draw_duration, draw_duration_estimate); |
1151 } | 1162 } |
1152 | 1163 |
1153 DCHECK_NE(INVALID_RESULT, result); | 1164 DCHECK_NE(INVALID_RESULT, result); |
1154 return result; | 1165 return result; |
1155 } | 1166 } |
1156 | 1167 |
1157 void ThreadProxy::ScheduledActionManageTiles() { | 1168 void ThreadProxy::ScheduledActionManageTiles() { |
1158 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); | 1169 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionManageTiles"); |
1159 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1170 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1160 impl().layer_tree_host_impl->ManageTiles(); | 1171 impl().layer_tree_host_impl->ManageTiles(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 if (impl().completion_event_for_commit_held_on_tree_activation) { | 1448 if (impl().completion_event_for_commit_held_on_tree_activation) { |
1438 TRACE_EVENT_INSTANT0( | 1449 TRACE_EVENT_INSTANT0( |
1439 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); | 1450 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); |
1440 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); | 1451 DCHECK(impl().layer_tree_host_impl->settings().impl_side_painting); |
1441 impl().completion_event_for_commit_held_on_tree_activation->Signal(); | 1452 impl().completion_event_for_commit_held_on_tree_activation->Signal(); |
1442 impl().completion_event_for_commit_held_on_tree_activation = NULL; | 1453 impl().completion_event_for_commit_held_on_tree_activation = NULL; |
1443 } | 1454 } |
1444 | 1455 |
1445 UpdateBackgroundAnimateTicking(); | 1456 UpdateBackgroundAnimateTicking(); |
1446 | 1457 |
1447 impl().timing_history.DidActivateSyncTree(); | 1458 // Compute the estimate before we add the new duration so we can compare the |
| 1459 // estimated duration for this frame to the actual value. |
| 1460 base::TimeDelta commit_to_activate_duration_estimate = |
| 1461 CommitToActivateDurationEstimate(); |
| 1462 base::TimeDelta commit_to_activate_duration = |
| 1463 impl().timing_history.DidActivateSyncTree(); |
| 1464 impl().layer_tree_host_impl->AddCommitToActivateDurationEstimate( |
| 1465 commit_to_activate_duration, commit_to_activate_duration_estimate); |
1448 } | 1466 } |
1449 | 1467 |
1450 void ThreadProxy::DidManageTiles() { | 1468 void ThreadProxy::DidManageTiles() { |
1451 DCHECK(IsImplThread()); | 1469 DCHECK(IsImplThread()); |
1452 impl().scheduler->DidManageTiles(); | 1470 impl().scheduler->DidManageTiles(); |
1453 } | 1471 } |
1454 | 1472 |
1455 } // namespace cc | 1473 } // namespace cc |
OLD | NEW |