mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
Rename get_present_clock to get_presentation clock, use it
This commit is contained in:
parent
abddfc99f2
commit
b0635bf3e7
8 changed files with 34 additions and 13 deletions
|
|
@ -64,9 +64,9 @@ struct wlr_session *wlr_backend_get_session(struct wlr_backend *backend) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
clockid_t wlr_backend_get_present_clock(struct wlr_backend *backend) {
|
||||
if (backend->impl->get_present_clock) {
|
||||
return backend->impl->get_present_clock(backend);
|
||||
clockid_t wlr_backend_get_presentation_clock(struct wlr_backend *backend) {
|
||||
if (backend->impl->get_presentation_clock) {
|
||||
return backend->impl->get_presentation_clock(backend);
|
||||
}
|
||||
return CLOCK_MONOTONIC;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ static struct wlr_renderer *backend_get_renderer(
|
|||
}
|
||||
}
|
||||
|
||||
static clockid_t backend_get_present_clock(struct wlr_backend *backend) {
|
||||
static clockid_t backend_get_presentation_clock(struct wlr_backend *backend) {
|
||||
struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend);
|
||||
return drm->clock;
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ static struct wlr_backend_impl backend_impl = {
|
|||
.start = backend_start,
|
||||
.destroy = backend_destroy,
|
||||
.get_renderer = backend_get_renderer,
|
||||
.get_present_clock = backend_get_present_clock,
|
||||
.get_presentation_clock = backend_get_presentation_clock,
|
||||
};
|
||||
|
||||
bool wlr_backend_is_drm(struct wlr_backend *b) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#define _POSIX_C_SOURCE 199309L
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <wlr/backend/interface.h>
|
||||
#include <wlr/backend/session.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
@ -77,11 +79,26 @@ static struct wlr_session *multi_backend_get_session(
|
|||
return backend->session;
|
||||
}
|
||||
|
||||
static clockid_t multi_backend_get_presentation_clock(
|
||||
struct wlr_backend *backend) {
|
||||
struct wlr_multi_backend *multi = multi_backend_from_backend(backend);
|
||||
|
||||
struct subbackend_state *sub;
|
||||
wl_list_for_each(sub, &multi->backends, link) {
|
||||
if (sub->backend->impl->get_presentation_clock) {
|
||||
return wlr_backend_get_presentation_clock(sub->backend);
|
||||
}
|
||||
}
|
||||
|
||||
return CLOCK_MONOTONIC;
|
||||
}
|
||||
|
||||
struct wlr_backend_impl backend_impl = {
|
||||
.start = multi_backend_start,
|
||||
.destroy = multi_backend_destroy,
|
||||
.get_renderer = multi_backend_get_renderer,
|
||||
.get_session = multi_backend_get_session,
|
||||
.get_presentation_clock = multi_backend_get_presentation_clock,
|
||||
};
|
||||
|
||||
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue