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

Unified Diff: cc/quads/shared_quad_state.cc

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN Created 6 years, 5 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/quads/shared_quad_state.h ('k') | cc/quads/solid_color_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/shared_quad_state.cc
diff --git a/cc/quads/shared_quad_state.cc b/cc/quads/shared_quad_state.cc
index 57959e3cdd92919615e68d9d7c95c205453fe770..83df3657def0a1820c1b09d23d93a73130b63721 100644
--- a/cc/quads/shared_quad_state.cc
+++ b/cc/quads/shared_quad_state.cc
@@ -4,6 +4,7 @@
#include "cc/quads/shared_quad_state.h"
+#include "base/debug/trace_event_argument.h"
#include "base/values.h"
#include "cc/base/math_util.h"
#include "cc/debug/traced_value.h"
@@ -45,22 +46,32 @@ void SharedQuadState::SetAll(const gfx::Transform& content_to_target_transform,
this->sorting_context_id = sorting_context_id;
}
-scoped_ptr<base::Value> SharedQuadState::AsValue() const {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
- value->Set("transform",
- MathUtil::AsValue(content_to_target_transform).release());
- value->Set("layer_content_bounds",
- MathUtil::AsValue(content_bounds).release());
- value->Set("layer_visible_content_rect",
- MathUtil::AsValue(visible_content_rect).release());
+void SharedQuadState::AsValueInto(base::debug::TracedValue* value) const {
+ value->BeginArray("transform");
+ MathUtil::AddToTracedValue(content_to_target_transform, value);
+ value->EndArray();
+
+ value->BeginDictionary("layer_content_bounds");
+ MathUtil::AddToTracedValue(content_bounds, value);
+ value->EndDictionary();
+
+ value->BeginArray("layer_visible_content_rect");
+ MathUtil::AddToTracedValue(visible_content_rect, value);
+ value->EndArray();
+
value->SetBoolean("is_clipped", is_clipped);
- value->Set("clip_rect", MathUtil::AsValue(clip_rect).release());
+
+ value->BeginArray("clip_rect");
+ MathUtil::AddToTracedValue(clip_rect, value);
+ value->EndArray();
+
value->SetDouble("opacity", opacity);
value->SetString("blend_mode", SkXfermode::ModeName(blend_mode));
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"),
- value.get(), "cc::SharedQuadState", this);
- return value.PassAs<base::Value>();
+ value,
+ "cc::SharedQuadState",
+ this);
}
} // namespace cc
« no previous file with comments | « cc/quads/shared_quad_state.h ('k') | cc/quads/solid_color_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698