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

Unified Diff: cc/layer_impl.cc

Issue 12258044: cc: Add PictureLayerImpl::AsValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Size as value Created 7 years, 10 months 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_impl.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 8545e42f7336acf9fffbedd72ca9d3549dd1cfe0..7838cb1dd74493c402b6b641fedc9722d6864449 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -20,6 +20,7 @@
#include "cc/scrollbar_animation_controller_linear_fade.h"
#include "cc/scrollbar_layer_impl.h"
#include "ui/gfx/point_conversions.h"
+#include "ui/gfx/quad_f.h"
#include "ui/gfx/rect_conversions.h"
namespace cc {
@@ -969,4 +970,26 @@ void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
m_verticalScrollbarLayer->setScrollLayerId(id());
}
+void LayerImpl::AsValueInto(base::DictionaryValue* dict) const
+{
+ dict->SetInteger("id", id());
+ dict->Set("bounds", MathUtil::asValue(bounds()).release());
+ dict->SetInteger("draws_content", drawsContent());
+
+ bool clipped;
+ gfx::QuadF layer_quad = MathUtil::mapQuad(
+ screenSpaceTransform(),
+ gfx::QuadF(gfx::Rect(contentBounds())),
+ clipped);
+ dict->Set("layer_quad", MathUtil::asValue(layer_quad).release());
+
+}
+
+scoped_ptr<base::Value> LayerImpl::AsValue() const
+{
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
+ AsValueInto(state.get());
+ return state.PassAs<base::Value>();
+}
+
} // namespace cc
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698