diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2020-11-19 19:09:49 +0100 |
---|---|---|
committer | Daniel Eklöf <daniel@ekloef.se> | 2020-11-19 19:09:49 +0100 |
commit | 01a4b857dccdfc6e493ea531bd69bbf037cc718c (patch) | |
tree | 6e07d3cb346a17ee7eebed416fc0f737aeddbf7a /main.c | |
parent | 8ad69724d288abe07f462f6d95ddf2ccff01d526 (diff) | |
download | wbg-01a4b857dccdfc6e493ea531bd69bbf037cc718c.tar.gz |
render: no need to pre-fill the surface with red
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -73,20 +73,12 @@ render(struct output *output) shm, width * scale, height * scale, (uintptr_t)(void *)output); assert(buf != NULL); - LOG_INFO("render: w=%d, h=%d", width * scale, height * scale); - - pixman_color_t color = {.red = 0xffff, .green = 0, .blue = 0, .alpha = 0xffff}; - pixman_image_fill_rectangles( - PIXMAN_OP_SRC, buf->pix, &color, 1, - &(pixman_rectangle16_t){0, 0, width * scale, height * scale}); - uint32_t *data = pixman_image_get_data(image); int img_width = pixman_image_get_width(image); int img_height = pixman_image_get_height(image); int img_stride = pixman_image_get_stride(image); pixman_format_code_t img_fmt = pixman_image_get_format(image); - pixman_image_t *pix = pixman_image_create_bits_no_clear( img_fmt, img_width, img_height, data, img_stride); @@ -107,6 +99,10 @@ render(struct output *output) pixman_image_unref(pix); + LOG_INFO("render: %dx%d (scaled from %dx%d)", + width * scale, height * scale, + img_width, img_height); + wl_surface_set_buffer_scale(output->surf, scale); wl_surface_attach(output->surf, buf->wl_buf, 0, 0); wl_surface_damage_buffer(output->surf, 0, 0, width * scale, height * scale); |