From: Øyvind Kolås Date: Mon, 24 Jan 2022 06:01:12 +0000 (+0100) Subject: ctx: factor lut processing out of path_process X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~4^2~39 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a5c593af3b01e26a48e7d4e88d1d0104a12fcb1;p=babl.git ctx: factor lut processing out of path_process --- diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 422e9f4..f709c3f 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -756,15 +756,12 @@ babl_gc_fishes (void) // is responsibility of higher layers } -static void -babl_fish_path_process (const Babl *babl, - const char *source, - char *destination, - long n, - void *data) +static int babl_fish_lut_process_maybe (const Babl *babl, + const char *source, + const char *destination, + long n, + void *data) { - if (babl->fish_path.is_u8_color_conv) - { uint32_t *lut = (uint32_t*)babl->fish_path.u8_lut; ((Babl*)babl)->fish.pixels += n; @@ -867,8 +864,26 @@ babl_fish_path_process (const Babl *babl, } } BABL(babl)->fish_path.last_lut_use = babl_ticks (); - return; + return 1; } + return 0; +} + +static void +babl_fish_path_process (const Babl *babl, + const char *source, + char *destination, + long n, + void *data) +{ + if (babl->fish_path.is_u8_color_conv) + { + if (babl_fish_lut_process_maybe (babl, + source, + destination, + n, + data)) + return; } else {