Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1232)

Unified Diff: ash/laser/laser_pointer_points.h

Issue 2745953002: ash: Add basic prediction code to the laser pointer. (Closed)
Patch Set: Add unit test and fix nits Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/laser/laser_pointer_points.h
diff --git a/ash/laser/laser_pointer_points.h b/ash/laser/laser_pointer_points.h
index 3c40a1765c23a4cfa777227889a4de0c9f9ab089..2ae0b105f9a6910721a5132c2e287935e0e93d25 100644
--- a/ash/laser/laser_pointer_points.h
+++ b/ash/laser/laser_pointer_points.h
@@ -24,6 +24,7 @@ class ASH_EXPORT LaserPointerPoints {
// Struct to describe each point.
struct LaserPoint {
gfx::PointF location;
+ base::TimeTicks time;
// age is a value between [0,1] where 0 means the point was just added and 1
// means that the point is just about to be removed.
float age = 0.0f;
@@ -35,10 +36,10 @@ class ASH_EXPORT LaserPointerPoints {
~LaserPointerPoints();
// Adds a point. Automatically clears points that are too old.
- void AddPoint(const gfx::PointF& point);
+ void AddPoint(const gfx::PointF& point, const base::TimeTicks& time);
// Updates the collection latest time. Automatically clears points that are
// too old.
- void MoveForwardToTime(const base::Time& latest_time);
+ void MoveForwardToTime(const base::TimeTicks& latest_time);
// Removes all points.
void Clear();
// Gets the bounding box of the points.
@@ -61,7 +62,7 @@ class ASH_EXPORT LaserPointerPoints {
std::deque<LaserPoint> points_;
// The latest time of the collection of points. This gets updated when new
// points are added or when MoveForwardInTime is called.
- base::Time collection_latest_time_;
+ base::TimeTicks collection_latest_time_;
DISALLOW_COPY_AND_ASSIGN(LaserPointerPoints);
};

Powered by Google App Engine
This is Rietveld 408576698