aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-01 23:23:51 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-01 23:23:51 +0000
commit8df82938b0549d0c5820ce258f0097a0370e75ea (patch)
tree94270df4b9b9bfc272f92bffc391d2c5e57f1803
parentshm: add debug logging of how large the allocated memory buffer is (diff)
shm: get_buffer(): remove 'copies' argument; it's not used
-rw-r--r--render.c4
-rw-r--r--shm.c4
-rw-r--r--shm.h3
3 files changed, 4 insertions, 7 deletions
diff --git a/render.c b/render.c
index 2386e073..37d1aee1 100644
--- a/render.c
+++ b/render.c
@@ -441,7 +441,7 @@ grid_render(struct terminal *term)
assert(term->width > 0);
assert(term->height > 0);
- struct buffer *buf = shm_get_buffer(term->wl->shm, term->width, term->height, 1 + term->render.workers.count);
+ struct buffer *buf = shm_get_buffer(term->wl->shm, term->width, term->height);
wl_surface_attach(term->window->surface, buf->wl_buf, 0, 0);
pixman_image_t *pix = buf->pix;
@@ -754,7 +754,7 @@ render_search_box(struct terminal *term)
const int width = 2 * margin + max(20, term->search.len) * term->cell_width;
const int height = 2 * margin + 1 * term->cell_height;
- struct buffer *buf = shm_get_buffer(term->wl->shm, width, height, 1);
+ struct buffer *buf = shm_get_buffer(term->wl->shm, width, height);
/* Background - yellow on empty/match, red on mismatch */
pixman_color_t color = color_hex_to_pixman(
diff --git a/shm.c b/shm.c
index 1b2c9d7c..fd962698 100644
--- a/shm.c
+++ b/shm.c
@@ -31,10 +31,8 @@ static const struct wl_buffer_listener buffer_listener = {
};
struct buffer *
-shm_get_buffer(struct wl_shm *shm, int width, int height, size_t copies)
+shm_get_buffer(struct wl_shm *shm, int width, int height)
{
- assert(copies >= 1);
-
tll_foreach(buffers, it) {
if (it->item.width != width || it->item.height != height)
continue;
diff --git a/shm.h b/shm.h
index 68013888..312d45a9 100644
--- a/shm.h
+++ b/shm.h
@@ -19,6 +19,5 @@ struct buffer {
pixman_image_t *pix;
};
-struct buffer *shm_get_buffer(
- struct wl_shm *shm, int width, int height, size_t copies);
+struct buffer *shm_get_buffer(struct wl_shm *shm, int width, int height);
void shm_fini(void);