summaryrefslogtreecommitdiffstats
path: root/cc/base
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
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')
-rw-r--r--cc/base/math_util.cc11
-rw-r--r--cc/base/math_util.h3
2 files changed, 12 insertions, 2 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())));
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index 9f4577a..2763071 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -146,7 +146,8 @@ class CC_EXPORT MathUtil {
// Conversion to value.
static scoped_ptr<base::Value> AsValue(gfx::Size s);
static scoped_ptr<base::Value> AsValue(gfx::PointF q);
- static scoped_ptr<base::Value> AsValue(gfx::QuadF q);
+ static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q);
+ static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect);
// Returns a base::Value representation of the floating point value.
// If the value is inf, returns max double/float representation.