shm: get_buffer(): remove 'copies' argument; it's not used

This commit is contained in:
Daniel Eklöf 2019-11-02 00:23:51 +01:00
parent 632b6ee0ea
commit 8df82938b0
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 4 additions and 7 deletions

View file

@ -441,7 +441,7 @@ grid_render(struct terminal *term)
assert(term->width > 0); assert(term->width > 0);
assert(term->height > 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); wl_surface_attach(term->window->surface, buf->wl_buf, 0, 0);
pixman_image_t *pix = buf->pix; 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 width = 2 * margin + max(20, term->search.len) * term->cell_width;
const int height = 2 * margin + 1 * term->cell_height; 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 */ /* Background - yellow on empty/match, red on mismatch */
pixman_color_t color = color_hex_to_pixman( pixman_color_t color = color_hex_to_pixman(

4
shm.c
View file

@ -31,10 +31,8 @@ static const struct wl_buffer_listener buffer_listener = {
}; };
struct buffer * 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) { tll_foreach(buffers, it) {
if (it->item.width != width || it->item.height != height) if (it->item.width != width || it->item.height != height)
continue; continue;

3
shm.h
View file

@ -19,6 +19,5 @@ struct buffer {
pixman_image_t *pix; pixman_image_t *pix;
}; };
struct buffer *shm_get_buffer( struct buffer *shm_get_buffer(struct wl_shm *shm, int width, int height);
struct wl_shm *shm, int width, int height, size_t copies);
void shm_fini(void); void shm_fini(void);