aboutsummaryrefslogtreecommitdiff
path: root/backend/multi
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-04 22:18:19 +0200
committerGitHub <noreply@github.com>2018-10-04 22:18:19 +0200
commit24a48d4858a9d5eda0be86e20cbf0d378895063a (patch)
tree6fbd71fd0fe6f06183a7ee94b03727f69341328b /backend/multi
parentc67ce71fddeae90f6b3d89a742a77d049ffb3e20 (diff)
parenteac7c2ad2faf49084342d9f805cf06b773723fdd (diff)
Merge pull request #1272 from emersion/presentation-time
Implement presentation-time
Diffstat (limited to 'backend/multi')
-rw-r--r--backend/multi/backend.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c
index 2f4b929f..cefaa361 100644
--- a/backend/multi/backend.c
+++ b/backend/multi/backend.c
@@ -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) {