2019-06-12 20:08:54 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
2019-08-16 20:40:32 +02:00
|
|
|
#include <pixman.h>
|
2019-06-12 20:08:54 +02:00
|
|
|
#include <wayland-client.h>
|
|
|
|
|
|
|
|
|
|
struct buffer {
|
2019-11-02 00:33:37 +01:00
|
|
|
unsigned long cookie;
|
|
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
int width;
|
|
|
|
|
int height;
|
2019-08-16 20:40:32 +02:00
|
|
|
int stride;
|
2019-06-12 20:08:54 +02:00
|
|
|
|
2019-11-02 01:27:05 +01:00
|
|
|
bool purge;
|
|
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
bool busy;
|
|
|
|
|
size_t size;
|
|
|
|
|
void *mmapped;
|
|
|
|
|
|
|
|
|
|
struct wl_buffer *wl_buf;
|
2019-08-16 22:54:05 +02:00
|
|
|
pixman_image_t *pix;
|
2019-06-12 20:08:54 +02:00
|
|
|
};
|
|
|
|
|
|
2019-11-02 00:33:37 +01:00
|
|
|
struct buffer *shm_get_buffer(
|
|
|
|
|
struct wl_shm *shm, int width, int height, unsigned long cookie);
|
2019-06-12 20:08:54 +02:00
|
|
|
void shm_fini(void);
|
2019-11-02 00:49:00 +01:00
|
|
|
|
|
|
|
|
void shm_purge(struct wl_shm *shm, unsigned long cookie);
|