Index: cc/tile.cc |
diff --git a/cc/tile.cc b/cc/tile.cc |
index 7cb4bec83352281234a5d0c247a323e8aede0c10..bfc9be98d9f0aada0fe40a141fc189b19471abd1 100644 |
--- a/cc/tile.cc |
+++ b/cc/tile.cc |
@@ -4,6 +4,7 @@ |
#include "cc/tile.h" |
+#include "base/stringprintf.h" |
#include "cc/tile_manager.h" |
#include "third_party/khronos/GLES2/gl2.h" |
@@ -33,6 +34,17 @@ void Tile::set_priority(WhichTree tree, const TilePriority& priority) { |
priority_[tree] = priority; |
} |
+scoped_ptr<base::Value> Tile::AsValue() const { |
+ scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); |
+ res->SetString("picture_pile", base::StringPrintf("%p", |
+ picture_pile_.get())); |
+ res->SetDouble("contents_scale", contents_scale_); |
+ res->Set("priority.0", priority_[ACTIVE_TREE].AsValue().release()); |
+ res->Set("priority.1", priority_[PENDING_TREE].AsValue().release()); |
+ res->Set("managed_state", managed_state_.AsValue().release()); |
+ return res.PassAs<base::Value>(); |
+} |
+ |
ResourceProvider::ResourceId Tile::GetResourceId() const { |
if (!managed_state_.resource) |
return 0; |