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()))); |