diff options
author | miletus <miletus@chromium.org> | 2014-10-01 12:38:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-01 19:38:44 +0000 |
commit | f57925d399f2eda19fdaab9191257e51a3af04a0 (patch) | |
tree | fe4a309c3f5af49155e2711671f644fc4fb130e0 /cc/base | |
parent | cc40100c7c9b5be5ae9f13b888e875d63f2844cd (diff) | |
download | chromium_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.cc | 6 | ||||
-rw-r--r-- | cc/base/math_util.h | 3 |
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, |