diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index d490167dd..aaf10c378 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -879,7 +879,7 @@ int main(int argc, char *argv[]) { * to dig your fingers in and play with their behavior if you want. Note that * the clients cannot set the selection directly without compositor approval, * see the handling of the request_set_selection event below.*/ - wlr_compositor_create(server.wl_display, server.renderer); + wlr_compositor_create(server.wl_display, NULL); wlr_subcompositor_create(server.wl_display); wlr_data_device_manager_create(server.wl_display); diff --git a/types/scene/surface.c b/types/scene/surface.c index c58bcd940..20097a423 100644 --- a/types/scene/surface.c +++ b/types/scene/surface.c @@ -70,28 +70,6 @@ static void scene_surface_handle_surface_destroy( wlr_scene_node_destroy(&surface->buffer->node); } -// This is used for wlr_scene where it unconditionally locks buffers preventing -// reuse of the existing texture for shm clients. With the usage pattern of -// wlr_scene surface handling, we can mark its locked buffer as safe -// for mutation. -static void client_buffer_mark_next_can_damage(struct wlr_client_buffer *buffer) { - buffer->n_ignore_locks++; -} - -static void scene_buffer_unmark_client_buffer(struct wlr_scene_buffer *scene_buffer) { - if (!scene_buffer->buffer) { - return; - } - - struct wlr_client_buffer *buffer = wlr_client_buffer_get(scene_buffer->buffer); - if (!buffer) { - return; - } - - assert(buffer->n_ignore_locks > 0); - buffer->n_ignore_locks--; -} - static void set_buffer_with_surface_state(struct wlr_scene_buffer *scene_buffer, struct wlr_surface *surface) { struct wlr_surface_state *state = &surface->current; @@ -105,13 +83,9 @@ static void set_buffer_with_surface_state(struct wlr_scene_buffer *scene_buffer, wlr_scene_buffer_set_dest_size(scene_buffer, state->width, state->height); wlr_scene_buffer_set_transform(scene_buffer, state->transform); - scene_buffer_unmark_client_buffer(scene_buffer); - - if (surface->buffer) { - client_buffer_mark_next_can_damage(surface->buffer); - + if (surface->current.buffer) { wlr_scene_buffer_set_buffer_with_damage(scene_buffer, - &surface->buffer->base, &surface->buffer_damage); + surface->current.buffer, &surface->buffer_damage); } else { wlr_scene_buffer_set_buffer(scene_buffer, NULL); } @@ -150,8 +124,6 @@ static bool scene_buffer_point_accepts_input(struct wlr_scene_buffer *scene_buff static void surface_addon_destroy(struct wlr_addon *addon) { struct wlr_scene_surface *surface = wl_container_of(addon, surface, addon); - scene_buffer_unmark_client_buffer(surface->buffer); - wlr_addon_finish(&surface->addon); wl_list_remove(&surface->outputs_update.link); diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 5ffd59ca1..90b68ba43 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -626,7 +626,7 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff // if this node used to not be mapped or its previous displayed // buffer region will be different from what the new buffer would // produce we need to update the node. - update = !scene_buffer->buffer || + update = (!scene_buffer->buffer && !scene_buffer->texture) || (scene_buffer->dst_width == 0 && scene_buffer->dst_height == 0 && (scene_buffer->buffer->width != buffer->width || scene_buffer->buffer->height != buffer->height)); @@ -815,12 +815,6 @@ static struct wlr_texture *scene_buffer_get_texture( return NULL; } - struct wlr_client_buffer *client_buffer = - wlr_client_buffer_get(scene_buffer->buffer); - if (client_buffer != NULL) { - return client_buffer->texture; - } - if (scene_buffer->texture == NULL || !wlr_texture_update_from_buffer(scene_buffer->texture, scene_buffer->buffer, &scene_buffer->damage)) { struct wlr_texture *texture = wlr_texture_from_buffer(renderer, scene_buffer->buffer);