| 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 completion->Signal(); | 687 completion->Signal(); |
| 688 } | 688 } |
| 689 | 689 |
| 690 void ThreadProxy::ScheduledActionSendBeginMainFrame() { | 690 void ThreadProxy::ScheduledActionSendBeginMainFrame() { |
| 691 unsigned int begin_frame_id = nextBeginFrameId++; | 691 unsigned int begin_frame_id = nextBeginFrameId++; |
| 692 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( | 692 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( |
| 693 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); | 693 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); |
| 694 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( | 694 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( |
| 695 new BeginMainFrameAndCommitState); | 695 new BeginMainFrameAndCommitState); |
| 696 begin_main_frame_state->begin_frame_id = begin_frame_id; | 696 begin_main_frame_state->begin_frame_id = begin_frame_id; |
| 697 begin_main_frame_state->monotonic_frame_begin_time = | 697 begin_main_frame_state->begin_frame_args = |
| 698 impl().layer_tree_host_impl->CurrentFrameTimeTicks(); | 698 impl().layer_tree_host_impl->CurrentBeginFrameArgs(); |
| 699 begin_main_frame_state->scroll_info = | 699 begin_main_frame_state->scroll_info = |
| 700 impl().layer_tree_host_impl->ProcessScrollDeltas(); | 700 impl().layer_tree_host_impl->ProcessScrollDeltas(); |
| 701 | 701 |
| 702 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { | 702 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { |
| 703 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); | 703 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); |
| 704 } | 704 } |
| 705 begin_main_frame_state->memory_allocation_limit_bytes = | 705 begin_main_frame_state->memory_allocation_limit_bytes = |
| 706 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); | 706 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); |
| 707 begin_main_frame_state->memory_allocation_priority_cutoff = | 707 begin_main_frame_state->memory_allocation_priority_cutoff = |
| 708 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); | 708 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // here so that any animation requests generated by the apply or animate | 775 // here so that any animation requests generated by the apply or animate |
| 776 // callbacks will trigger another frame. | 776 // callbacks will trigger another frame. |
| 777 main().commit_requested = true; | 777 main().commit_requested = true; |
| 778 main().commit_request_sent_to_impl_thread = true; | 778 main().commit_request_sent_to_impl_thread = true; |
| 779 | 779 |
| 780 layer_tree_host()->ApplyScrollAndScale( | 780 layer_tree_host()->ApplyScrollAndScale( |
| 781 begin_main_frame_state->scroll_info.get()); | 781 begin_main_frame_state->scroll_info.get()); |
| 782 | 782 |
| 783 layer_tree_host()->WillBeginMainFrame(); | 783 layer_tree_host()->WillBeginMainFrame(); |
| 784 | 784 |
| 785 layer_tree_host()->UpdateClientAnimations( | 785 layer_tree_host()->BeginMainFrame(begin_main_frame_state->begin_frame_args); |
| 786 begin_main_frame_state->monotonic_frame_begin_time); | |
| 787 layer_tree_host()->AnimateLayers( | 786 layer_tree_host()->AnimateLayers( |
| 788 begin_main_frame_state->monotonic_frame_begin_time); | 787 begin_main_frame_state->begin_frame_args.frame_time); |
| 789 blocked_main().last_monotonic_frame_begin_time = | 788 blocked_main().last_monotonic_frame_begin_time = |
| 790 begin_main_frame_state->monotonic_frame_begin_time; | 789 begin_main_frame_state->begin_frame_args.frame_time; |
| 791 | 790 |
| 792 // Unlink any backings that the impl thread has evicted, so that we know to | 791 // Unlink any backings that the impl thread has evicted, so that we know to |
| 793 // re-paint them in UpdateLayers. | 792 // re-paint them in UpdateLayers. |
| 794 if (blocked_main().contents_texture_manager()) { | 793 if (blocked_main().contents_texture_manager()) { |
| 795 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings(); | 794 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings(); |
| 796 | 795 |
| 797 blocked_main().contents_texture_manager()->SetMaxMemoryLimitBytes( | 796 blocked_main().contents_texture_manager()->SetMaxMemoryLimitBytes( |
| 798 begin_main_frame_state->memory_allocation_limit_bytes); | 797 begin_main_frame_state->memory_allocation_limit_bytes); |
| 799 blocked_main().contents_texture_manager()->SetExternalPriorityCutoff( | 798 blocked_main().contents_texture_manager()->SetExternalPriorityCutoff( |
| 800 begin_main_frame_state->memory_allocation_priority_cutoff); | 799 begin_main_frame_state->memory_allocation_priority_cutoff); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 impl().layer_tree_host_impl->BeginMainFrameAborted(did_handle); | 951 impl().layer_tree_host_impl->BeginMainFrameAborted(did_handle); |
| 953 impl().scheduler->BeginMainFrameAborted(did_handle); | 952 impl().scheduler->BeginMainFrameAborted(did_handle); |
| 954 } | 953 } |
| 955 | 954 |
| 956 void ThreadProxy::ScheduledActionAnimate() { | 955 void ThreadProxy::ScheduledActionAnimate() { |
| 957 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); | 956 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); |
| 958 DCHECK(IsImplThread()); | 957 DCHECK(IsImplThread()); |
| 959 | 958 |
| 960 if (!impl().animations_frozen_until_next_draw) { | 959 if (!impl().animations_frozen_until_next_draw) { |
| 961 impl().animation_time = | 960 impl().animation_time = |
| 962 impl().layer_tree_host_impl->CurrentFrameTimeTicks(); | 961 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time; |
| 963 } | 962 } |
| 964 impl().layer_tree_host_impl->Animate(impl().animation_time); | 963 impl().layer_tree_host_impl->Animate(impl().animation_time); |
| 965 impl().did_commit_after_animating = false; | 964 impl().did_commit_after_animating = false; |
| 966 } | 965 } |
| 967 | 966 |
| 968 void ThreadProxy::ScheduledActionCommit() { | 967 void ThreadProxy::ScheduledActionCommit() { |
| 969 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); | 968 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); |
| 970 DCHECK(IsImplThread()); | 969 DCHECK(IsImplThread()); |
| 971 DCHECK(IsMainThreadBlocked()); | 970 DCHECK(IsMainThreadBlocked()); |
| 972 DCHECK(impl().commit_completion_event); | 971 DCHECK(impl().commit_completion_event); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 | 1161 |
| 1163 base::TimeDelta ThreadProxy::BeginMainFrameToCommitDurationEstimate() { | 1162 base::TimeDelta ThreadProxy::BeginMainFrameToCommitDurationEstimate() { |
| 1164 return impl().timing_history.BeginMainFrameToCommitDurationEstimate(); | 1163 return impl().timing_history.BeginMainFrameToCommitDurationEstimate(); |
| 1165 } | 1164 } |
| 1166 | 1165 |
| 1167 base::TimeDelta ThreadProxy::CommitToActivateDurationEstimate() { | 1166 base::TimeDelta ThreadProxy::CommitToActivateDurationEstimate() { |
| 1168 return impl().timing_history.CommitToActivateDurationEstimate(); | 1167 return impl().timing_history.CommitToActivateDurationEstimate(); |
| 1169 } | 1168 } |
| 1170 | 1169 |
| 1171 void ThreadProxy::DidBeginImplFrameDeadline() { | 1170 void ThreadProxy::DidBeginImplFrameDeadline() { |
| 1172 impl().layer_tree_host_impl->ResetCurrentFrameTimeForNextFrame(); | 1171 impl().layer_tree_host_impl->ResetCurrentBeginFrameArgsForNextFrame(); |
| 1173 } | 1172 } |
| 1174 | 1173 |
| 1175 void ThreadProxy::ReadyToFinalizeTextureUpdates() { | 1174 void ThreadProxy::ReadyToFinalizeTextureUpdates() { |
| 1176 DCHECK(IsImplThread()); | 1175 DCHECK(IsImplThread()); |
| 1177 impl().scheduler->NotifyReadyToCommit(); | 1176 impl().scheduler->NotifyReadyToCommit(); |
| 1178 } | 1177 } |
| 1179 | 1178 |
| 1180 void ThreadProxy::DidCommitAndDrawFrame() { | 1179 void ThreadProxy::DidCommitAndDrawFrame() { |
| 1181 DCHECK(IsMainThread()); | 1180 DCHECK(IsMainThread()); |
| 1182 layer_tree_host()->DidCommitAndDrawFrame(); | 1181 layer_tree_host()->DidCommitAndDrawFrame(); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 | 1401 |
| 1403 impl().timing_history.DidActivateSyncTree(); | 1402 impl().timing_history.DidActivateSyncTree(); |
| 1404 } | 1403 } |
| 1405 | 1404 |
| 1406 void ThreadProxy::DidManageTiles() { | 1405 void ThreadProxy::DidManageTiles() { |
| 1407 DCHECK(IsImplThread()); | 1406 DCHECK(IsImplThread()); |
| 1408 impl().scheduler->DidManageTiles(); | 1407 impl().scheduler->DidManageTiles(); |
| 1409 } | 1408 } |
| 1410 | 1409 |
| 1411 } // namespace cc | 1410 } // namespace cc |
| OLD | NEW |