Added software cursor fallback

This commit is contained in:
Scott Anderson 2017-06-26 17:34:15 +12:00
parent f252c5a792
commit 0cd94f0cf0
15 changed files with 115 additions and 42 deletions

View file

@ -13,6 +13,8 @@ struct wlr_output_impl {
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height);
bool (*move_cursor)(struct wlr_output_state *state, int x, int y);
void (*destroy)(struct wlr_output_state *state);
void (*make_current)(struct wlr_output_state *state);
void (*swap_buffers)(struct wlr_output_state *state);
};
struct wlr_output *wlr_output_create(struct wlr_output_impl *impl,

View file

@ -59,7 +59,7 @@ struct wlr_surface {
* calling this function.
*/
bool wlr_surface_attach_pixels(struct wlr_surface *surf, uint32_t format,
int width, int height, const unsigned char *pixels);
int stride, int width, int height, const unsigned char *pixels);
/**
* Attaches pixels from a wl_shm_buffer to this surface. The shm buffer may be
* invalidated after calling this function.

View file

@ -31,7 +31,7 @@ struct wlr_renderer *wlr_renderer_init(struct wlr_renderer_state *state,
struct wlr_surface_impl {
bool (*attach_pixels)(struct wlr_surface_state *state, uint32_t format,
int width, int height, const unsigned char *pixels);
int stride, int width, int height, const unsigned char *pixels);
bool (*attach_shm)(struct wlr_surface_state *state, uint32_t format,
struct wl_shm_buffer *shm);
// TODO: egl

View file

@ -42,6 +42,14 @@ struct wlr_output {
struct wl_signal frame;
struct wl_signal resolution;
} events;
struct {
bool is_sw;
int32_t x, y;
uint32_t width, height;
struct wlr_renderer *renderer;
struct wlr_surface *texture;
} cursor;
};
void wlr_output_enable(struct wlr_output *output, bool enable);
@ -55,5 +63,7 @@ bool wlr_output_move_cursor(struct wlr_output *output, int x, int y);
void wlr_output_destroy(struct wlr_output *output);
void wlr_output_effective_resolution(struct wlr_output *output,
int *width, int *height);
void wlr_output_make_current(struct wlr_output *output);
void wlr_output_swap_buffers(struct wlr_output *output);
#endif