Index: ash/laser/laser_pointer_points.h |
diff --git a/ash/laser/laser_pointer_points.h b/ash/laser/laser_pointer_points.h |
index 19e95c1d1b3b1d6598cf47fb5483be7a9d153813..9b10bc0da1985ef7f8d20e07d9b1a927d48c2d28 100644 |
--- a/ash/laser/laser_pointer_points.h |
+++ b/ash/laser/laser_pointer_points.h |
@@ -23,7 +23,9 @@ class ASH_EXPORT LaserPointerPoints { |
// Struct to describe each point. |
struct LaserPoint { |
gfx::Point location; |
- base::Time creation_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. |
+ double age; |
}; |
// Constructor with a parameter to choose the fade out time of the points in |
@@ -33,6 +35,10 @@ class ASH_EXPORT LaserPointerPoints { |
// Adds a point. Automatically clears points that are too old. |
void AddPoint(const gfx::Point& point); |
+ // Updates the collection latest time. Automatically clears points that are |
+ // too old. |
+ void MoveForwardToCurrentTime(); |
jdufault
2016/10/05 21:36:05
It looks like this is only used once. I don't thin
sammiequon
2016/10/06 00:19:15
Done.
|
+ void MoveForwardToTime(const base::Time& new_latest_time); |
// Removes all points. |
void Clear(); |
// Gets the bounding box of the points. |
@@ -55,6 +61,9 @@ class ASH_EXPORT LaserPointerPoints { |
base::TimeDelta life_duration_; |
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_; |
DISALLOW_COPY_AND_ASSIGN(LaserPointerPoints); |
}; |