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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 // sync tree has already activated if there was no work to be done. | 905 // sync tree has already activated if there was no work to be done. |
906 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); | 906 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); |
907 impl().completion_event_for_commit_held_on_tree_activation = | 907 impl().completion_event_for_commit_held_on_tree_activation = |
908 impl().commit_completion_event; | 908 impl().commit_completion_event; |
909 impl().commit_completion_event = NULL; | 909 impl().commit_completion_event = NULL; |
910 } else { | 910 } else { |
911 impl().commit_completion_event->Signal(); | 911 impl().commit_completion_event->Signal(); |
912 impl().commit_completion_event = NULL; | 912 impl().commit_completion_event = NULL; |
913 } | 913 } |
914 | 914 |
915 impl().scheduler->DidCommit(); | |
916 | |
917 // Delay this step until afer the main thread has been released as it's | 915 // Delay this step until afer the main thread has been released as it's |
918 // often a good bit of work to update the tree and prepare the new frame. | 916 // often a good bit of work to update the tree and prepare the new frame. |
919 impl().layer_tree_host_impl->CommitComplete(); | 917 impl().layer_tree_host_impl->CommitComplete(); |
920 | 918 |
921 SetInputThrottledUntilCommitOnImplThread(false); | 919 SetInputThrottledUntilCommitOnImplThread(false); |
922 | 920 |
923 impl().next_frame_is_newly_committed_frame = true; | 921 impl().next_frame_is_newly_committed_frame = true; |
924 } | 922 } |
925 | 923 |
926 void ThreadProxy::ScheduledActionActivateSyncTree() { | 924 void ThreadProxy::ScheduledActionActivateSyncTree() { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 TRACE_EVENT_INSTANT0( | 1231 TRACE_EVENT_INSTANT0( |
1234 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); | 1232 "cc", "ReleaseCommitbyActivation", TRACE_EVENT_SCOPE_THREAD); |
1235 impl().completion_event_for_commit_held_on_tree_activation->Signal(); | 1233 impl().completion_event_for_commit_held_on_tree_activation->Signal(); |
1236 impl().completion_event_for_commit_held_on_tree_activation = NULL; | 1234 impl().completion_event_for_commit_held_on_tree_activation = NULL; |
1237 } | 1235 } |
1238 | 1236 |
1239 impl().last_processed_begin_main_frame_args = | 1237 impl().last_processed_begin_main_frame_args = |
1240 impl().last_begin_main_frame_args; | 1238 impl().last_begin_main_frame_args; |
1241 } | 1239 } |
1242 | 1240 |
1243 void ThreadProxy::WillPrepareTiles() { | |
1244 DCHECK(IsImplThread()); | |
1245 impl().scheduler->WillPrepareTiles(); | |
1246 } | |
1247 | |
1248 void ThreadProxy::DidPrepareTiles() { | 1241 void ThreadProxy::DidPrepareTiles() { |
1249 DCHECK(IsImplThread()); | 1242 DCHECK(IsImplThread()); |
1250 impl().scheduler->DidPrepareTiles(); | 1243 impl().scheduler->DidPrepareTiles(); |
1251 } | 1244 } |
1252 | 1245 |
1253 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1246 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1254 DCHECK(IsImplThread()); | 1247 DCHECK(IsImplThread()); |
1255 Proxy::MainThreadTaskRunner()->PostTask( | 1248 Proxy::MainThreadTaskRunner()->PostTask( |
1256 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1249 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1257 main_thread_weak_ptr_)); | 1250 main_thread_weak_ptr_)); |
(...skipping 17 matching lines...) Expand all Loading... |
1275 | 1268 |
1276 void ThreadProxy::PostFrameTimingEvents( | 1269 void ThreadProxy::PostFrameTimingEvents( |
1277 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 1270 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
1278 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { | 1271 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
1279 DCHECK(IsMainThread()); | 1272 DCHECK(IsMainThread()); |
1280 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), | 1273 layer_tree_host()->RecordFrameTimingEvents(composite_events.Pass(), |
1281 main_frame_events.Pass()); | 1274 main_frame_events.Pass()); |
1282 } | 1275 } |
1283 | 1276 |
1284 } // namespace cc | 1277 } // namespace cc |
OLD | NEW |