aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-23 18:31:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-23 18:31:05 +0000
commit5ffee087481ddf3ad6e3b8e74c6acd3f0d736d82 (patch)
tree444bd2eee8fa5ec7ccd59ab1ce8988e452e81a48
parentMerge branch 'master' into scroll-damage-performance (diff)
shm: add shm_can_scroll()
-rw-r--r--shm.c7
-rw-r--r--shm.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/shm.c b/shm.c
index b9cc325c..59dcb2ac 100644
--- a/shm.c
+++ b/shm.c
@@ -281,8 +281,15 @@ 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);
diff --git a/shm.h b/shm.h
index 2b3a9b19..6801ed93 100644
--- a/shm.h
+++ b/shm.h
@@ -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);