mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
output: add damage tracking via buffer age
This commit is contained in:
parent
78c13ead16
commit
0365b587f0
21 changed files with 163 additions and 81 deletions
|
|
@ -38,22 +38,27 @@ static bool wlr_wl_output_set_custom_mode(struct wlr_output *_output,
|
|||
return true;
|
||||
}
|
||||
|
||||
static void wlr_wl_output_make_current(struct wlr_output *_output) {
|
||||
struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output;
|
||||
if (!eglMakeCurrent(output->backend->egl.display,
|
||||
output->egl_surface, output->egl_surface,
|
||||
output->backend->egl.context)) {
|
||||
wlr_log(L_ERROR, "eglMakeCurrent failed: %s", egl_error());
|
||||
}
|
||||
static bool wlr_wl_output_make_current(struct wlr_output *wlr_output,
|
||||
int *buffer_age) {
|
||||
struct wlr_wl_backend_output *output =
|
||||
(struct wlr_wl_backend_output *)wlr_output;
|
||||
return wlr_egl_make_current(&output->backend->egl, output->egl_surface,
|
||||
buffer_age);
|
||||
}
|
||||
|
||||
static void wlr_wl_output_swap_buffers(struct wlr_output *_output) {
|
||||
struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output;
|
||||
static bool wlr_wl_output_swap_buffers(struct wlr_output *wlr_output) {
|
||||
struct wlr_wl_backend_output *output =
|
||||
(struct wlr_wl_backend_output *)wlr_output;
|
||||
|
||||
output->frame_callback = wl_surface_frame(output->surface);
|
||||
wl_callback_add_listener(output->frame_callback, &frame_listener, output);
|
||||
|
||||
if (!eglSwapBuffers(output->backend->egl.display, output->egl_surface)) {
|
||||
wlr_log(L_ERROR, "eglSwapBuffers failed: %s", egl_error());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void wlr_wl_output_transform(struct wlr_output *_output,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue