mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
render: introduce shared memory allocator
It allocates in local main memory via shm_open, and provides a FD to allow sharing with other processes. This is suitable for software rendering under the Wayland and X11 backends.
This commit is contained in:
parent
6c61de996c
commit
c6b009ef85
3 changed files with 132 additions and 0 deletions
23
include/render/shm_allocator.h
Normal file
23
include/render/shm_allocator.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef RENDER_SHM_ALLOCATOR_H
|
||||
#define RENDER_SHM_ALLOCATOR_H
|
||||
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
#include "render/allocator.h"
|
||||
|
||||
struct wlr_shm_buffer {
|
||||
struct wlr_buffer base;
|
||||
struct wlr_shm_attributes shm;
|
||||
void *data;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct wlr_shm_allocator {
|
||||
struct wlr_allocator base;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new shared memory allocator.
|
||||
*/
|
||||
struct wlr_shm_allocator *wlr_shm_allocator_create(void);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue