shm: split up buffer struct into internal/private and public parts

This commit is contained in:
Daniel Eklöf 2021-07-15 22:17:12 +02:00
parent a18959f2df
commit 75f7f21a48
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 127 additions and 99 deletions

21
shm.h
View file

@ -9,25 +9,13 @@
#include "terminal.h"
struct buffer_pool {
int fd; /* memfd */
struct wl_shm_pool *wl_pool;
void *real_mmapped; /* Address returned from mmap */
size_t mmap_size; /* Size of mmap (>= size) */
size_t ref_count;
};
struct buffer {
unsigned long cookie;
bool locked; /* Caller owned, shm wont destroy it */
int width;
int height;
int stride;
bool locked; /* Caller owned, shm wont destroy it */
bool busy; /* Owned by compositor */
size_t size; /* Buffer size */
void *mmapped; /* Raw data (TODO: rename) */
@ -35,13 +23,6 @@ struct buffer {
pixman_image_t **pix;
size_t pix_instances;
/* Internal */
struct buffer_pool *pool;
off_t offset; /* Offset into memfd where data begins */
bool scrollable;
bool purge; /* True if this buffer should be destroyed */
unsigned age;
struct damage *scroll_damage;
size_t scroll_damage_count;