Implement drm (egl) buffer attaching

This commit is contained in:
nyorain 2017-08-09 21:25:34 +02:00
parent 750d0ad458
commit 67369173aa
19 changed files with 308 additions and 23 deletions

View file

@ -133,6 +133,7 @@ bool wlr_output_set_cursor(struct wlr_output *output,
return true;
}
/*
wlr_log(L_INFO, "Falling back to software cursor");
output->cursor.is_sw = true;
@ -149,8 +150,9 @@ bool wlr_output_set_cursor(struct wlr_output *output,
wlr_texture_upload_pixels(output->cursor.texture, WL_SHM_FORMAT_ARGB8888,
stride, width, height, buf);
*/
return true;
return false;
}
bool wlr_output_move_cursor(struct wlr_output *output, int x, int y) {

View file

@ -99,12 +99,14 @@ static void surface_commit(struct wl_client *client,
// callbacks instead of immediately here
if (surface->current.buffer) {
struct wl_shm_buffer *buffer = wl_shm_buffer_get(surface->current.buffer);
if (!buffer) {
wlr_log(L_INFO, "Unknown buffer handle attached");
} else {
if (buffer) {
uint32_t format = wl_shm_buffer_get_format(buffer);
wlr_texture_upload_shm(surface->texture, format, buffer);
wl_resource_queue_event(surface->current.buffer, WL_BUFFER_RELEASE);
} else if (wlr_texture_upload_drm(surface->texture, surface->pending.buffer)) {
wl_resource_queue_event(surface->current.buffer, WL_BUFFER_RELEASE);
} else {
wlr_log(L_INFO, "Unknown buffer handle attached");
}
}
}