mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
compositor: make renderer optional
This is a first step towards moving texture uploading out of wlr_compositor. This commit allows compositors to opt-out of the texture uploading by passing a NULL wlr_renderer. An immediate user of this is gamescope, which currently implements a stub wlr_renderer just to make wlr_compositor happy.
This commit is contained in:
parent
1978a91717
commit
42016fa262
2 changed files with 15 additions and 4 deletions
|
|
@ -370,6 +370,10 @@ static void surface_apply_damage(struct wlr_surface *surface) {
|
|||
}
|
||||
}
|
||||
|
||||
if (surface->renderer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct wlr_client_buffer *buffer = wlr_client_buffer_create(
|
||||
surface->current.buffer, surface->renderer);
|
||||
|
||||
|
|
@ -699,8 +703,12 @@ static struct wlr_surface *surface_create(struct wl_client *client,
|
|||
pixman_region32_init(&surface->input_region);
|
||||
wlr_addon_set_init(&surface->addons);
|
||||
|
||||
wl_signal_add(&renderer->events.destroy, &surface->renderer_destroy);
|
||||
surface->renderer_destroy.notify = surface_handle_renderer_destroy;
|
||||
if (renderer != NULL) {
|
||||
wl_signal_add(&renderer->events.destroy, &surface->renderer_destroy);
|
||||
surface->renderer_destroy.notify = surface_handle_renderer_destroy;
|
||||
} else {
|
||||
wl_list_init(&surface->renderer_destroy.link);
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue