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

Unified Diff: cc/layers/layer_impl.cc

Issue 853393002: cc: refactor of MathUtil::AddToTracedValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/base/math_util.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 8c7d9729c4f4182acfee3e4f8c6fa5cab7905e7f..d6e2a236e9827a2c3ce5cfd8b3fca8e32686849f 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;
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698