Chromium Code Reviews| Index: cc/quads/draw_quad.cc |
| diff --git a/cc/quads/draw_quad.cc b/cc/quads/draw_quad.cc |
| index 6c8d9b6654a18c75b202b1506d8919cf6c72ef3d..69706a090c28adc4fcfd245edda3ec29b057d07c 100644 |
| --- a/cc/quads/draw_quad.cc |
| +++ b/cc/quads/draw_quad.cc |
| @@ -5,6 +5,8 @@ |
| #include "cc/quads/draw_quad.h" |
| #include "base/logging.h" |
| +#include "base/values.h" |
| +#include "cc/base/math_util.h" |
| #include "cc/quads/checkerboard_draw_quad.h" |
| #include "cc/quads/debug_border_draw_quad.h" |
| #include "cc/quads/io_surface_draw_quad.h" |
| @@ -90,4 +92,26 @@ scoped_ptr<DrawQuad> DrawQuad::Copy( |
| return copy_quad.Pass(); |
| } |
| +scoped_ptr<base::Value> DrawQuad::AsValue() const { |
| + scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
| + value->SetInteger("material", material); |
| + value->Set("transform", MathUtil::AsValue( |
| + shared_quad_state->content_to_target_transform).release()); |
| + value->Set("rect", MathUtil::AsValue(rect).release()); |
|
vmpstr
2013/07/26 16:07:23
Maybe the rects can be named something like "conte
danakj
2013/07/26 16:49:08
Agree, content_rect is our typical nomenclature fo
piman
2013/07/31 00:36:43
Following our discussion, and the need to have a p
|
| + value->Set("opaque_rect", MathUtil::AsValue(opaque_rect).release()); |
| + value->Set("visible_rect", MathUtil::AsValue(visible_rect).release()); |
| + value->Set("layer_content_bounds", MathUtil::AsValue( |
| + shared_quad_state->visible_content_rect).release()); |
| + value->Set("layer_visible_content_rect", MathUtil::AsValue( |
| + shared_quad_state->visible_content_rect).release()); |
| + value->SetBoolean("is_clipped", shared_quad_state->is_clipped); |
| + value->Set("clip_rect", |
| + MathUtil::AsValue(shared_quad_state->clip_rect).release()); |
| + value->SetBoolean("needs_blending", needs_blending); |
| + value->SetDouble("opacity", shared_quad_state->opacity); |
| + value->SetBoolean("ShouldDrawWithBlending()", ShouldDrawWithBlending()); |
|
vmpstr
2013/07/26 16:07:23
should_draw_with_blending
piman
2013/07/31 00:36:43
Done.
|
| + ExtendValue(value.get()); |
| + return value.PassAs<base::Value>(); |
| +} |
| + |
| } // namespace cc |