[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:
Quantum
2021-05-11 16:49:39 -04:00
committed by Geoffrey McRae
parent f9a9953071
commit e70cfd84fb
14 changed files with 140 additions and 15 deletions

View File

@@ -25,6 +25,11 @@ Place, Suite 330, Boston, MA 02111-1307 USA
typedef struct EGL_Cursor EGL_Cursor;
struct CursorState {
bool visible;
struct Rect rect;
};
bool egl_cursor_init(EGL_Cursor ** cursor);
void egl_cursor_free(EGL_Cursor ** cursor);
@@ -41,4 +46,6 @@ void egl_cursor_set_size(EGL_Cursor * cursor, const float x, const float y);
void egl_cursor_set_state(EGL_Cursor * cursor, const bool visible,
const float x, const float y);
struct CursorState egl_cursor_get_state(EGL_Cursor * cursor, int width, int height);
void egl_cursor_render(EGL_Cursor * cursor, LG_RendererRotate rotate);