summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-06-26 17:43:06 +0100
committerRobin Watts <robin.watts@artifex.com>2015-06-29 12:14:49 +0100
commit051b4932219bed310e17505b2e73029d371a18ce (patch)
treeb9a650b6a900da04d8a3885c9ed9b00aa7b3abf7 /source/fitz/draw-device.c
parent074060eaf09044836c084453c4752d4ae283fabc (diff)
downloadmupdf-051b4932219bed310e17505b2e73029d371a18ce.tar.xz
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.
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r--source/fitz/draw-device.c6
1 files changed, 3 insertions, 3 deletions
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);