mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-08-29 15:22:07 +02:00
Optimize the backporting condition
At the moment we flip the two buffers, and we backport the damaged area on every frame callback. We completely ignore the compositor sent event buffer->release. This event means that the compositor finished reading the buffer pixels, and will never read them again. So we can keep using the same buffer instead of fliping, if we receive the event before asking for a new frame callback. The change is not complicated, but we have to distinguish drwsurf_attach, and drwsurf_flip. We try to flip before trying to draw anything. And if the buffer has already been released, we don't flip. We also have to track the backport_damage separately than the buffer current damage. Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
committed by
Maarten van Gompel
parent
686b27a72d
commit
55b88bc14f
4
main.c
4
main.c
@@ -517,7 +517,7 @@ xdg_popup_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
||||
{
|
||||
xdg_surface_ack_configure(xdg_surface, serial);
|
||||
popup_xdg_surface_configured = true;
|
||||
drwsurf_flip(&popup_draw_surf);
|
||||
drwsurf_attach(&popup_draw_surf);
|
||||
}
|
||||
|
||||
static const struct xdg_surface_listener xdg_popup_surface_listener = {
|
||||
@@ -664,7 +664,7 @@ layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface,
|
||||
|
||||
zwlr_layer_surface_v1_ack_configure(surface, serial);
|
||||
kbd_resize(&keyboard, layouts, NumLayouts);
|
||||
drwsurf_flip(&draw_surf);
|
||||
drwsurf_attach(&draw_surf);
|
||||
} else {
|
||||
zwlr_layer_surface_v1_ack_configure(surface, serial);
|
||||
}
|
||||
|
Reference in New Issue
Block a user