| Index: cc/layer_impl.cc
|
| diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
|
| index c9c41c17f34a8f32f42069d00e25468ad082ab5e..55f49ba69a01d053a97b2b30496827313b8978c5 100644
|
| --- a/cc/layer_impl.cc
|
| +++ b/cc/layer_impl.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/debug/trace_event.h"
|
| #include "base/stringprintf.h"
|
| +#include "base/values.h"
|
| #include "cc/debug_border_draw_quad.h"
|
| #include "cc/debug_colors.h"
|
| #include "cc/layer_tree_host_impl.h"
|
| @@ -347,6 +348,41 @@ void LayerImpl::dumpLayer(std::string* str, int indent) const
|
| m_children[i]->dumpLayer(str, indent+1);
|
| }
|
|
|
| +base::DictionaryValue* LayerImpl::layerTreeAsJson() const
|
| +{
|
| + base::ListValue* list;
|
| + base::DictionaryValue* result = new base::DictionaryValue;
|
| + result->SetString("LayerType", layerTypeAsString());
|
| +
|
| + list = new base::ListValue;
|
| + list->AppendInteger(bounds().width());
|
| + list->AppendInteger(bounds().height());
|
| + result->Set("Bounds", list);
|
| +
|
| + list = new base::ListValue;
|
| + list->AppendDouble(m_position.x());
|
| + list->AppendDouble(m_position.y());
|
| + result->Set("Position", list);
|
| +
|
| + const gfx::Transform& gfxTransform = m_drawProperties.target_space_transform;
|
| + double transform[16];
|
| + gfxTransform.matrix().asColMajord(transform);
|
| + list = new base::ListValue;
|
| + for (int i = 0; i < 16; ++i)
|
| + list->AppendDouble(transform[i]);
|
| + result->Set("DrawTransform", list);
|
| +
|
| + result->SetBoolean("DrawsContent", m_drawsContent);
|
| + result->SetDouble("Opacity", opacity());
|
| +
|
| + list = new base::ListValue;
|
| + for (size_t i = 0; i < m_children.size(); ++i)
|
| + list->Append(m_children[i]->layerTreeAsJson());
|
| + result->Set("Children", list);
|
| +
|
| + return result;
|
| +}
|
| +
|
| void LayerImpl::setStackingOrderChanged(bool stackingOrderChanged)
|
| {
|
| // We don't need to store this flag; we only need to track that the change occurred.
|
|
|