render/swapchain: switch to init()/finish()

This commit is contained in:
Simon Ser 2023-02-20 19:14:48 +01:00
parent ef49909da8
commit 53757b18bd
8 changed files with 62 additions and 71 deletions

View file

@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <wlr/backend.h>
#include <wlr/render/swapchain.h>
#include <wlr/render/wlr_renderer.h>
struct wlr_drm_backend;
@ -19,7 +20,7 @@ struct wlr_drm_renderer {
struct wlr_drm_surface {
struct wlr_drm_renderer *renderer;
struct wlr_swapchain *swapchain;
struct wlr_swapchain swapchain;
};
struct wlr_drm_fb {

View file

@ -26,10 +26,10 @@ struct wlr_swapchain {
struct wl_listener allocator_destroy;
};
struct wlr_swapchain *wlr_swapchain_create(
bool wlr_swapchain_init(struct wlr_swapchain *swapchain,
struct wlr_allocator *alloc, int width, int height,
const struct wlr_drm_format *format);
void wlr_swapchain_destroy(struct wlr_swapchain *swapchain);
void wlr_swapchain_finish(struct wlr_swapchain *swapchain);
/**
* Acquire a buffer from the swap chain.
*

View file

@ -14,6 +14,7 @@
#include <time.h>
#include <wayland-server-protocol.h>
#include <wayland-util.h>
#include <wlr/render/swapchain.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/util/addon.h>
@ -192,7 +193,7 @@ struct wlr_output {
struct wl_list cursors; // wlr_output_cursor::link
struct wlr_output_cursor *hardware_cursor;
struct wlr_swapchain *cursor_swapchain;
struct wlr_swapchain cursor_swapchain;
struct wlr_buffer *cursor_front_buffer;
int software_cursor_locks; // number of locks forcing software cursors
@ -200,7 +201,7 @@ struct wlr_output {
struct wlr_allocator *allocator;
struct wlr_renderer *renderer;
struct wlr_swapchain *swapchain;
struct wlr_swapchain swapchain;
struct wlr_buffer *back_buffer;
struct wl_listener display_destroy;