Documentation for <wlr/render/wlr_renderer.h>

Back to index

Table of contents

wlr_render_timer_create()

struct wlr_render_timer *wlr_render_timer_create(​struct wlr_renderer *renderer);

Allocate and initialise a new render timer.

wlr_render_timer_destroy()

void wlr_render_timer_destroy(​struct wlr_render_timer *timer);

Destroy the render timer.

wlr_render_timer_get_duration_ns()

int wlr_render_timer_get_duration_ns(​struct wlr_render_timer *timer);

Get the render duration in nanoseconds from the timer.

Returns -1 if the duration is unavailable.

struct wlr_renderer

struct wlr_renderer {
	struct {
		struct wl_signal destroy;
		/**
		 * Emitted when the GPU is lost, e.g. on GPU reset.
		 *
		 * Compositors should destroy the renderer and re-create it.
		 */
		struct wl_signal lost;
	} events;
	
	// private state
	
	const struct wlr_renderer_impl *impl;
};

A renderer for basic 2D operations.

wlr_renderer_autocreate()

struct wlr_renderer *wlr_renderer_autocreate(​struct wlr_backend *backend);

Automatically create a new renderer.

Selects an appropriate renderer type to use depending on the backend, platform, environment, etc.

wlr_renderer_destroy()

void wlr_renderer_destroy(​struct wlr_renderer *renderer);

Destroys the renderer.

Textures must be destroyed separately.

wlr_renderer_get_dmabuf_texture_formats()

const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats(​struct wlr_renderer *renderer);

Get the DMA-BUF formats supporting sampling usage. Buffers allocated with a format from this list may be imported via wlr_texture_from_dmabuf().

wlr_renderer_get_drm_fd()

int wlr_renderer_get_drm_fd(​struct wlr_renderer *r);

Obtains the FD of the DRM device used for rendering, or -1 if unavailable.

The caller doesn't have ownership of the FD, it must not close it.

wlr_renderer_get_shm_texture_formats()

const uint32_t *wlr_renderer_get_shm_texture_formats(​struct wlr_renderer *r, size_t *len);

Get the shared-memory formats supporting import usage. Buffers allocated with a format from this list may be imported via wlr_texture_from_pixels().

wlr_renderer_init_wl_display()

bool wlr_renderer_init_wl_display(​struct wlr_renderer *r, struct wl_display *wl_display);

wlr_renderer_init_wl_shm()

bool wlr_renderer_init_wl_shm(​struct wlr_renderer *r, struct wl_display *wl_display);