diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-04 16:41:16 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-02 11:08:52 +0200 |
commit | 2b0a1aeed5246fe41e6268c333f1e00b874fab02 (patch) | |
tree | 423b9b89f425efe0ed7feb407de196d6e833189e /include/wlr | |
parent | 01e0f51fadaec17fde401da795b958b721922344 (diff) |
output: take a wlr_buffer in set_cursor
Instead of passing a wlr_texture to the backend, directly pass a
wlr_buffer. Use get_cursor_size and get_cursor_formats to create
a wlr_buffer that can be used as a cursor.
We don't want to pass a wlr_texture because we want to remove as
many rendering bits from the backend as possible.
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 13 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index 7b07ea6e..aef41367 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -24,22 +24,15 @@ struct wlr_output_impl { /** * Set the output cursor plane image. * - * The parameters describe the image texture, its scale and its transform. - * If the scale and transform doesn't match the output's, the backend is - * responsible for scaling and transforming the texture appropriately. - * If texture is NULL, the cursor should be hidden. + * If buffer is NULL, the cursor should be hidden. * * The hotspot indicates the offset that needs to be applied to the * top-left corner of the image to match the cursor position. In other * words, the image should be displayed at (x - hotspot_x, y - hotspot_y). * The hotspot is given in the texture's coordinate space. - * - * If update_texture is true, all parameters need to be taken into account. - * If update_texture is false, only the hotspot is to be updated. */ - bool (*set_cursor)(struct wlr_output *output, struct wlr_texture *texture, - float scale, enum wl_output_transform transform, - int32_t hotspot_x, int32_t hotspot_y, bool update_texture); + bool (*set_cursor)(struct wlr_output *output, struct wlr_buffer *buffer, + int hotspot_x, int hotspot_y); /** * Set the output cursor plane position. * diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 507bfa47..dd5051c9 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -181,6 +181,8 @@ struct wlr_output { struct wl_list cursors; // wlr_output_cursor::link struct wlr_output_cursor *hardware_cursor; + struct wlr_swapchain *cursor_swapchain; + struct wlr_buffer *cursor_front_buffer; int software_cursor_locks; // number of locks forcing software cursors struct wl_listener display_destroy; |