diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2023-02-15 12:30:34 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2023-02-16 14:50:13 +0000 |
commit | 37c28d47e57e74874125345986b3f465d97f3b61 (patch) | |
tree | b687059da3d26b9d506abde7ec4275722b5bc0e6 /base | |
parent | a56475f02fb26fe49ef4eccdc38a073ba5074b6c (diff) | |
download | ghostpdl-37c28d47e57e74874125345986b3f465d97f3b61.tar.gz |
Revert recent changes to alphabits device sizing.
Revert "Bug 706368: alphabits device declares invalid width/height."
Use the horrible, hacky non_strict_bounds flag instead.
Ideally this should be fixed in a better way, but this should
hopefully stabilise things for the release.
Diffstat (limited to 'base')
-rw-r--r-- | base/gdevddrw.c | 2 | ||||
-rw-r--r-- | base/gspaint.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/base/gdevddrw.c b/base/gdevddrw.c index 240e06213..10eed86b5 100644 --- a/base/gdevddrw.c +++ b/base/gdevddrw.c @@ -427,7 +427,7 @@ gx_default_fill_trapezoid(gx_device * dev, const gs_fixed_edge * left, /* Some devices init max->width to be int_max, which overflows when converted to fixed. */ int dw = dev->width > max_int_in_fixed ? max_int_in_fixed : dev->width; if (ytop < 0) - return 0; + return 0; if (ybot < 0) ybot = 0; dw = int2fixed(dw); diff --git a/base/gspaint.c b/base/gspaint.c index b3500c1d5..a641a996f 100644 --- a/base/gspaint.c +++ b/base/gspaint.c @@ -208,7 +208,6 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, gs_fixed_rect bbox; gs_int_rect ibox; uint width, raster, band_space; - uint dev_width, dev_height; uint height, height2; gs_log2_scale_point log2_scale; gs_memory_t *mem; @@ -224,7 +223,6 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, if ((ibox.q.y <= ibox.p.y) || (ibox.q.x <= ibox.p.x)) return 2; width = (ibox.q.x - ibox.p.x) << log2_scale.x; - dev_width = ibox.q.x << log2_scale.x; raster = bitmap_raster(width); band_space = raster << log2_scale.y; height2 = (ibox.q.y - ibox.p.y); @@ -234,7 +232,6 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, if (height > height2) height = height2; height <<= log2_scale.y; - dev_height = ibox.q.y << log2_scale.y; mem = pgs->memory; mdev = gs_alloc_struct(mem, gx_device_memory, &st_device_memory, "alpha_buffer_init"); @@ -247,9 +244,13 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, } gs_make_mem_abuf_device(mdev, mem, dev, &log2_scale, alpha_bits, ibox.p.x << log2_scale.x, devn); - mdev->width = dev_width; - mdev->height = dev_height; + mdev->width = width; + mdev->height = height; mdev->bitmap_memory = mem; + /* Set the horrible hacky flag that tells people that the width/height here + * have been set for *our* convenience, rather than accurately depicting the + * size of the device for callers. */ + mdev->non_strict_bounds = 1; if ((*dev_proc(mdev, open_device)) ((gx_device *) mdev) < 0) { /* No room for bits, punt. */ gs_free_object(mem, mdev, "alpha_buffer_init"); |