summaryrefslogtreecommitdiff
path: root/draw/draw_device.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-01-20 17:29:35 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-01-20 17:29:35 +0100
commit33d225213dac1217a86c00d0e8e8ca6d7503cbb2 (patch)
tree77c4f72456aea454ad81f3d774479efba29018f9 /draw/draw_device.c
parentabfe2842c2c9469988a83221c8d92fafa3195f40 (diff)
downloadmupdf-33d225213dac1217a86c00d0e8e8ca6d7503cbb2.tar.xz
Revert "Bitmap 'patch' scaling."
This reverts commit 08e84b18e5c1dbe8f3d32dd0aeb4b4c43debce9f.
Diffstat (limited to 'draw/draw_device.c')
-rw-r--r--draw/draw_device.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c
index 1cb3e4b9..9a238b73 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -821,7 +821,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha)
}
static fz_pixmap *
-fz_transform_pixmap(fz_context *ctx, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, fz_bbox *clip)
+fz_transform_pixmap(fz_context *ctx, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit)
{
fz_pixmap *scaled;
@@ -831,7 +831,7 @@ fz_transform_pixmap(fz_context *ctx, fz_pixmap *image, fz_matrix *ctm, int x, in
fz_matrix m = *ctm;
if (gridfit)
fz_gridfit_matrix(&m);
- scaled = fz_scale_pixmap(ctx, image, m.e, m.f, m.a, m.d, clip);
+ scaled = fz_scale_pixmap(ctx, image, m.e, m.f, m.a, m.d);
if (!scaled)
return NULL;
ctm->a = scaled->w;
@@ -845,17 +845,9 @@ fz_transform_pixmap(fz_context *ctx, fz_pixmap *image, fz_matrix *ctm, int x, in
{
/* Other orthogonal flip/rotation cases */
fz_matrix m = *ctm;
- fz_bbox rclip;
if (gridfit)
fz_gridfit_matrix(&m);
- if (clip)
- {
- rclip.x0 = clip->y0;
- rclip.y0 = clip->x0;
- rclip.x1 = clip->y1;
- rclip.y1 = clip->x1;
- }
- scaled = fz_scale_pixmap(ctx, image, m.f, m.e, m.b, m.c, (clip ? &rclip : 0));
+ scaled = fz_scale_pixmap(ctx, image, m.f, m.e, m.b, m.c);
if (!scaled)
return NULL;
ctm->b = scaled->w;
@@ -868,7 +860,7 @@ fz_transform_pixmap(fz_context *ctx, fz_pixmap *image, fz_matrix *ctm, int x, in
/* Downscale, non rectilinear case */
if (dx > 0 && dy > 0)
{
- scaled = fz_scale_pixmap(ctx, image, 0, 0, (float)dx, (float)dy, NULL);
+ scaled = fz_scale_pixmap(ctx, image, 0, 0, (float)dx, (float)dy);
return scaled;
}
@@ -886,9 +878,6 @@ fz_draw_fill_image(fz_device *devp, fz_pixmap *image, fz_matrix ctm, float alpha
fz_context *ctx = dev->ctx;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_bbox clip = fz_bound_pixmap(state->dest);
-
- clip = fz_intersect_bbox(clip, state->scissor);
fz_var(scaled);
@@ -926,14 +915,14 @@ fz_draw_fill_image(fz_device *devp, fz_pixmap *image, fz_matrix ctm, float alpha
if (dx < image->w && dy < image->h)
{
int gridfit = alpha == 1.0f && !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);
- scaled = fz_transform_pixmap(ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);
+ scaled = fz_transform_pixmap(ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit);
if (!scaled)
{
if (dx < 1)
dx = 1;
if (dy < 1)
dy = 1;
- scaled = fz_scale_pixmap(ctx, image, image->x, image->y, dx, dy, NULL);
+ scaled = fz_scale_pixmap(ctx, image, image->x, image->y, dx, dy);
}
if (scaled)
image = scaled;
@@ -984,9 +973,6 @@ fz_draw_fill_image_mask(fz_device *devp, fz_pixmap *image, fz_matrix ctm,
int i;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
- fz_bbox clip = fz_bound_pixmap(state->dest);
-
- clip = fz_intersect_bbox(clip, state->scissor);
if (image->w == 0 || image->h == 0)
return;
@@ -999,14 +985,14 @@ fz_draw_fill_image_mask(fz_device *devp, fz_pixmap *image, fz_matrix ctm,
if (dx < image->w && dy < image->h)
{
int gridfit = alpha == 1.0f && !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);
- scaled = fz_transform_pixmap(dev->ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);
+ scaled = fz_transform_pixmap(dev->ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit);
if (!scaled)
{
if (dx < 1)
dx = 1;
if (dy < 1)
dy = 1;
- scaled = fz_scale_pixmap(dev->ctx, image, image->x, image->y, dx, dy, NULL);
+ scaled = fz_scale_pixmap(dev->ctx, image, image->x, image->y, dx, dy);
}
if (scaled)
image = scaled;
@@ -1039,9 +1025,6 @@ fz_draw_clip_image_mask(fz_device *devp, fz_pixmap *image, fz_rect *rect, fz_mat
int dx, dy;
fz_draw_state *state = push_stack(dev);
fz_colorspace *model = state->dest->colorspace;
- fz_bbox clip = fz_bound_pixmap(state->dest);
-
- clip = fz_intersect_bbox(clip, state->scissor);
fz_var(mask);
fz_var(dest);
@@ -1083,14 +1066,14 @@ fz_draw_clip_image_mask(fz_device *devp, fz_pixmap *image, fz_rect *rect, fz_mat
if (dx < image->w && dy < image->h)
{
int gridfit = !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);
- scaled = fz_transform_pixmap(dev->ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);
+ scaled = fz_transform_pixmap(dev->ctx, image, &ctm, state->dest->x, state->dest->y, dx, dy, gridfit);
if (!scaled)
{
if (dx < 1)
dx = 1;
if (dy < 1)
dy = 1;
- scaled = fz_scale_pixmap(dev->ctx, image, image->x, image->y, dx, dy, NULL);
+ scaled = fz_scale_pixmap(dev->ctx, image, image->x, image->y, dx, dy);
}
if (scaled)
image = scaled;