• klausw's avatar
    Fix off-by-one in fps_meter, fix unit test to catch this. · c90c3441
    klausw authored
    The FPS counter returned bogus negative values as soon as the
    sample count reached kNumFrameTimes since it subtracted a zero value
    that was never set due to an off-by-one error.
    
    Unfortunately the unit test didn't catch this since it never filled
    the sample buffer. Fixed the test to cover this.
    
    Also reduce kNumFrameTimes to 10, smoothing over 200 frames seems
    excessive. We just want a bit of smoothing but should be able to
    see some reaction to temporary glitches since these are quite visible
    in VR.
    
    BUG=
    
    Review-Url: https://codereview.chromium.org/2892813002
    Cr-Commit-Position: refs/heads/master@{#473810}
    c90c3441
fps_meter_unittest.cc 2.03 KB