From 9045898fb68296fbe2b2dae3016b1e8e9fe1f509 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Thu, 4 Nov 2021 19:51:11 +0100 Subject: Don't rescale thumbnails in sRGB pixman is too slow at this, maybe do it later, and optionally. --- fastiv-browser.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fastiv-browser.c b/fastiv-browser.c index 818006c..dad48fa 100644 --- a/fastiv-browser.c +++ b/fastiv-browser.c @@ -225,12 +225,14 @@ rescale_thumbnail(cairo_surface_t *thumbnail) struct pixman_f_transform xform_floating; struct pixman_transform xform; - pixman_image_t *src = pixman_image_create_bits( - PIXMAN_a8r8g8b8_sRGB, width, height, + // PIXMAN_a8r8g8b8_sRGB can be used for gamma-correct results, + // but it's an incredibly slow transformation + pixman_format_code_t format = PIXMAN_a8r8g8b8; + + pixman_image_t *src = pixman_image_create_bits(format, width, height, (uint32_t *) cairo_image_surface_get_data(thumbnail), cairo_image_surface_get_stride(thumbnail)); - pixman_image_t *dest = pixman_image_create_bits( - PIXMAN_a8r8g8b8_sRGB, + pixman_image_t *dest = pixman_image_create_bits(format, cairo_image_surface_get_width(scaled), cairo_image_surface_get_height(scaled), (uint32_t *) cairo_image_surface_get_data(scaled), -- cgit v1.2.3-70-g09d2