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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 | 678 |
679 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { | 679 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { |
680 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); | 680 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); |
681 } | 681 } |
682 begin_main_frame_state->memory_allocation_limit_bytes = | 682 begin_main_frame_state->memory_allocation_limit_bytes = |
683 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); | 683 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); |
684 begin_main_frame_state->memory_allocation_priority_cutoff = | 684 begin_main_frame_state->memory_allocation_priority_cutoff = |
685 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); | 685 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); |
686 begin_main_frame_state->evicted_ui_resources = | 686 begin_main_frame_state->evicted_ui_resources = |
687 impl().layer_tree_host_impl->EvictedUIResourcesExist(); | 687 impl().layer_tree_host_impl->EvictedUIResourcesExist(); |
| 688 impl().layer_tree_host_impl->SetBeginMainFrameTime( |
| 689 impl().scheduler->LastBeginImplFrameTime()); |
688 Proxy::MainThreadTaskRunner()->PostTask( | 690 Proxy::MainThreadTaskRunner()->PostTask( |
689 FROM_HERE, | 691 FROM_HERE, |
690 base::Bind(&ThreadProxy::BeginMainFrame, | 692 base::Bind(&ThreadProxy::BeginMainFrame, |
691 main_thread_weak_ptr_, | 693 main_thread_weak_ptr_, |
692 base::Passed(&begin_main_frame_state))); | 694 base::Passed(&begin_main_frame_state))); |
693 devtools_instrumentation::DidRequestMainThreadFrame( | 695 devtools_instrumentation::DidRequestMainThreadFrame( |
694 impl().layer_tree_host_id); | 696 impl().layer_tree_host_id); |
695 impl().timing_history.DidBeginMainFrame(); | 697 impl().timing_history.DidBeginMainFrame(); |
696 } | 698 } |
697 | 699 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 912 |
911 void ThreadProxy::BeginMainFrameAbortedOnImplThread( | 913 void ThreadProxy::BeginMainFrameAbortedOnImplThread( |
912 CommitEarlyOutReason reason) { | 914 CommitEarlyOutReason reason) { |
913 TRACE_EVENT1("cc", "ThreadProxy::BeginMainFrameAbortedOnImplThread", "reason", | 915 TRACE_EVENT1("cc", "ThreadProxy::BeginMainFrameAbortedOnImplThread", "reason", |
914 CommitEarlyOutReasonToString(reason)); | 916 CommitEarlyOutReasonToString(reason)); |
915 DCHECK(IsImplThread()); | 917 DCHECK(IsImplThread()); |
916 DCHECK(impl().scheduler); | 918 DCHECK(impl().scheduler); |
917 DCHECK(impl().scheduler->CommitPending()); | 919 DCHECK(impl().scheduler->CommitPending()); |
918 DCHECK(!impl().layer_tree_host_impl->pending_tree()); | 920 DCHECK(!impl().layer_tree_host_impl->pending_tree()); |
919 | 921 |
920 if (CommitEarlyOutHandledCommit(reason)) | 922 if (CommitEarlyOutHandledCommit(reason)) { |
921 SetInputThrottledUntilCommitOnImplThread(false); | 923 SetInputThrottledUntilCommitOnImplThread(false); |
| 924 impl().layer_tree_host_impl->RecordMainFrameTiming(); |
| 925 } |
922 impl().layer_tree_host_impl->BeginMainFrameAborted(reason); | 926 impl().layer_tree_host_impl->BeginMainFrameAborted(reason); |
923 impl().scheduler->BeginMainFrameAborted(reason); | 927 impl().scheduler->BeginMainFrameAborted(reason); |
924 } | 928 } |
925 | 929 |
926 void ThreadProxy::ScheduledActionAnimate() { | 930 void ThreadProxy::ScheduledActionAnimate() { |
927 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); | 931 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionAnimate"); |
928 DCHECK(IsImplThread()); | 932 DCHECK(IsImplThread()); |
929 | 933 |
930 // Don't animate if there is no root layer. | 934 // Don't animate if there is no root layer. |
931 // TODO(mithro): Both Animate and UpdateAnimationState already have a | 935 // TODO(mithro): Both Animate and UpdateAnimationState already have a |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 impl().scheduler->DidPrepareTiles(); | 1371 impl().scheduler->DidPrepareTiles(); |
1368 } | 1372 } |
1369 | 1373 |
1370 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1374 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1371 DCHECK(IsImplThread()); | 1375 DCHECK(IsImplThread()); |
1372 Proxy::MainThreadTaskRunner()->PostTask( | 1376 Proxy::MainThreadTaskRunner()->PostTask( |
1373 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1377 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1374 main_thread_weak_ptr_)); | 1378 main_thread_weak_ptr_)); |
1375 } | 1379 } |
1376 | 1380 |
| 1381 base::TimeTicks ThreadProxy::GetNextBeginImplFrameTimeIfRequested() const { |
| 1382 DCHECK(IsImplThread()); |
| 1383 return impl().scheduler->NextBeginImplFrameTimeIfRequested(); |
| 1384 } |
| 1385 |
1377 } // namespace cc | 1386 } // namespace cc |
OLD | NEW |