diff options
author | Ryo Munakata <ryomnktml@gmail.com> | 2014-08-10 23:47:45 +0900 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-08-18 15:27:16 +0300 |
commit | a3a5debe31f3799b5c8f7039c0f6bde63db6092e (patch) | |
tree | 24cd08702e61e237685c295103f87845990b9a87 /desktop-shell | |
parent | f322f8efea782692c5c45a1d870fb08b68f8fa15 (diff) | |
download | weston-a3a5debe31f3799b5c8f7039c0f6bde63db6092e.tar.gz |
gears: fix invalid calculation of the first FPS
At the calculation of the first FPS, gears has initialized last
FPS time with gettimeofday().
But the callback_data passed in the callback of wl_surface_frame()
is the current time, in milliseconds, with an undefined base.
Because of this subtracting last FPS time from callback_data makes no sense.
For example, below is the result of running weston-gears on weston with
drm backend:
$ weston-gears
Warning: FPS count is limited by the wayland compositor or monitor refresh rate
1 frames in 1094460.125 seconds = 0.000 FPS
301 frames in 5.016 seconds = 60.008 FPS
301 frames in 5.016 seconds = 60.008 FPS
301 frames in 5.016 seconds = 60.008 FPS
As you can see, the the first FPS value is something odd.
This patch fixes it by initializing last FPS time with the callback_data passed in
the first callback.
Reviewed-by: Nils Chr. Brause <nilschrbrause@gmail.com>
Diffstat (limited to 'desktop-shell')
0 files changed, 0 insertions, 0 deletions