Chromium Code Reviews| 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 |