Chromium Code Reviews| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 completion->Signal(); | 700 completion->Signal(); |
| 701 } | 701 } |
| 702 | 702 |
| 703 void ThreadProxy::ScheduledActionSendBeginMainFrame() { | 703 void ThreadProxy::ScheduledActionSendBeginMainFrame() { |
| 704 unsigned int begin_frame_id = nextBeginFrameId++; | 704 unsigned int begin_frame_id = nextBeginFrameId++; |
| 705 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( | 705 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( |
| 706 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); | 706 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); |
| 707 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( | 707 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( |
| 708 new BeginMainFrameAndCommitState); | 708 new BeginMainFrameAndCommitState); |
| 709 begin_main_frame_state->begin_frame_id = begin_frame_id; | 709 begin_main_frame_state->begin_frame_id = begin_frame_id; |
| 710 begin_main_frame_state->monotonic_frame_begin_time = | 710 begin_main_frame_state->begin_frame_args = |
| 711 impl().layer_tree_host_impl->CurrentFrameTimeTicks(); | 711 impl().layer_tree_host_impl->CurrentBeginFrameArgs(); |
| 712 begin_main_frame_state->scroll_info = | 712 begin_main_frame_state->scroll_info = |
| 713 impl().layer_tree_host_impl->ProcessScrollDeltas(); | 713 impl().layer_tree_host_impl->ProcessScrollDeltas(); |
| 714 | 714 |
| 715 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { | 715 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { |
| 716 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); | 716 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); |
| 717 } | 717 } |
| 718 begin_main_frame_state->memory_allocation_limit_bytes = | 718 begin_main_frame_state->memory_allocation_limit_bytes = |
| 719 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); | 719 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); |
| 720 begin_main_frame_state->memory_allocation_priority_cutoff = | 720 begin_main_frame_state->memory_allocation_priority_cutoff = |
| 721 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); | 721 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 // On the other hand, the animate_requested flag should remain cleared | 787 // On the other hand, the animate_requested flag should remain cleared |
| 788 // here so that any animation requests generated by the apply or animate | 788 // here so that any animation requests generated by the apply or animate |
| 789 // callbacks will trigger another frame. | 789 // callbacks will trigger another frame. |
| 790 main().commit_requested = true; | 790 main().commit_requested = true; |
| 791 main().commit_request_sent_to_impl_thread = true; | 791 main().commit_request_sent_to_impl_thread = true; |
| 792 | 792 |
| 793 layer_tree_host()->ApplyScrollAndScale(*begin_main_frame_state->scroll_info); | 793 layer_tree_host()->ApplyScrollAndScale(*begin_main_frame_state->scroll_info); |
| 794 | 794 |
| 795 layer_tree_host()->WillBeginMainFrame(); | 795 layer_tree_host()->WillBeginMainFrame(); |
| 796 | 796 |
| 797 layer_tree_host()->UpdateClientAnimations( | 797 layer_tree_host()->BeginMainFrame(begin_main_frame_state->begin_frame_args); |
|
mithro-old
2014/08/11 07:33:33
Another Animate verses BeginMainFrame.
Here it se
Sami
2014/08/11 17:51:26
Yes, that's how I figured.
| |
| 798 begin_main_frame_state->monotonic_frame_begin_time); | |
| 799 layer_tree_host()->AnimateLayers( | 798 layer_tree_host()->AnimateLayers( |
| 800 begin_main_frame_state->monotonic_frame_begin_time); | 799 begin_main_frame_state->begin_frame_args.frame_time); |
| 801 blocked_main().last_monotonic_frame_begin_time = | 800 blocked_main().last_monotonic_frame_begin_time = |
| 802 begin_main_frame_state->monotonic_frame_begin_time; | 801 begin_main_frame_state->begin_frame_args.frame_time; |
| 803 | 802 |
| 804 // Unlink any backings that the impl thread has evicted, so that we know to | 803 // Unlink any backings that the impl thread has evicted, so that we know to |
| 805 // re-paint them in UpdateLayers. | 804 // re-paint them in UpdateLayers. |
| 806 if (blocked_main().contents_texture_manager()) { | 805 if (blocked_main().contents_texture_manager()) { |
| 807 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings(); | 806 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings(); |
| 808 | 807 |
| 809 blocked_main().contents_texture_manager()->SetMaxMemoryLimitBytes( | 808 blocked_main().contents_texture_manager()->SetMaxMemoryLimitBytes( |
| 810 begin_main_frame_state->memory_allocation_limit_bytes); | 809 begin_main_frame_state->memory_allocation_limit_bytes); |
| 811 blocked_main().contents_texture_manager()->SetExternalPriorityCutoff( | 810 blocked_main().contents_texture_manager()->SetExternalPriorityCutoff( |
| 812 begin_main_frame_state->memory_allocation_priority_cutoff); | 811 begin_main_frame_state->memory_allocation_priority_cutoff); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 964 impl().layer_tree_host_impl->BeginMainFrameAborted(did_handle); | 963 impl().layer_tree_host_impl->BeginMainFrameAborted(did_handle); |
| 965 impl().scheduler->BeginMainFrameAborted(did_handle); | 964 impl().scheduler->BeginMainFrameAborted(did_handle); |
| 966 } | 965 } |
| 967 | 966 |
| 968 void ThreadProxy::ScheduledActionAnimate() { | 967 void ThreadProxy::ScheduledActionAnimate() { |
| 969 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); | 968 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); |
| 970 DCHECK(IsImplThread()); | 969 DCHECK(IsImplThread()); |
| 971 | 970 |
| 972 if (!impl().animations_frozen_until_next_draw) { | 971 if (!impl().animations_frozen_until_next_draw) { |
| 973 impl().animation_time = | 972 impl().animation_time = |
| 974 impl().layer_tree_host_impl->CurrentFrameTimeTicks(); | 973 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time; |
| 975 } | 974 } |
| 976 impl().layer_tree_host_impl->Animate(impl().animation_time); | 975 impl().layer_tree_host_impl->Animate(impl().animation_time); |
| 977 impl().did_commit_after_animating = false; | 976 impl().did_commit_after_animating = false; |
| 978 } | 977 } |
| 979 | 978 |
| 980 void ThreadProxy::ScheduledActionCommit() { | 979 void ThreadProxy::ScheduledActionCommit() { |
| 981 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); | 980 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); |
| 982 DCHECK(IsImplThread()); | 981 DCHECK(IsImplThread()); |
| 983 DCHECK(IsMainThreadBlocked()); | 982 DCHECK(IsMainThreadBlocked()); |
| 984 DCHECK(impl().commit_completion_event); | 983 DCHECK(impl().commit_completion_event); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1413 | 1412 |
| 1414 impl().timing_history.DidActivateSyncTree(); | 1413 impl().timing_history.DidActivateSyncTree(); |
| 1415 } | 1414 } |
| 1416 | 1415 |
| 1417 void ThreadProxy::DidManageTiles() { | 1416 void ThreadProxy::DidManageTiles() { |
| 1418 DCHECK(IsImplThread()); | 1417 DCHECK(IsImplThread()); |
| 1419 impl().scheduler->DidManageTiles(); | 1418 impl().scheduler->DidManageTiles(); |
| 1420 } | 1419 } |
| 1421 | 1420 |
| 1422 } // namespace cc | 1421 } // namespace cc |
| OLD | NEW |