summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2021-05-15 12:44:31 -0400
committerSimon Ser <contact@emersion.fr>2021-07-19 11:41:24 +0200
commit69827e97dbdee569f0e0987cf6e24acb48217301 (patch)
tree735b9e1c727a960b91d4d2de47179088ca495dbf /include
parentb9bf8d4b28ab174be722eb617eb18c0b63721c66 (diff)
downloadswaybg-69827e97dbdee569f0e0987cf6e24acb48217301.tar.gz
swaybg-69827e97dbdee569f0e0987cf6e24acb48217301.tar.bz2
Create/destroy a new shm buffer per frame
Caching these actually increased memory usage after startup; compositors like Sway tend to release the buffer on receipt (since they have already copied the shm buffer to an OpenGL equivalent) so the shm buffer is no longer needed after being used. Outputs (when not in nested mode) are generally only configured/drawn once, so there is no point in caching data for the future.
Diffstat (limited to 'include')
-rw-r--r--include/pool-buffer.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/pool-buffer.h b/include/pool-buffer.h
index a3930e0..8c6f4dd 100644
--- a/include/pool-buffer.h
+++ b/include/pool-buffer.h
@@ -9,14 +9,12 @@ struct pool_buffer {
struct wl_buffer *buffer;
cairo_surface_t *surface;
cairo_t *cairo;
- uint32_t width, height;
void *data;
size_t size;
- bool busy;
};
-struct pool_buffer *get_next_buffer(struct wl_shm *shm,
- struct pool_buffer pool[static 2], uint32_t width, uint32_t height);
+bool create_buffer(struct pool_buffer *buffer, struct wl_shm *shm,
+ int32_t width, int32_t height, uint32_t format);
void destroy_buffer(struct pool_buffer *buffer);
#endif