aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-01 21:38:04 +0100
committeremersion <contact@emersion.fr>2018-05-01 21:38:04 +0100
commit225d182765eb69aa7a7647c809c37903ec08519c (patch)
tree3e0b7f9f311b74a7aa5b0fbec2ba92a099bec2d3 /include
parent509d38425c33524c77bfb4aa89676d57c21fcd11 (diff)
output: always use hardware cursors if available
This changes the `wlr_output_impl.set_cursor` function to take a `wlr_texture` instead of a byte buffer. This simplifies the DRM and Wayland backends since they were creating textures from the byte buffer anyway. With this commit, performance should be improved when moving the cursor since outputs don't need to be re-rendered anymore.
Diffstat (limited to 'include')
-rw-r--r--include/backend/wayland.h17
-rw-r--r--include/wlr/interfaces/wlr_output.h5
2 files changed, 9 insertions, 13 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index 38c7ee32..fec328ba 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -40,25 +40,22 @@ struct wlr_wl_output {
struct wlr_output wlr_output;
struct wlr_wl_backend *backend;
+ struct wl_list link;
+
struct wl_surface *surface;
+ struct wl_callback *frame_callback;
struct zxdg_surface_v6 *xdg_surface;
struct zxdg_toplevel_v6 *xdg_toplevel;
struct wl_egl_window *egl_window;
- struct wl_callback *frame_callback;
+ EGLSurface egl_surface;
+
+ uint32_t enter_serial;
struct {
- struct wl_shm_pool *pool;
- void *buffer; // actually a (client-side) struct wl_buffer *
- uint32_t buf_size;
- uint8_t *data;
struct wl_surface *surface;
+ struct wl_egl_window *egl_window;
int32_t hotspot_x, hotspot_y;
} cursor;
-
- uint32_t enter_serial;
-
- void *egl_surface;
- struct wl_list link;
};
struct wlr_wl_input_device {
diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h
index c9ddf615..d8c54067 100644
--- a/include/wlr/interfaces/wlr_output.h
+++ b/include/wlr/interfaces/wlr_output.h
@@ -13,9 +13,8 @@ struct wlr_output_impl {
int32_t height, int32_t refresh);
void (*transform)(struct wlr_output *output,
enum wl_output_transform transform);
- bool (*set_cursor)(struct wlr_output *output, const uint8_t *buf,
- int32_t stride, uint32_t width, uint32_t height,
- int32_t hotspot_x, int32_t hotspot_y, bool update_pixels);
+ bool (*set_cursor)(struct wlr_output *output, struct wlr_texture *texture,
+ int32_t hotspot_x, int32_t hotspot_y, bool update_texture);
bool (*move_cursor)(struct wlr_output *output, int x, int y);
void (*destroy)(struct wlr_output *output);
bool (*make_current)(struct wlr_output *output, int *buffer_age);