From 0d90dddfab48a12a7519c11c6062b717ca3b7581 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Sun, 17 Jan 2021 23:15:36 -0500 Subject: render: introduce pixman renderer --- include/render/pixman.h | 49 +++++++++++++++++++++++++++++++++++++++++++++ include/wlr/render/pixman.h | 17 ++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 include/render/pixman.h create mode 100644 include/wlr/render/pixman.h (limited to 'include') diff --git a/include/render/pixman.h b/include/render/pixman.h new file mode 100644 index 00000000..f4cab45e --- /dev/null +++ b/include/render/pixman.h @@ -0,0 +1,49 @@ +#ifndef RENDER_PIXMAN_H +#define RENDER_PIXMAN_H + +#include +#include +#include +#include "render/pixel_format.h" + +struct wlr_pixman_pixel_format { + uint32_t drm_format; + pixman_format_code_t pixman_format; +}; + +struct wlr_pixman_buffer; + +struct wlr_pixman_renderer { + struct wlr_renderer wlr_renderer; + + struct wl_list buffers; // wlr_pixman_buffer.link + + struct wlr_pixman_buffer *current_buffer; + int32_t width, height; + + struct wlr_drm_format_set drm_formats; +}; + +struct wlr_pixman_buffer { + struct wlr_buffer *buffer; + struct wlr_pixman_renderer *renderer; + + pixman_image_t *image; + + struct wl_listener buffer_destroy; + struct wl_list link; // wlr_pixman_renderer.buffers +}; + +struct wlr_pixman_texture { + struct wlr_texture wlr_texture; + struct wlr_pixman_renderer *renderer; + + void *data; + pixman_image_t *image; + const struct wlr_pixel_format_info *format; +}; + +pixman_format_code_t get_pixman_format_from_drm(uint32_t fmt); +const uint32_t *get_pixman_drm_formats(size_t *len); + +#endif diff --git a/include/wlr/render/pixman.h b/include/wlr/render/pixman.h new file mode 100644 index 00000000..713e431d --- /dev/null +++ b/include/wlr/render/pixman.h @@ -0,0 +1,17 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_RENDER_PIXMAN_H +#define WLR_RENDER_PIXMAN_H + +#include +#include + +struct wlr_renderer *wlr_pixman_renderer_create(void); + +#endif -- cgit v1.2.3