Use buffer age when rendering
This commit is contained in:
parent
fb86e3df22
commit
711fb83bda
1 changed files with 7 additions and 11 deletions
|
@ -160,7 +160,13 @@ output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
|
||||||
if (output->damaged == 0) {
|
int buffer_age;
|
||||||
|
if (!wlr_output_attach_render(wlr_output, &buffer_age)) {
|
||||||
|
wlr_log(WLR_ERROR, "Failed to attach renderer to output");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (output->damaged == 0 && buffer_age > 0) {
|
||||||
send_frame_done_to_layer(
|
send_frame_done_to_layer(
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &now);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &now);
|
||||||
send_frame_done_to_layer(
|
send_frame_done_to_layer(
|
||||||
|
@ -176,11 +182,6 @@ output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
view, send_frame_done_to_surface, &now);
|
view, send_frame_done_to_surface, &now);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wlr_output_attach_render(wlr_output, NULL)) {
|
|
||||||
wlr_log(WLR_ERROR, "Failed to attach renderer to output");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (render_cursors(wlr_output)) {
|
if (render_cursors(wlr_output)) {
|
||||||
output_damage(output);
|
output_damage(output);
|
||||||
}
|
}
|
||||||
|
@ -193,11 +194,6 @@ output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
struct wlr_renderer *renderer =
|
struct wlr_renderer *renderer =
|
||||||
wlr_backend_get_renderer(wlr_output->backend);
|
wlr_backend_get_renderer(wlr_output->backend);
|
||||||
|
|
||||||
if (!wlr_output_attach_render(wlr_output, NULL)) {
|
|
||||||
wlr_log(WLR_ERROR, "Failed to attach renderer to output");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
wlr_output_effective_resolution(wlr_output, &width, &height);
|
wlr_output_effective_resolution(wlr_output, &width, &height);
|
||||||
|
|
Loading…
Reference in a new issue