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

Unified Diff: cc/base/math_util.cc

Issue 20667002: cc: Add frame data to LTHI tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: cc/base/math_util.cc
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 544395652822bd37a5584f732c88362c92326dfe..26ca5b22ac09cba7a06cda155a2a98ec71db5998 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -526,6 +526,13 @@ scoped_ptr<base::Value> MathUtil::AsValue(gfx::Size s) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(gfx::SizeF s) {
+ scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
+ res->SetDouble("width", s.width());
+ res->SetDouble("height", s.height());
+ return res.PassAs<base::Value>();
+}
+
scoped_ptr<base::Value> MathUtil::AsValue(gfx::Rect r) {
scoped_ptr<base::ListValue> res(new base::ListValue());
res->AppendInteger(r.x());
@@ -585,6 +592,16 @@ scoped_ptr<base::Value> MathUtil::AsValue(const gfx::RectF& rect) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Transform& transform) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ const SkMatrix44& m = transform.matrix();
+ for (int row = 0; row < 3; ++row) {
+ for (int col = 0; col < 3; ++col)
+ res->AppendDouble(m.getDouble(row, col));
+ }
+ return res.PassAs<base::Value>();
+}
+
scoped_ptr<base::Value> MathUtil::AsValueSafely(double value) {
return scoped_ptr<base::Value>(base::Value::CreateDoubleValue(
std::min(value, std::numeric_limits<double>::max())));
« no previous file with comments | « cc/base/math_util.h ('k') | cc/output/filter_operation.h » ('j') | cc/output/filter_operation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698