aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-04 19:51:11 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-04 19:52:14 +0100
commit9045898fb68296fbe2b2dae3016b1e8e9fe1f509 (patch)
tree7a9f1b3b3069ffa74ae0668a53858565dd78396d
parent45df774cc9947e195019080608b217f0caf287ef (diff)
downloadfiv-9045898fb68296fbe2b2dae3016b1e8e9fe1f509.tar.gz
fiv-9045898fb68296fbe2b2dae3016b1e8e9fe1f509.tar.xz
fiv-9045898fb68296fbe2b2dae3016b1e8e9fe1f509.zip
Don't rescale thumbnails in sRGB
pixman is too slow at this, maybe do it later, and optionally.
-rw-r--r--fastiv-browser.c10
1 files 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),