Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index c61e6bec0d0c99f7f90801f421dd448b928bb9cb..98a4e5f1910ea706c6b8f80ce5d520783d94706f 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -7,6 +7,7 @@ |
| #include <algorithm> |
| #include "base/basictypes.h" |
| +#include "base/containers/hash_tables.h" |
| #include "base/json/json_writer.h" |
| #include "base/metrics/histogram.h" |
| #include "base/stl_util.h" |
| @@ -437,6 +438,25 @@ void LayerTreeHostImpl::TrackDamageForAllSurfaces( |
| } |
| } |
| +scoped_ptr<base::Value> LayerTreeHostImpl::FrameData::AsValue() const { |
| + scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
| + value->SetBoolean("contains_incomplete_tile", contains_incomplete_tile); |
| + value->SetBoolean("has_no_damage", has_no_damage); |
| + |
| + // Quad data can be quite large, so only dump render passes if we select |
| + // cc.debug.quads. |
| + bool quads_enabled; |
| + TRACE_EVENT_CATEGORY_GROUP_ENABLED( |
| + TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), &quads_enabled); |
| + if (quads_enabled) { |
| + scoped_ptr<base::ListValue> render_pass_list(new base::ListValue()); |
| + for (size_t i = 0; i < render_passes.size(); ++i) |
| + render_pass_list->Append(render_passes[i]->AsValue().release()); |
| + value->Set("render_passes", render_pass_list.release()); |
| + } |
| + return value.PassAs<base::Value>(); |
| +} |
| + |
| void LayerTreeHostImpl::FrameData::AppendRenderPass( |
| scoped_ptr<RenderPass> render_pass) { |
| render_passes_by_id[render_pass->id] = render_pass.get(); |
| @@ -1258,7 +1278,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
| TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", this, |
|
nduca
2013/08/07 22:11:54
cc.debug,cc.debug.quads
piman
2013/08/09 04:18:20
I tried it, but it didn't seem to do the right thi
|
| - TracedValue::FromValue(AsValue().release())); |
| + TracedValue::FromValue(AsValueWithFrame(frame).release())); |
| // Because the contents of the HUD depend on everything else in the frame, the |
| // contents of its texture are updated as the last thing before the frame is |
| @@ -2430,7 +2450,8 @@ base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { |
| return base::TimeTicks::Now(); |
| } |
| -scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const { |
| +scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame( |
| + FrameData* frame) const { |
| scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| if (this->pending_tree_) |
| state->Set("activation_state", ActivationStateAsValue().release()); |
| @@ -2441,6 +2462,8 @@ scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const { |
| state->Set("active_tree", active_tree_->AsValue().release()); |
| if (pending_tree_) |
| state->Set("pending_tree", pending_tree_->AsValue().release()); |
| + if (frame) |
| + state->Set("frame", frame->AsValue().release()); |
| return state.PassAs<base::Value>(); |
| } |