From 09bbea5760c1fec3f198db9ad42494d15a949f14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 25 Feb 2023 19:46:35 +0100 Subject: [PATCH] LUT: do not use LUTs by default The code marking LUTs as available for fishes is now protected behind an environment variable BABL_LUT if it is set, the LUT code is re-enabled. --- babl/babl-fish-path.c | 9 +++++++++ babl/babl.c | 1 + 2 files changed, 10 insertions(+) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 2cfb507..90135c3 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -32,6 +32,8 @@ #define MIN(a, b) (((a) > (b)) ? (b) : (a)) #endif +static int enable_lut = 0; + typedef struct GcContext { long time; } GcContext; @@ -605,6 +607,12 @@ _babl_legal_error (void) else debug_conversions = 0; + env = getenv ("BABL_LUT"); + if (env && env[0] != '\0') + enable_lut = 1; + else + enable_lut = 0; + return error; } @@ -952,6 +960,7 @@ _babl_fish_prepare_bpp (Babl *babl) babl_log ("-eeek{%i}\n", babl_dest->instance.class_type - BABL_MAGIC); } + if (enable_lut) { int source_bpp = babl->fish_path.source_bpp; int dest_bpp = babl->fish_path.dest_bpp; diff --git a/babl/babl.c b/babl/babl.c index 8a6f29a..23db1a3 100644 --- a/babl/babl.c +++ b/babl/babl.c @@ -113,6 +113,7 @@ babl_init (void) babl_type_db (); babl_trc_class_init (); babl_space_class_init (); + _babl_legal_error (); babl_component_db (); babl_model_db (); babl_format_db (); -- 2.30.2