From 0236c79d8db96ce4598742b0211f9aa58269f819 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 3 Dec 2012 15:58:57 +0000 Subject: Rejig color conversion. Add a mechanism for getting a color converter function. Implement the 'convert a single color' call in terms of that. 'Bulk' users can then repeatedly call the single function. --- draw/draw_mesh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'draw') diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c index 14470da6..03d187f7 100644 --- a/draw/draw_mesh.c +++ b/draw/draw_mesh.c @@ -367,9 +367,11 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, if (shade->use_function) { + fz_color_converter cc; + fz_find_color_converter(&cc, ctx, dest->colorspace, shade->colorspace); for (i = 0; i < 256; i++) { - fz_convert_color(ctx, dest->colorspace, color, shade->colorspace, shade->function[i]); + cc.convert(&cc, color, shade->function[i]); for (k = 0; k < dest->colorspace->n; k++) clut[i][k] = color[k] * 255; clut[i][k] = shade->function[i][shade->colorspace->n] * 255; -- cgit v1.2.3