From 051b4932219bed310e17505b2e73029d371a18ce Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 26 Jun 2015 17:43:06 +0100 Subject: Rejig the internals of fz_image slightly. Previously, we had people calling image->get_pixmap directly. Now we have them all call fz_image_get_pixmap, which will look for a cached version in the store, and only call get_pixmap if required. Previously fz_image_get_pixmap used to look for the cached version in the store, and decode if not - hence the decoding code is now extracted out into standard_image_get_pixmap. This was the original intent of the code, it just somehow didn't end up like that. This nicely queues us up for being able to have fz_images that use a different get_pixel implementation, such as that which will be required for the gprf code. --- source/fitz/draw-device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/fitz/draw-device.c') diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index b2819a0b..a2499016 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -1116,7 +1116,7 @@ fz_draw_fill_image(fz_context *ctx, fz_device *devp, fz_image *image, const fz_m dx = sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b); dy = sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d); - pixmap = fz_new_pixmap_from_image(ctx, image, dx, dy); + pixmap = fz_image_get_pixmap(ctx, image, dx, dy); orig_pixmap = pixmap; /* convert images with more components (cmyk->rgb) before scaling */ @@ -1216,7 +1216,7 @@ fz_draw_fill_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const dx = sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b); dy = sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d); - pixmap = fz_new_pixmap_from_image(ctx, image, dx, dy); + pixmap = fz_image_get_pixmap(ctx, image, dx, dy); orig_pixmap = pixmap; fz_try(ctx) @@ -1319,7 +1319,7 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const fz_try(ctx) { - pixmap = fz_new_pixmap_from_image(ctx, image, dx, dy); + pixmap = fz_image_get_pixmap(ctx, image, dx, dy); orig_pixmap = pixmap; state[1].mask = mask = fz_new_pixmap_with_bbox(ctx, NULL, &bbox); -- cgit v1.2.3