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

Unified Diff: cc/output/filter_operation.cc

Issue 421183003: Revert of Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/output/filter_operation.h ('k') | cc/output/filter_operations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/filter_operation.cc
diff --git a/cc/output/filter_operation.cc b/cc/output/filter_operation.cc
index 173985b384a7b62066af5d3c92f979d7375589e4..096f6ba6e1025dffbcdf41e9854f16682887d0cf 100644
--- a/cc/output/filter_operation.cc
+++ b/cc/output/filter_operation.cc
@@ -4,7 +4,6 @@
#include <algorithm>
-#include "base/debug/trace_event_argument.h"
#include "base/values.h"
#include "cc/base/math_util.h"
#include "cc/output/filter_operation.h"
@@ -255,7 +254,8 @@
return blended_filter;
}
-void FilterOperation::AsValueInto(base::debug::TracedValue* value) const {
+scoped_ptr<base::Value> FilterOperation::AsValue() const {
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue);
value->SetInteger("type", type_);
switch (type_) {
case FilterOperation::GRAYSCALE:
@@ -272,16 +272,14 @@
break;
case FilterOperation::DROP_SHADOW:
value->SetDouble("std_deviation", amount_);
- value->BeginArray("offset");
- MathUtil::AddToTracedValue(drop_shadow_offset_, value);
- value->EndArray();
+ value->Set("offset", MathUtil::AsValue(drop_shadow_offset_).release());
value->SetInteger("color", drop_shadow_color_);
break;
case FilterOperation::COLOR_MATRIX: {
- value->BeginArray("matrix");
+ scoped_ptr<base::ListValue> matrix(new base::ListValue);
for (size_t i = 0; i < arraysize(matrix_); ++i)
- value->AppendDouble(matrix_[i]);
- value->EndArray();
+ matrix->AppendDouble(matrix_[i]);
+ value->Set("matrix", matrix.release());
break;
}
case FilterOperation::ZOOM:
@@ -304,17 +302,17 @@
value->SetDouble("inner_threshold", amount_);
value->SetDouble("outer_threshold", outer_threshold_);
scoped_ptr<base::ListValue> region_value(new base::ListValue());
- value->BeginArray("region");
for (SkRegion::Iterator it(region_); !it.done(); it.next()) {
- value->AppendInteger(it.rect().x());
- value->AppendInteger(it.rect().y());
- value->AppendInteger(it.rect().width());
- value->AppendInteger(it.rect().height());
+ region_value->AppendInteger(it.rect().x());
+ region_value->AppendInteger(it.rect().y());
+ region_value->AppendInteger(it.rect().width());
+ region_value->AppendInteger(it.rect().height());
}
- value->EndArray();
+ value->Set("region", region_value.release());
}
break;
}
+ return value.PassAs<base::Value>();
}
} // namespace cc
« no previous file with comments | « cc/output/filter_operation.h ('k') | cc/output/filter_operations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698