mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-12 02:18:12 +00:00
[client] egl: use eglSwapBuffersWithDamageKHR for cursor-only updates
Instead of damaging the entire surface when rendering a cursor move, we can use the EGL_KHR_swap_buffers_with_damage extension to only damage the part of the window covered by the cursor. This should reduce the cursor movement latency on Wayland.
This commit is contained in:
@@ -215,6 +215,16 @@ void egl_cursor_set_state(EGL_Cursor * cursor, const bool visible, const float x
|
||||
cursor->y = y;
|
||||
}
|
||||
|
||||
struct CursorState egl_cursor_get_state(EGL_Cursor * cursor, int width, int height) {
|
||||
return (struct CursorState) {
|
||||
.visible = cursor->visible,
|
||||
.rect.x = (cursor->x * width + width) / 2,
|
||||
.rect.y = (-cursor->y * height + height) / 2 - cursor->h * height,
|
||||
.rect.w = cursor->w * width + 2,
|
||||
.rect.h = cursor->h * height + 2,
|
||||
};
|
||||
}
|
||||
|
||||
void egl_cursor_render(EGL_Cursor * cursor, LG_RendererRotate rotate)
|
||||
{
|
||||
if (!cursor->visible)
|
||||
|
Reference in New Issue
Block a user