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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); | 945 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); |
946 DCHECK(IsImplThread()); | 946 DCHECK(IsImplThread()); |
947 | 947 |
948 // Don't animate if there is no root layer. | 948 // Don't animate if there is no root layer. |
949 // TODO(mithro): Both Animate and UpdateAnimationState already have a | 949 // TODO(mithro): Both Animate and UpdateAnimationState already have a |
950 // "!active_tree_->root_layer()" check? | 950 // "!active_tree_->root_layer()" check? |
951 if (!impl().layer_tree_host_impl->active_tree()->root_layer()) { | 951 if (!impl().layer_tree_host_impl->active_tree()->root_layer()) { |
952 return; | 952 return; |
953 } | 953 } |
954 | 954 |
955 impl().animation_time = | 955 base::TimeTicks animation_time = |
956 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time; | 956 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time; |
957 impl().layer_tree_host_impl->Animate(impl().animation_time); | 957 impl().layer_tree_host_impl->Animate(animation_time); |
958 | 958 |
959 // If animations are not visible, update the state now as | 959 // If animations are not visible, update the state now as |
960 // ScheduledActionDrawAndSwapIfPossible will never be called. | 960 // ScheduledActionDrawAndSwapIfPossible will never be called. |
961 if (!impl().layer_tree_host_impl->AnimationsAreVisible()) { | 961 if (!impl().layer_tree_host_impl->AnimationsAreVisible()) { |
962 impl().layer_tree_host_impl->UpdateAnimationState(true); | 962 impl().layer_tree_host_impl->UpdateAnimationState(true); |
963 } | 963 } |
964 } | 964 } |
965 | 965 |
| 966 void ThreadProxy::ScheduledActionCustomMutate() { |
| 967 // ... |
| 968 base::TimeTicks frame_time = |
| 969 impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time; |
| 970 impl().layer_tree_host_impl->ApplyCustomMutations(frame_time); |
| 971 // ... |
| 972 } |
| 973 |
966 void ThreadProxy::ScheduledActionCommit() { | 974 void ThreadProxy::ScheduledActionCommit() { |
967 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); | 975 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); |
968 DCHECK(IsImplThread()); | 976 DCHECK(IsImplThread()); |
969 DCHECK(IsMainThreadBlocked()); | 977 DCHECK(IsMainThreadBlocked()); |
970 DCHECK(impl().commit_completion_event); | 978 DCHECK(impl().commit_completion_event); |
971 DCHECK(impl().current_resource_update_controller); | 979 DCHECK(impl().current_resource_update_controller); |
972 | 980 |
973 // Complete all remaining texture updates. | 981 // Complete all remaining texture updates. |
974 impl().current_resource_update_controller->Finalize(); | 982 impl().current_resource_update_controller->Finalize(); |
975 impl().current_resource_update_controller = nullptr; | 983 impl().current_resource_update_controller = nullptr; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 } | 1371 } |
1364 | 1372 |
1365 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1373 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1366 DCHECK(IsImplThread()); | 1374 DCHECK(IsImplThread()); |
1367 Proxy::MainThreadTaskRunner()->PostTask( | 1375 Proxy::MainThreadTaskRunner()->PostTask( |
1368 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1376 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1369 main_thread_weak_ptr_)); | 1377 main_thread_weak_ptr_)); |
1370 } | 1378 } |
1371 | 1379 |
1372 } // namespace cc | 1380 } // namespace cc |
OLD | NEW |