diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 07:33:20 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 07:33:20 +0000 |
commit | ccc08dc2189aba7fc4a0eb42e122bc65d100d69a (patch) | |
tree | 06e1f93b85fbd6c473643255d1d97cce3f6e253a | |
parent | 5a49421b731b95ceb88871e81875d059b19ce3ca (diff) | |
download | chromium_src-ccc08dc2189aba7fc4a0eb42e122bc65d100d69a.zip chromium_src-ccc08dc2189aba7fc4a0eb42e122bc65d100d69a.tar.gz chromium_src-ccc08dc2189aba7fc4a0eb42e122bc65d100d69a.tar.bz2 |
cc: Add TRACE_EVENTs to SingleThreadProxy
This adds traces to entry points in SingleThreadProxy that have
analogous trace events in the ThreadProxy. Also add trace points
along the critical CompositeImmediately -> CommitAndComposite ->
DoCommit/DoComposite code path.
R=enne
BUG=339248
Review URL: https://codereview.chromium.org/149053006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247874 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/trees/single_thread_proxy.cc | 16 | ||||
-rw-r--r-- | cc/trees/thread_proxy.cc | 30 |
2 files changed, 31 insertions, 15 deletions
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index f3f028b..dcd4cf6 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -82,6 +82,7 @@ bool SingleThreadProxy::CompositeAndReadback(void* pixels, } void SingleThreadProxy::FinishAllRendering() { + TRACE_EVENT0("cc", "SingleThreadProxy::FinishAllRendering"); DCHECK(Proxy::IsMainThread()); { DebugScopedSetImplThread impl(this); @@ -95,11 +96,13 @@ bool SingleThreadProxy::IsStarted() const { } void SingleThreadProxy::SetLayerTreeHostClientReady() { + TRACE_EVENT0("cc", "SingleThreadProxy::SetLayerTreeHostClientReady"); // Scheduling is controlled by the embedder in the single thread case, so // nothing to do. } void SingleThreadProxy::SetVisible(bool visible) { + TRACE_EVENT0("cc", "SingleThreadProxy::SetVisible"); DebugScopedSetImplThread impl(this); layer_tree_host_impl_->SetVisible(visible); @@ -176,16 +179,19 @@ const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { } void SingleThreadProxy::SetNeedsAnimate() { + TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsAnimate"); DCHECK(Proxy::IsMainThread()); client_->ScheduleAnimation(); } void SingleThreadProxy::SetNeedsUpdateLayers() { + TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsUpdateLayers"); DCHECK(Proxy::IsMainThread()); client_->ScheduleComposite(); } void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { + TRACE_EVENT0("cc", "SingleThreadProxy::DoCommit"); DCHECK(Proxy::IsMainThread()); // Commit immediately. { @@ -245,6 +251,7 @@ void SingleThreadProxy::SetNeedsCommit() { } void SingleThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { + TRACE_EVENT0("cc", "SingleThreadProxy::SetNeedsRedraw"); SetNeedsRedrawRectOnImplThread(damage_rect); client_->ScheduleComposite(); } @@ -281,6 +288,8 @@ void SingleThreadProxy::Stop() { } void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { + TRACE_EVENT1( + "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); DCHECK(Proxy::IsImplThread()); UpdateBackgroundAnimateTicking(); } @@ -320,6 +329,8 @@ void SingleThreadProxy::SetNeedsCommitOnImplThread() { void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> events, base::Time wall_clock_time) { + TRACE_EVENT0( + "cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); DCHECK(Proxy::IsImplThread()); DebugScopedSetMainThread main(this); layer_tree_host_->SetAnimationEvents(events.Pass(), wall_clock_time); @@ -360,6 +371,7 @@ void SingleThreadProxy::SendManagedMemoryStats() { bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { + TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); // Cause a commit so we can notice the lost context. SetNeedsCommitOnImplThread(); client_->DidAbortSwapBuffers(); @@ -370,12 +382,14 @@ void SingleThreadProxy::DidSwapBuffersOnImplThread() { } void SingleThreadProxy::OnSwapBuffersCompleteOnImplThread() { + TRACE_EVENT0("cc", "SingleThreadProxy::OnSwapBuffersCompleteOnImplThread"); client_->DidCompleteSwapBuffers(); } // Called by the legacy scheduling path (e.g. where render_widget does the // scheduling) void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { + TRACE_EVENT0("cc", "SingleThreadProxy::CompositeImmediately"); gfx::Rect device_viewport_damage_rect; LayerTreeHostImpl::FrameData frame; @@ -431,6 +445,7 @@ bool SingleThreadProxy::CommitAndComposite( const gfx::Rect& device_viewport_damage_rect, bool for_readback, LayerTreeHostImpl::FrameData* frame) { + TRACE_EVENT0("cc", "SingleThreadProxy::CommitAndComposite"); DCHECK(Proxy::IsMainThread()); if (!layer_tree_host_->InitializeOutputSurfaceIfNeeded()) @@ -494,6 +509,7 @@ bool SingleThreadProxy::DoComposite( const gfx::Rect& device_viewport_damage_rect, bool for_readback, LayerTreeHostImpl::FrameData* frame) { + TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite"); DCHECK(!layer_tree_host_->output_surface_lost()); bool lost_output_surface = false; diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 5aa3533..1740e96 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -401,14 +401,14 @@ void ThreadProxy::SetNeedsCommit() { } void ThreadProxy::DidLoseOutputSurfaceOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread"); + DCHECK(IsImplThread()); CheckOutputSurfaceStatusOnImplThread(); } void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::CheckOutputSurfaceStatusOnImplThread"); + DCHECK(IsImplThread()); if (!impl().layer_tree_host_impl->IsContextLost()) return; if (ContextProvider* offscreen_contexts = @@ -418,23 +418,23 @@ void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() { } void ThreadProxy::OnSwapBuffersCompleteOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::OnSwapBuffersCompleteOnImplThread"); + DCHECK(IsImplThread()); Proxy::MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_)); } void ThreadProxy::SetNeedsBeginImplFrame(bool enable) { - DCHECK(IsImplThread()); TRACE_EVENT1("cc", "ThreadProxy::SetNeedsBeginImplFrame", "enable", enable); + DCHECK(IsImplThread()); impl().layer_tree_host_impl->SetNeedsBeginImplFrame(enable); UpdateBackgroundAnimateTicking(); } void ThreadProxy::BeginImplFrame(const BeginFrameArgs& args) { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::BeginImplFrame"); + DCHECK(IsImplThread()); // Sample the frame time now. This time will be used for updating animations // when we draw. @@ -444,9 +444,9 @@ void ThreadProxy::BeginImplFrame(const BeginFrameArgs& args) { } void ThreadProxy::OnCanDrawStateChanged(bool can_draw) { - DCHECK(IsImplThread()); TRACE_EVENT1( "cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); + DCHECK(IsImplThread()); impl().scheduler->SetCanDraw(can_draw); UpdateBackgroundAnimateTicking(); } @@ -457,17 +457,17 @@ void ThreadProxy::NotifyReadyToActivate() { } void ThreadProxy::SetNeedsCommitOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); + DCHECK(IsImplThread()); impl().scheduler->SetNeedsCommit(); } void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> events, base::Time wall_clock_time) { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); + DCHECK(IsImplThread()); Proxy::MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&ThreadProxy::SetAnimationEvents, @@ -524,8 +524,8 @@ void ThreadProxy::SendManagedMemoryStats() { bool ThreadProxy::IsInsideDraw() { return impl().inside_draw; } void ThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { - DCHECK(IsMainThread()); TRACE_EVENT0("cc", "ThreadProxy::SetNeedsRedraw"); + DCHECK(IsMainThread()); Proxy::ImplThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&ThreadProxy::SetNeedsRedrawRectOnImplThread, @@ -568,8 +568,8 @@ bool ThreadProxy::BeginMainFrameRequested() const { } void ThreadProxy::SetNeedsRedrawOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::SetNeedsRedrawOnImplThread"); + DCHECK(IsImplThread()); impl().scheduler->SetNeedsRedraw(); } @@ -596,8 +596,8 @@ void ThreadProxy::SetSwapUsedIncompleteTileOnImplThread( } void ThreadProxy::DidInitializeVisibleTileOnImplThread() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::DidInitializeVisibleTileOnImplThread"); + DCHECK(IsImplThread()); impl().scheduler->SetNeedsRedraw(); } @@ -1084,20 +1084,20 @@ void ThreadProxy::ScheduledActionCommit() { } void ThreadProxy::ScheduledActionUpdateVisibleTiles() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); + DCHECK(IsImplThread()); impl().layer_tree_host_impl->UpdateVisibleTiles(); } void ThreadProxy::ScheduledActionActivatePendingTree() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTree"); + DCHECK(IsImplThread()); impl().layer_tree_host_impl->ActivatePendingTree(); } void ThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionBeginOutputSurfaceCreation"); + DCHECK(IsImplThread()); Proxy::MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&ThreadProxy::CreateAndInitializeOutputSurface, @@ -1658,8 +1658,8 @@ void ThreadProxy::StartScrollbarAnimationOnImplThread() { } void ThreadProxy::DidActivatePendingTree() { - DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::DidActivatePendingTreeOnImplThread"); + DCHECK(IsImplThread()); if (impl().completion_event_for_commit_held_on_tree_activation && !impl().layer_tree_host_impl->pending_tree()) { |