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

Unified Diff: ash/laser/laser_pointer_points.h

Issue 2745953002: ash: Add basic prediction code to the laser pointer. (Closed)
Patch Set: more tests and 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
« no previous file with comments | « ash/laser/laser_pointer_controller_unittest.cc ('k') | ash/laser/laser_pointer_points.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9bf1d8dcfb80a2a2f744da409213ead7d0a403cf 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.
@@ -52,7 +53,7 @@ class ASH_EXPORT LaserPointerPoints {
// Whether there are any points or not.
bool IsEmpty() const;
// Expose the collection so callers can work with the points.
- const std::deque<LaserPoint>& laser_points();
+ const std::deque<LaserPoint>& laser_points() const;
private:
friend class LaserPointerPointsTestApi;
@@ -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);
};
« no previous file with comments | « ash/laser/laser_pointer_controller_unittest.cc ('k') | ash/laser/laser_pointer_points.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698