diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-12-16 22:57:34 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-12-16 22:57:34 +0000 |
commit | 9226be6fc39f4be98107681ccb08cbc7bbee87d2 (patch) | |
tree | 787394b20e094f44c78ed83be0ebf842f2f532a2 /fitz | |
parent | 49796efb66a648dc56ce5c209d9660affea72a5d (diff) | |
download | mupdf-9226be6fc39f4be98107681ccb08cbc7bbee87d2.tar.xz |
Fill entire scissor region with shading background color.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/dev_draw.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fitz/dev_draw.c b/fitz/dev_draw.c index aef2ee1e..f61f1613 100644 --- a/fitz/dev_draw.c +++ b/fitz/dev_draw.c @@ -470,19 +470,15 @@ fz_drawfillshade(void *user, fz_shade *shade, fz_matrix ctm, float alpha) fz_colorspace *model = dev->dest->colorspace; fz_pixmap *dest = dev->dest; fz_rect bounds; - fz_bbox bbox; + fz_bbox bbox, scissor; float colorfv[FZ_MAXCOLORS]; unsigned char colorbv[FZ_MAXCOLORS + 1]; bounds = fz_boundshade(shade, ctm); bbox = fz_intersectbbox(fz_roundrect(bounds), dev->scissor); + scissor = dev->scissor; // TODO: proper clip by shade->bbox - if (!fz_isemptyrect(shade->bbox)) - { - bounds = fz_transformrect(fz_concat(shade->matrix, ctm), shade->bbox); - bbox = fz_intersectbbox(fz_roundrect(bounds), bbox); - } if (fz_isemptyrect(bbox)) return; @@ -509,10 +505,10 @@ fz_drawfillshade(void *user, fz_shade *shade, fz_matrix ctm, float alpha) colorbv[i] = 255; n = dest->n; - for (y = bbox.y0; y < bbox.y1; y++) + for (y = scissor.y0; y < scissor.y1; y++) { - s = dest->samples + ((bbox.x0 - dest->x) + (y - dest->y) * dest->w) * dest->n; - for (x = bbox.x0; x < bbox.x1; x++) + s = dest->samples + ((scissor.x0 - dest->x) + (y - dest->y) * dest->w) * dest->n; + for (x = scissor.x0; x < scissor.x1; x++) { for (i = 0; i < n; i++) *s++ = colorbv[i]; |