summaryrefslogtreecommitdiffstats
path: root/cc/base
diff options
context:
space:
mode:
authormiletus <miletus@chromium.org>2014-10-01 12:38:13 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-01 19:38:44 +0000
commitf57925d399f2eda19fdaab9191257e51a3af04a0 (patch)
treefe4a309c3f5af49155e2711671f644fc4fb130e0 /cc/base
parentcc40100c7c9b5be5ae9f13b888e875d63f2844cd (diff)
downloadchromium_src-f57925d399f2eda19fdaab9191257e51a3af04a0.zip
chromium_src-f57925d399f2eda19fdaab9191257e51a3af04a0.tar.gz
chromium_src-f57925d399f2eda19fdaab9191257e51a3af04a0.tar.bz2
Use ScrollOffset instead of vector2d to track scroll offset in cc
This is for preparing converting blink side scroll offset to be double type. Assuming blink side starts to use double scroll offset, it can be passed back from main/blink to compositor without converting to int type. BUG=414283 Review URL: https://codereview.chromium.org/584503005 Cr-Commit-Position: refs/heads/master@{#297692}
Diffstat (limited to 'cc/base')
-rw-r--r--cc/base/math_util.cc6
-rw-r--r--cc/base/math_util.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 7ed0c9a..5df1e56 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -778,6 +778,12 @@ void MathUtil::AddToTracedValue(const gfx::Vector2dF& v,
res->AppendDouble(v.y());
}
+void MathUtil::AddToTracedValue(const gfx::ScrollOffset& v,
+ base::debug::TracedValue* res) {
+ res->AppendDouble(v.x());
+ res->AppendDouble(v.y());
+}
+
void MathUtil::AddToTracedValue(const gfx::QuadF& q,
base::debug::TracedValue* res) {
res->AppendDouble(q.p1().x());
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index eaaf924..622ea4d 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -13,6 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "ui/gfx/box_f.h"
+#include "ui/gfx/geometry/scroll_offset.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/point_f.h"
#include "ui/gfx/size.h"
@@ -212,6 +213,8 @@ class CC_EXPORT MathUtil {
base::debug::TracedValue* res);
static void AddToTracedValue(const gfx::Vector2dF& v,
base::debug::TracedValue* res);
+ static void AddToTracedValue(const gfx::ScrollOffset& v,
+ base::debug::TracedValue* res);
static void AddToTracedValue(const gfx::QuadF& q,
base::debug::TracedValue* res);
static void AddToTracedValue(const gfx::RectF& rect,