diff options
author | jungjik.lee <jungjik.lee@samsung.com> | 2015-01-21 06:06:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-21 14:08:11 +0000 |
commit | 50f9c8e35e788b657d3b3cd825ece454a13ffc63 (patch) | |
tree | 1cb56f3eb3058606f02b24b690d4ae2a59008ab7 /cc/layers/layer_impl.cc | |
parent | d8c057d71ae5062bb68b4fefae30ddf7180d5ea7 (diff) | |
download | chromium_src-50f9c8e35e788b657d3b3cd825ece454a13ffc63.zip chromium_src-50f9c8e35e788b657d3b3cd825ece454a13ffc63.tar.gz chromium_src-50f9c8e35e788b657d3b3cd825ece454a13ffc63.tar.bz2 |
cc: refactor of MathUtil::AddToTracedValue
Pass the name to MathUtilAddToTracedValue
and decide the json value type internally.
so that we could add the value without knowing
the value type.
Review URL: https://codereview.chromium.org/853393002
Cr-Commit-Position: refs/heads/master@{#312339}
Diffstat (limited to 'cc/layers/layer_impl.cc')
-rw-r--r-- | cc/layers/layer_impl.cc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 8c7d972..d6e2a23 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -1466,35 +1466,24 @@ void LayerImpl::AsValueInto(base::debug::TracedValue* state) const { LayerTypeAsString(), this); state->SetInteger("layer_id", id()); - state->BeginDictionary("bounds"); - MathUtil::AddToTracedValue(bounds_, state); - state->EndDictionary(); + MathUtil::AddToTracedValue("bounds", bounds_, state); state->SetDouble("opacity", opacity()); - state->BeginArray("position"); - MathUtil::AddToTracedValue(position_, state); - state->EndArray(); + MathUtil::AddToTracedValue("position", position_, state); state->SetInteger("draws_content", DrawsContent()); state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); - state->BeginArray("scroll_offset"); - MathUtil::AddToTracedValue(scroll_offset_, state); - state->EndArray(); - - state->BeginArray("transform_origin"); - MathUtil::AddToTracedValue(transform_origin_, state); - state->EndArray(); + MathUtil::AddToTracedValue("scroll_offset", scroll_offset_, state); + MathUtil::AddToTracedValue("transform_origin", transform_origin_, state); bool clipped; gfx::QuadF layer_quad = MathUtil::MapQuad( screen_space_transform(), gfx::QuadF(gfx::Rect(content_bounds())), &clipped); - state->BeginArray("layer_quad"); - MathUtil::AddToTracedValue(layer_quad, state); - state->EndArray(); + MathUtil::AddToTracedValue("layer_quad", layer_quad, state); if (!touch_event_handler_region_.IsEmpty()) { state->BeginArray("touch_event_handler_region"); touch_event_handler_region_.AsValueInto(state); @@ -1552,11 +1541,8 @@ void LayerImpl::AsValueInto(base::debug::TracedValue* state) const { layer_animation_controller()->HasAnimationThatInflatesBounds()); gfx::BoxF box; - if (LayerUtils::GetAnimationBounds(*this, &box)) { - state->BeginArray("animation_bounds"); - MathUtil::AddToTracedValue(box, state); - state->EndArray(); - } + if (LayerUtils::GetAnimationBounds(*this, &box)) + MathUtil::AddToTracedValue("animation_bounds", box, state); if (debug_info_.get()) { std::string str; |