summaryrefslogtreecommitdiff
path: root/draw/draw_device.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-06 20:36:09 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-06 20:36:09 +0200
commit71b44f14fd09fe3cb404f6f9225b3e4987328e15 (patch)
treee96d368b12513abc40f34f3534a9266125f651b5 /draw/draw_device.c
parent4a8af0a2b86fcb737cb7162b6e6926540f2f1af2 (diff)
downloadmupdf-71b44f14fd09fe3cb404f6f9225b3e4987328e15.tar.xz
Rename span to stride, and add gray->bgr fast path image drawing.
Diffstat (limited to 'draw/draw_device.c')
-rw-r--r--draw/draw_device.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c
index e49fb04d..fe93183d 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -531,7 +531,7 @@ fz_transform_pixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int
{
fz_pixmap *scaled;
- if ((ctm->a != 0) && (ctm->b == 0) && (ctm->c == 0) && (ctm->d != 0))
+ if (ctm->a != 0 && ctm->b == 0 && ctm->c == 0 && ctm->d != 0)
{
/* Unrotated or X flip or Yflip or XYflip */
scaled = fz_scale_pixmap(image, ctm->e, ctm->f, ctm->a, ctm->d);
@@ -543,7 +543,7 @@ fz_transform_pixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int
ctm->f = scaled->y;
return scaled;
}
- if ((ctm->a == 0) && (ctm->b != 0) && (ctm->c != 0) && (ctm->d == 0))
+ if (ctm->a == 0 && ctm->b != 0 && ctm->c != 0 && ctm->d == 0)
{
/* Other orthogonal flip/rotation cases */
scaled = fz_scale_pixmap(image, ctm->f, ctm->e, ctm->b, ctm->c);
@@ -556,7 +556,7 @@ fz_transform_pixmap(fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int
return scaled;
}
/* Downscale, non rectilinear case */
- if ((dx > 0) && (dy > 0))
+ if (dx > 0 && dy > 0)
{
scaled = fz_scale_pixmap(image, 0, 0, (float)dx, (float)dy);
return scaled;
@@ -617,9 +617,10 @@ fz_draw_fill_image(void *user, fz_pixmap *image, fz_matrix ctm, float alpha)
if (image->colorspace != model)
{
- if (image->colorspace == fz_device_gray && model == fz_device_rgb)
+ if ((image->colorspace == fz_device_gray && model == fz_device_rgb) ||
+ (image->colorspace == fz_device_gray && model == fz_device_bgr))
{
- /* We have special case rendering code for gray -> rgb */
+ /* We have special case rendering code for gray -> rgb/bgr */
}
else
{