Rename get_present_clock to get_presentation clock, use it

This commit is contained in:
emersion 2018-10-01 22:57:36 +02:00
parent abddfc99f2
commit b0635bf3e7
8 changed files with 34 additions and 13 deletions

View file

@ -565,7 +565,7 @@ void wlr_output_send_present(struct wlr_output *output, struct timespec *when,
unsigned seq, uint32_t flags) {
struct timespec now;
if (when == NULL) {
clockid_t clock = wlr_backend_get_present_clock(output->backend);
clockid_t clock = wlr_backend_get_presentation_clock(output->backend);
errno = 0;
if (clock_gettime(clock, &now) != 0) {
wlr_log_errno(WLR_ERROR, "failed to send output present event: "

View file

@ -3,6 +3,7 @@
#include <stdlib.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_surface.h>
#include <wlr/backend.h>
#include "presentation-time-protocol.h"
#include "util/signal.h"
@ -147,7 +148,7 @@ static void presentation_bind(struct wl_client *client, void *data,
presentation_handle_resource_destroy);
wl_list_insert(&presentation->resources, wl_resource_get_link(resource));
wp_presentation_send_clock_id(resource, presentation->clock);
wp_presentation_send_clock_id(resource, (uint32_t)presentation->clock);
}
static void handle_display_destroy(struct wl_listener *listener, void *data) {
@ -156,7 +157,8 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
wlr_presentation_destroy(presentation);
}
struct wlr_presentation *wlr_presentation_create(struct wl_display *display) {
struct wlr_presentation *wlr_presentation_create(struct wl_display *display,
struct wlr_backend *backend) {
struct wlr_presentation *presentation =
calloc(1, sizeof(struct wlr_presentation));
if (presentation == NULL) {
@ -170,8 +172,7 @@ struct wlr_presentation *wlr_presentation_create(struct wl_display *display) {
return NULL;
}
// TODO: get clock from backend
presentation->clock = CLOCK_MONOTONIC;
presentation->clock = wlr_backend_get_presentation_clock(backend);
wl_list_init(&presentation->resources);
wl_list_init(&presentation->feedbacks);