summaryrefslogtreecommitdiff
path: root/draw/draw_device.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-04-05 20:30:38 +0100
committerTor Andersson <tor.andersson@artifex.com>2011-04-06 02:10:48 +0200
commit87103a29cc90e5b48279f31ae98de1d530b90f18 (patch)
tree148f02554c26b7635383eb315b89b15959d83ac6 /draw/draw_device.c
parent4bce9580c3ff1e2a4e755c35ac3c1a913aebdcbb (diff)
downloadmupdf-87103a29cc90e5b48279f31ae98de1d530b90f18.tar.xz
Add special case gray image -> rgb device rendering code.
New code to render grayscale images on an rgb device without converting to rgb first.
Diffstat (limited to 'draw/draw_device.c')
-rw-r--r--draw/draw_device.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c
index 05f96f28..e49fb04d 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -615,11 +615,18 @@ fz_draw_fill_image(void *user, fz_pixmap *image, fz_matrix ctm, float alpha)
image = scaled;
}
- if (image->colorspace != model && after)
+ if (image->colorspace != model)
{
- converted = fz_new_pixmap(model, image->x, image->y, image->w, image->h);
- fz_convert_pixmap(image, converted);
- image = converted;
+ if (image->colorspace == fz_device_gray && model == fz_device_rgb)
+ {
+ /* We have special case rendering code for gray -> rgb */
+ }
+ else
+ {
+ converted = fz_new_pixmap(model, image->x, image->y, image->w, image->h);
+ fz_convert_pixmap(image, converted);
+ image = converted;
+ }
}
fz_paint_image(dev->dest, dev->scissor, image, ctm, alpha * 255);