diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2023-02-15 12:29:04 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2023-02-16 14:50:13 +0000 |
commit | a56475f02fb26fe49ef4eccdc38a073ba5074b6c (patch) | |
tree | c9d2c6acf72b88d6f7efb1ce5f25cc25754de153 /base | |
parent | 6ff824c49601ab3b6fee6a9e1f45c0fed3cc1d1d (diff) | |
download | ghostpdl-a56475f02fb26fe49ef4eccdc38a073ba5074b6c.tar.gz |
Add dev->non_strict_bounds flag.
This indicates that callers cannot assume that any calls to a
device will be clipped at device bounds. In particular the
alphabits device needs to set this as the width/height that
it uses are misleading at best.
Diffstat (limited to 'base')
-rw-r--r-- | base/gdevddrw.c | 4 | ||||
-rw-r--r-- | base/gdevp14.c | 3 | ||||
-rw-r--r-- | base/gxclist.c | 3 | ||||
-rw-r--r-- | base/gxdevcli.h | 3 | ||||
-rw-r--r-- | base/gxdevice.h | 3 | ||||
-rw-r--r-- | base/gxpcmap.c | 1 |
6 files changed, 11 insertions, 6 deletions
diff --git a/base/gdevddrw.c b/base/gdevddrw.c index 07c9c0159..240e06213 100644 --- a/base/gdevddrw.c +++ b/base/gdevddrw.c @@ -422,7 +422,7 @@ gx_default_fill_trapezoid(gx_device * dev, const gs_fixed_edge * left, bool fill_direct = color_writes_pure(pdevc, lop); if (swap_axes) { - if (dev->width != 0) + if (dev->width != 0 && dev->non_strict_bounds == 0) { /* 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; @@ -442,7 +442,7 @@ gx_default_fill_trapezoid(gx_device * dev, const gs_fixed_edge * left, else return gx_fill_trapezoid_as_nd(dev, left, right, ybot, ytop, 0, pdevc, lop); } else { - if (dev->height != 0) + if (dev->height != 0 && dev->non_strict_bounds == 0) { /* Some devices init max->height to be int_max, which overflows when converted to fixed. */ int dh = dev->height > max_int_in_fixed ? max_int_in_fixed : dev->height; diff --git a/base/gdevp14.c b/base/gdevp14.c index ecf7ff355..999e3fff0 100644 --- a/base/gdevp14.c +++ b/base/gdevp14.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -3799,6 +3799,7 @@ gs_pdf14_device_copy_params(gx_device *dev, const gx_device *target) COPY_PARAM(MaxPatternBitmap); COPY_PARAM(graphics_type_tag); COPY_PARAM(interpolate_control); + COPY_PARAM(non_strict_bounds); memcpy(&(dev->space_params), &(target->space_params), sizeof(gdev_space_params)); if (dev->icc_struct == NULL) { diff --git a/base/gxclist.c b/base/gxclist.c index 488875bad..a9abd56ff 100644 --- a/base/gxclist.c +++ b/base/gxclist.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -1390,6 +1390,7 @@ clist_make_accum_device(gs_memory_t *mem, gx_device *target, const char *dname, set_dev_proc(cwdev, set_graphics_type_tag, gx_forward_set_graphics_type_tag); cwdev->graphics_type_tag = target->graphics_type_tag; /* initialize to same as target */ cwdev->interpolate_control = target->interpolate_control; /* initialize to same as target */ + cwdev->non_strict_bounds = target->non_strict_bounds; /* initialize to same as target */ /* to be set by caller: cwdev->finalize = finalize; */ diff --git a/base/gxdevcli.h b/base/gxdevcli.h index 5c9831b93..ac1e731af 100644 --- a/base/gxdevcli.h +++ b/base/gxdevcli.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -780,6 +780,7 @@ typedef struct gdev_pagelist_s { gs_graphics_type_tag_t graphics_type_tag; /* e.g. vector, image or text */\ int interpolate_control; /* default 1 (use image /Interpolate value), 0 is NOINTERPOLATE. */\ /* > 1 limits interpolation, < 0 forces interpolation */\ + int non_strict_bounds; /* If set, callers cannot rely on clipping fills etc to declared device bounds. */\ gx_page_device_procs page_procs; /* must be last */\ /* end of std_device_body */\ gx_device_procs procs /* object procedures */ diff --git a/base/gxdevice.h b/base/gxdevice.h index 99dd610e9..1a8890c9a 100644 --- a/base/gxdevice.h +++ b/base/gxdevice.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -135,6 +135,7 @@ 0/*Profile Array*/,\ 0/* graphics_type_tag default GS_UNTOUCHED_TAG */,\ 1/* interpolate_control default 1, uses image /Interpolate flag, full device resolution */,\ + 0/*non_strict_bounds - default is to be strict*/,\ { ins, bp, ep } #define std_device_part3_()\ std_device_part3_sc(gx_default_install, gx_default_begin_page, gx_default_end_page) diff --git a/base/gxpcmap.c b/base/gxpcmap.c index d095af2df..e39e05d19 100644 --- a/base/gxpcmap.c +++ b/base/gxpcmap.c @@ -298,6 +298,7 @@ gx_pattern_accum_alloc(gs_memory_t * mem, gs_memory_t * storage_memory, fdev->is_planar = tdev->is_planar; fdev->graphics_type_tag = tdev->graphics_type_tag; fdev->interpolate_control = tdev->interpolate_control; + fdev->non_strict_bounds = tdev->non_strict_bounds; gx_device_forward_fill_in_procs(fdev); return fdev; } |