summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host_impl.cc21
-rw-r--r--cc/trees/single_thread_proxy.cc1
-rw-r--r--cc/trees/thread_proxy.cc7
3 files changed, 20 insertions, 9 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 720febd..5fcc2b0 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1226,24 +1226,25 @@ static void LayerTreeHostImplDidBeginTracingCallback(LayerImpl* layer) {
void LayerTreeHostImpl::DrawLayers(FrameData* frame,
base::TimeTicks frame_begin_time) {
- TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers");
+ TRACE_EVENT_BEGIN0("cc", "LayerTreeHostImpl::DrawLayers");
DCHECK(CanDraw());
if (frame->has_no_damage) {
TRACE_EVENT0("cc", "EarlyOut_NoDamage");
DCHECK(!output_surface_->capabilities()
.draw_and_swap_full_viewport_every_frame);
+ TRACE_EVENT_END0("cc", "LayerTreeHostImpl::DrawLayers");
return;
}
DCHECK(!frame->render_passes.empty());
+ int old_dropped_frame_count = fps_counter_->dropped_frame_count();
fps_counter_->SaveTimeStamp(frame_begin_time);
- rendering_stats_instrumentation_->SetScreenFrameCount(
- fps_counter_->current_frame_number());
- rendering_stats_instrumentation_->SetDroppedFrameCount(
- fps_counter_->dropped_frame_count());
+ rendering_stats_instrumentation_->IncrementScreenFrameCount(1);
+ rendering_stats_instrumentation_->IncrementDroppedFrameCount(
+ fps_counter_->dropped_frame_count() - old_dropped_frame_count);
if (tile_manager_) {
memory_history_->SaveEntry(
@@ -1262,7 +1263,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
if (!settings_.impl_side_painting && debug_state_.continuous_painting) {
const RenderingStats& stats =
rendering_stats_instrumentation_->GetRenderingStats();
- paint_time_counter_->SavePaintTime(stats.total_paint_time);
+ paint_time_counter_->SavePaintTime(stats.main_stats.paint_time);
}
bool is_new_trace;
@@ -1307,6 +1308,10 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
DidDrawDamagedArea();
}
active_tree_->root_layer()->ResetAllChangeTrackingForSubtree();
+ TRACE_EVENT_END1("cc", "LayerTreeHostImpl::DrawLayers",
+ "data", rendering_stats_instrumentation_->
+ GetImplThreadRenderingStats().AsTraceableData());
+ rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats();
}
void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) {
@@ -1511,8 +1516,8 @@ void LayerTreeHostImpl::ActivatePendingTree() {
const RenderingStats& stats =
rendering_stats_instrumentation_->GetRenderingStats();
paint_time_counter_->SavePaintTime(
- stats.total_paint_time + stats.total_record_time +
- stats.total_rasterize_time_for_now_bins_on_pending_tree);
+ stats.main_stats.paint_time + stats.main_stats.record_time +
+ stats.impl_stats.rasterize_time_for_now_bins_on_pending_tree);
}
client_->DidActivatePendingTree();
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 3a26a07..65d7980 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -221,6 +221,7 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) {
base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
stats_instrumentation->AddCommit(duration);
+ stats_instrumentation->AccumulateAndClearMainThreadStats();
}
layer_tree_host_->CommitComplete();
next_frame_is_newly_committed_frame_ = true;
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index a0bd4bf..31a497a 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -695,6 +695,7 @@ void ThreadProxy::BeginFrameOnMainThread(
scoped_ptr<BeginFrameAndCommitState> begin_frame_state) {
TRACE_EVENT0("cc", "ThreadProxy::BeginFrameOnMainThread");
DCHECK(IsMainThread());
+
if (!layer_tree_host_)
return;
@@ -816,7 +817,7 @@ void ThreadProxy::BeginFrameOnMainThread(
// point of view, but asynchronously performed on the impl thread,
// coordinated by the Scheduler.
{
- TRACE_EVENT0("cc", "ThreadProxy::BeginFrameOnMainThread::commit");
+ TRACE_EVENT_BEGIN0("cc", "ThreadProxy::BeginFrameOnMainThread::commit");
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
@@ -836,6 +837,10 @@ void ThreadProxy::BeginFrameOnMainThread(
base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
stats_instrumentation->AddCommit(duration);
+ TRACE_EVENT_END1("cc", "ThreadProxy::BeginFrameOnMainThread::commit",
+ "data", stats_instrumentation->
+ GetMainThreadRenderingStats().AsTraceableData());
+ stats_instrumentation->AccumulateAndClearMainThreadStats();
}
layer_tree_host_->CommitComplete();