diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-29 10:07:53 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-29 10:07:53 +0000 |
| commit | 2c7ee09dad6de4fe8a226eb4ec8fda26f783c240 (patch) | |
| tree | 159098e2db1a376b23a5ea729f9cf926d574714d /shm.h | |
| parent | ci: initial sr.ht build manifest (diff) | |
| parent | changelog: mention renderer performance improvements with scrolling (diff) | |
Merge branch 'scroll-damage-performance'
Diffstat (limited to 'shm.h')
| -rw-r--r-- | shm.h | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -2,6 +2,7 @@ #include <stdbool.h> #include <stddef.h> +#include <sys/types.h> #include <pixman.h> #include <wayland-client.h> @@ -13,20 +14,35 @@ struct buffer { int height; int stride; - bool purge; - bool busy; - size_t size; - void *mmapped; + size_t size; /* Buffer size */ + void *mmapped; /* Raw data (TODO: rename) */ struct wl_buffer *wl_buf; pixman_image_t *pix; + + /* Internal */ + int fd; /* memfd */ + struct wl_shm_pool *pool; + + void *real_mmapped; /* Address returned from mmap */ + size_t mmap_size; /* Size of mmap (>= size) */ + off_t offset; /* Offset into memfd where data begins */ + + bool scrollable; + bool purge; /* True if this buffer should be destroyed */ }; struct buffer *shm_get_buffer( - struct wl_shm *shm, int width, int height, unsigned long cookie); + struct wl_shm *shm, int width, int height, unsigned long cookie, bool scrollable); void shm_fini(void); +void shm_set_max_pool_size(off_t max_pool_size); +bool shm_can_scroll(const struct buffer *buf); +bool shm_scroll(struct wl_shm *shm, struct buffer *buf, int rows, + int top_margin, int top_keep_rows, + int bottom_margin, int bottom_keep_rows); + void shm_purge(struct wl_shm *shm, unsigned long cookie); struct terminal; |
