summaryrefslogtreecommitdiff
path: root/base/gdevdbit.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-04-28 20:34:17 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-05-03 12:05:05 +0100
commit2b5118c3fcb8e5cc58c9a3d87ad9fe327eece117 (patch)
tree0bff7932ad9f2ea74d30dfcb33c2b4942005ed92 /base/gdevdbit.c
parent623be737dbf836d5f037f0071900f645f24cf6cc (diff)
downloadghostpdl-2b5118c3fcb8e5cc58c9a3d87ad9fe327eece117.tar.gz
Remove get_bits in favour of get_bits_rectangle.
Diffstat (limited to 'base/gdevdbit.c')
-rw-r--r--base/gdevdbit.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/base/gdevdbit.c b/base/gdevdbit.c
index c4612f7c3..dbe893876 100644
--- a/base/gdevdbit.c
+++ b/base/gdevdbit.c
@@ -355,6 +355,7 @@ gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x,
int code = 0;
gx_color_value color_cv[GX_DEVICE_COLOR_MAX_COMPONENTS];
int ry, lx;
+ gs_int_rect rect;
fit_copy(dev, data, data_x, raster, id, x, y, width, height);
row = data;
@@ -366,6 +367,8 @@ gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x,
goto out;
}
(*dev_proc(dev, decode_color)) (dev, color, color_cv);
+ rect.p.x = 0;
+ rect.q.x = dev->width;
for (ry = y; ry < y + height; row += raster, ++ry) {
byte *line;
int sx, rx;
@@ -374,10 +377,23 @@ gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x,
int l_dbit = 0;
byte l_dbyte = ((l_dbit) ? (byte)(*(l_dptr) & (0xff00 >> (l_dbit))) : 0);
int l_xprev = x;
-
- code = (*dev_proc(dev, get_bits)) (dev, ry, lin, &line);
+ gs_get_bits_params_t params;
+
+ params.options = (GB_ALIGN_ANY |
+ (GB_RETURN_COPY | GB_RETURN_POINTER) |
+ GB_OFFSET_0 |
+ GB_RASTER_STANDARD | GB_PACKING_CHUNKY |
+ GB_COLORS_NATIVE | GB_ALPHA_NONE);
+ params.x_offset = 0;
+ params.raster = bitmap_raster(dev->width * dev->color_info.depth);
+ params.data[0] = lin;
+ rect.p.y = ry;
+ rect.q.y = ry+1;
+ code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect,
+ &params, NULL);
if (code < 0)
break;
+ line = params.data[0];
lx = x;
for (sx = data_x, rx = x; sx < data_x + width; ++sx, ++rx) {
gx_color_index previous = gx_no_color_index;