shm: add shm_can_scroll()

This commit is contained in:
Daniel Eklöf 2020-03-23 19:31:05 +01:00
parent 6bc9fd4ba1
commit 5ffee08748
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 8 additions and 0 deletions

7
shm.c
View file

@ -280,9 +280,16 @@ shm_fini(void)
}
}
bool
shm_can_scroll(void)
{
return can_punch_hole;
}
bool
shm_scroll(struct wl_shm *shm, struct buffer *buf, int rows)
{
assert(can_punch_hole);
assert(buf->busy);
assert(buf->pix);
assert(buf->wl_buf);

1
shm.h
View file

@ -32,6 +32,7 @@ struct buffer *shm_get_buffer(
struct wl_shm *shm, int width, int height, unsigned long cookie);
void shm_fini(void);
bool shm_can_scroll(void);
bool shm_scroll(struct wl_shm *shm, struct buffer *buf, int rows);
void shm_purge(struct wl_shm *shm, unsigned long cookie);