| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 { | 858 { |
| 859 TRACE_EVENT0("cc", "ThreadProxy::BeginFrameOnMainThread::commit"); | 859 TRACE_EVENT0("cc", "ThreadProxy::BeginFrameOnMainThread::commit"); |
| 860 | 860 |
| 861 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 861 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 862 | 862 |
| 863 // This CapturePostTasks should be destroyed before CommitComplete() is | 863 // This CapturePostTasks should be destroyed before CommitComplete() is |
| 864 // called since that goes out to the embedder, and we want the embedder | 864 // called since that goes out to the embedder, and we want the embedder |
| 865 // to receive its callbacks before that. | 865 // to receive its callbacks before that. |
| 866 BlockingTaskRunner::CapturePostTasks blocked; | 866 BlockingTaskRunner::CapturePostTasks blocked; |
| 867 | 867 |
| 868 RenderingStatsInstrumentation* stats_instrumentation = | |
| 869 layer_tree_host_->rendering_stats_instrumentation(); | |
| 870 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | |
| 871 | |
| 872 CompletionEvent completion; | 868 CompletionEvent completion; |
| 873 Proxy::ImplThreadTaskRunner()->PostTask( | 869 Proxy::ImplThreadTaskRunner()->PostTask( |
| 874 FROM_HERE, | 870 FROM_HERE, |
| 875 base::Bind(&ThreadProxy::StartCommitOnImplThread, | 871 base::Bind(&ThreadProxy::StartCommitOnImplThread, |
| 876 impl_thread_weak_ptr_, | 872 impl_thread_weak_ptr_, |
| 877 &completion, | 873 &completion, |
| 878 queue.release(), | 874 queue.release(), |
| 879 offscreen_context_provider)); | 875 offscreen_context_provider)); |
| 880 completion.Wait(); | 876 completion.Wait(); |
| 881 | 877 |
| 882 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 878 RenderingStatsInstrumentation* stats_instrumentation = |
| 883 stats_instrumentation->AddCommit(duration); | 879 layer_tree_host_->rendering_stats_instrumentation(); |
| 884 stats_instrumentation->IssueTraceEventForMainThreadStats(); | 880 stats_instrumentation->IssueTraceEventForMainThreadStats(); |
| 885 stats_instrumentation->AccumulateAndClearMainThreadStats(); | 881 stats_instrumentation->AccumulateAndClearMainThreadStats(); |
| 886 } | 882 } |
| 887 | 883 |
| 888 layer_tree_host_->CommitComplete(); | 884 layer_tree_host_->CommitComplete(); |
| 889 layer_tree_host_->DidBeginFrame(); | 885 layer_tree_host_->DidBeginFrame(); |
| 890 } | 886 } |
| 891 | 887 |
| 892 void ThreadProxy::StartCommitOnImplThread( | 888 void ThreadProxy::StartCommitOnImplThread( |
| 893 CompletionEvent* completion, | 889 CompletionEvent* completion, |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1577 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1582 } | 1578 } |
| 1583 | 1579 |
| 1584 UpdateBackgroundAnimateTicking(); | 1580 UpdateBackgroundAnimateTicking(); |
| 1585 | 1581 |
| 1586 commit_to_activate_duration_history_.InsertSample( | 1582 commit_to_activate_duration_history_.InsertSample( |
| 1587 base::TimeTicks::HighResNow() - commit_complete_time_); | 1583 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1588 } | 1584 } |
| 1589 | 1585 |
| 1590 } // namespace cc | 1586 } // namespace cc |
| OLD | NEW |