summaryrefslogtreecommitdiffstats
path: root/cc/base/math_util.cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-14 04:48:12 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-14 04:48:12 +0000
commit2c13974473363c702480ce61d0ce548598d03406 (patch)
tree792754643e1ee3cdb066f4b6434c610d85385758 /cc/base/math_util.cc
parentbeb1d119dfe2a738552b268822d23fd5f2b3badd (diff)
downloadchromium_src-2c13974473363c702480ce61d0ce548598d03406.zip
chromium_src-2c13974473363c702480ce61d0ce548598d03406.tar.gz
chromium_src-2c13974473363c702480ce61d0ce548598d03406.tar.bz2
cc: Add TiledLayerImpl::AsValue
This allows the invalidation from this layer type to be included in a snapshot when impl-side painting isn't turned on. R=nduca@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/14949013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/base/math_util.cc')
-rw-r--r--cc/base/math_util.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 5e2ca83..7873d93 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -533,7 +533,7 @@ scoped_ptr<base::Value> MathUtil::AsValue(gfx::PointF pt) {
return res.PassAs<base::Value>();
}
-scoped_ptr<base::Value> MathUtil::AsValue(gfx::QuadF q) {
+scoped_ptr<base::Value> MathUtil::AsValue(const gfx::QuadF& q) {
scoped_ptr<base::ListValue> res(new base::ListValue());
res->AppendDouble(q.p1().x());
res->AppendDouble(q.p1().y());
@@ -546,6 +546,15 @@ scoped_ptr<base::Value> MathUtil::AsValue(gfx::QuadF q) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(const gfx::RectF& rect) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ res->AppendDouble(rect.x());
+ res->AppendDouble(rect.y());
+ res->AppendDouble(rect.width());
+ res->AppendDouble(rect.height());
+ 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())));