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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 base::TimeDelta draw_duration_estimate = DrawDurationEstimate(); | 1145 base::TimeDelta draw_duration_estimate = DrawDurationEstimate(); |
1146 base::AutoReset<bool> mark_inside(&impl().inside_draw, true); | 1146 base::AutoReset<bool> mark_inside(&impl().inside_draw, true); |
1147 | 1147 |
1148 // Advance our animations. | 1148 // Advance our animations. |
1149 base::TimeTicks monotonic_time; | 1149 base::TimeTicks monotonic_time; |
1150 if (impl().animations_frozen_until_next_draw) | 1150 if (impl().animations_frozen_until_next_draw) |
1151 monotonic_time = impl().animation_freeze_time; | 1151 monotonic_time = impl().animation_freeze_time; |
1152 else | 1152 else |
1153 monotonic_time = impl().layer_tree_host_impl->CurrentFrameTimeTicks(); | 1153 monotonic_time = impl().layer_tree_host_impl->CurrentFrameTimeTicks(); |
1154 | 1154 |
1155 // TODO(ajuma): Remove wall_clock_time once the legacy implementation of | |
1156 // animations in Blink is removed. | |
1157 base::Time wall_clock_time = impl().layer_tree_host_impl->CurrentFrameTime(); | |
1158 | |
1159 // TODO(enne): This should probably happen post-animate. | 1155 // TODO(enne): This should probably happen post-animate. |
1160 if (impl().layer_tree_host_impl->pending_tree()) | 1156 if (impl().layer_tree_host_impl->pending_tree()) |
1161 impl().layer_tree_host_impl->pending_tree()->UpdateDrawProperties(); | 1157 impl().layer_tree_host_impl->pending_tree()->UpdateDrawProperties(); |
1162 impl().layer_tree_host_impl->Animate(monotonic_time, wall_clock_time); | 1158 impl().layer_tree_host_impl->Animate(monotonic_time); |
1163 | 1159 |
1164 // This method is called on a forced draw, regardless of whether we are able | 1160 // This method is called on a forced draw, regardless of whether we are able |
1165 // to produce a frame, as the calling site on main thread is blocked until its | 1161 // to produce a frame, as the calling site on main thread is blocked until its |
1166 // request completes, and we signal completion here. If CanDraw() is false, we | 1162 // request completes, and we signal completion here. If CanDraw() is false, we |
1167 // will indicate success=false to the caller, but we must still signal | 1163 // will indicate success=false to the caller, but we must still signal |
1168 // completion to avoid deadlock. | 1164 // completion to avoid deadlock. |
1169 | 1165 |
1170 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 1166 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
1171 // frame, so can only be used when such a frame is possible. Since | 1167 // frame, so can only be used when such a frame is possible. Since |
1172 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 1168 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 | 1728 |
1733 impl().timing_history.DidActivatePendingTree(); | 1729 impl().timing_history.DidActivatePendingTree(); |
1734 } | 1730 } |
1735 | 1731 |
1736 void ThreadProxy::DidManageTiles() { | 1732 void ThreadProxy::DidManageTiles() { |
1737 DCHECK(IsImplThread()); | 1733 DCHECK(IsImplThread()); |
1738 impl().scheduler->DidManageTiles(); | 1734 impl().scheduler->DidManageTiles(); |
1739 } | 1735 } |
1740 | 1736 |
1741 } // namespace cc | 1737 } // namespace cc |
OLD | NEW |