| 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 b263f2f4173bad34cd1030a755453ce70afa6597..832e8b3356a0eccc78a933e18366d6fa9d9eb1b4 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"
|
| @@ -435,6 +436,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();
|
| @@ -1256,7 +1276,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
|
|
|
| TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
|
| TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", this,
|
| - 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
|
| @@ -2407,7 +2427,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());
|
| @@ -2418,6 +2439,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>();
|
| }
|
|
|
|
|