From f57925d399f2eda19fdaab9191257e51a3af04a0 Mon Sep 17 00:00:00 2001 From: miletus Date: Wed, 1 Oct 2014 12:38:13 -0700 Subject: 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} --- cc/base/math_util.cc | 6 ++++++ cc/base/math_util.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'cc/base') 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, -- cgit v1.1