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

Unified Diff: cc/layer_impl.cc

Issue 12258044: cc: Add PictureLayerImpl::AsValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 8545e42f7336acf9fffbedd72ca9d3549dd1cfe0..f10137aa7ad238db824b2b3ac2a472f5f519360f 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,27 @@ void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
m_verticalScrollbarLayer->setScrollLayerId(id());
}
+void LayerImpl::AsValueInto(base::DictionaryValue* dict) const
+{
+ dict->SetInteger("id", id());
+ dict->SetInteger("layer_width", bounds().width());
+ dict->SetInteger("layer_height", bounds().width());
nduca 2013/02/15 01:10:24 bounds_size? MathUtils should have a size->value
enne (OOO) 2013/02/15 01:14:04 Done.
+ 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') | cc/picture_layer_tiling.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698