summaryrefslogtreecommitdiffstats
path: root/cc/base
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 17:28:24 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 17:28:24 +0000
commitbf961031ee264cfafbd6d49db1a7cfaea0971e27 (patch)
treed7e44c260ba9cbc4e25c9c5fb662f5d7bceba737 /cc/base
parent2c65d8dd4162b585f8dd3b09dfb9ecb64925b309 (diff)
downloadchromium_src-bf961031ee264cfafbd6d49db1a7cfaea0971e27.zip
chromium_src-bf961031ee264cfafbd6d49db1a7cfaea0971e27.tar.gz
chromium_src-bf961031ee264cfafbd6d49db1a7cfaea0971e27.tar.bz2
Trace layer bounds/position/scroll_offset in cc.debug
Having these values (in particular scroll_offset) in layer tree traces helped greatly when investigating crbug.com/346622 Review URL: https://codereview.chromium.org/177983007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/base')
-rw-r--r--cc/base/math_util.cc7
-rw-r--r--cc/base/math_util.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index e696ea6..b492404 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -579,6 +579,13 @@ scoped_ptr<base::Value> MathUtil::AsValue(const gfx::PointF& pt) {
return res.PassAs<base::Value>();
}
+scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Vector2d& v) {
+ scoped_ptr<base::ListValue> res(new base::ListValue());
+ res->AppendInteger(v.x());
+ res->AppendInteger(v.y());
+ return res.PassAs<base::Value>();
+}
+
scoped_ptr<base::Value> MathUtil::AsValue(const gfx::QuadF& q) {
scoped_ptr<base::ListValue> res(new base::ListValue());
res->AppendDouble(q.p1().x());
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index 9d6364ae..37b71dd 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -25,6 +25,7 @@ class Rect;
class RectF;
class Transform;
class Vector2dF;
+class Vector2d;
}
namespace cc {
@@ -172,6 +173,7 @@ class CC_EXPORT MathUtil {
static scoped_ptr<base::Value> AsValue(const gfx::Rect& r);
static bool FromValue(const base::Value*, gfx::Rect* out_rect);
static scoped_ptr<base::Value> AsValue(const gfx::PointF& q);
+ static scoped_ptr<base::Value> AsValue(const gfx::Vector2d& v);
static scoped_ptr<base::Value> AsValue(const gfx::QuadF& q);
static scoped_ptr<base::Value> AsValue(const gfx::RectF& rect);
static scoped_ptr<base::Value> AsValue(const gfx::Transform& transform);