mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
Add timespec helpers
Borrow timespec helpers from Weston [1]. We'll re-use these helpers for
adaptive sync in a future commit.
Rename refresh_nsec to next_refresh_nsec, because this value only
applies to the next output presentation.
[1]: 467e6b9883/shared/timespec-util.h
This commit is contained in:
parent
c0811fcf87
commit
a5fbffb40d
4 changed files with 56 additions and 21 deletions
|
|
@ -54,7 +54,7 @@ struct sway_output {
|
|||
} events;
|
||||
|
||||
struct timespec last_presentation;
|
||||
uint32_t refresh_nsec;
|
||||
uint32_t next_refresh_nsec;
|
||||
int max_render_time; // In milliseconds
|
||||
struct wl_event_source *repaint_timer;
|
||||
bool surface_needs_frame;
|
||||
|
|
|
|||
|
|
@ -37,4 +37,13 @@ const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel);
|
|||
|
||||
bool sway_set_cloexec(int fd, bool cloexec);
|
||||
|
||||
struct timespec;
|
||||
|
||||
void timespec_sub(struct timespec *r, const struct timespec *a,
|
||||
const struct timespec *b);
|
||||
int64_t timespec_sub_to_nsec(const struct timespec *a, const struct timespec *b);
|
||||
void timespec_add_nsec(struct timespec *r, const struct timespec *a,
|
||||
int64_t nsec);
|
||||
int64_t timespec_to_nsec(const struct timespec *t);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue