~mir-team/mir/uniformity-measurement-with-sync-proto

« back to all changes in this revision

Viewing changes to benchmarks/frame-uniformity/main.cpp

  • Committer: Robert Carr
  • Date: 2014-10-09 17:53:03 UTC
  • Revision ID: robert.carr@canonical.com-20141009175303-8613t5ettf6accwz
Implement event synthesis

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                       std::chrono::high_resolution_clock::time_point interpolated_touch_time)
37
37
{
38
38
    assert(interpolated_touch_time > touch_start_time);
39
 
    // TODO: This is a little suspect
 
39
    // std::chrono is a beautiful api
40
40
    double alpha = (interpolated_touch_time.time_since_epoch().count() - touch_start_time.time_since_epoch().count()) / static_cast<double>((touch_end_time.time_since_epoch().count() - touch_start_time.time_since_epoch().count()));
41
41
    
42
42
    auto ix = touch_start.x.as_int() + (touch_end.x.as_int()-touch_start.x.as_int())*alpha;