Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1939)

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11446076: Added LayerTreeHostImpl::layerTreeAsJson which serializes a layer tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index c295e920432a6a22acd80869e3e09b513de998f1..6a6a98232351ef72aa1b89a4d6cd186e85e518e7 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/debug/trace_event.h"
+#include "base/json/json_writer.h"
#include "base/stl_util.h"
#include "cc/append_quads_data.h"
#include "cc/damage_tracker.h"
@@ -1552,6 +1553,17 @@ std::string LayerTreeHostImpl::layerTreeAsText() const
return str;
}
+std::string LayerTreeHostImpl::layerTreeAsJson() const
+{
+ std::string str;
+ if (rootLayer()) {
+ scoped_ptr<base::Value> json(rootLayer()->layerTreeAsJson());
+ base::JSONWriter::WriteWithOptions(
+ json.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &str);
+ }
+ return str;
+}
+
void LayerTreeHostImpl::dumpRenderSurfaces(std::string* str, int indent, const LayerImpl* layer) const
{
if (layer->renderSurface())
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698