diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-06-14 12:54:00 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-06-15 15:59:25 +0100 |
commit | b08ddcae269aa0804909fc80fc671519e7d8ff75 (patch) | |
tree | 4ec08c9dba51d2ef225e6a34fe2897c733db5331 /base/gdevflp.c | |
parent | 7e0bd07c6a9b7435a3fa89ea4fdd767b8836f0d6 (diff) | |
download | ghostpdl-b08ddcae269aa0804909fc80fc671519e7d8ff75.tar.gz |
Rejig text_begin dev_proc.
In this commit we remove several parameters to the text_begin
device procedure, because they are implied.
Firstly, we remove pdcolor, and just use the device color from
the current color in the graphics state (pgs->color[0]). This is
actually what the code did anyway (in that it was assumed that
pdcolor, if it was non-NULL was a pointer to this).
Similarly, we remove the path param, as (if used) this is always
the same as pgs->path.
Finally, we remove the memory param as this is (almost always)
the same as pgs->memory (and in cases where it isn't, tests indicate
that it could be).
This has knock on effects for the text enumerator structure.
Diffstat (limited to 'base/gdevflp.c')
-rw-r--r-- | base/gdevflp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/base/gdevflp.c b/base/gdevflp.c index 8abc168f4..c2e59f0c5 100644 --- a/base/gdevflp.c +++ b/base/gdevflp.c @@ -829,11 +829,12 @@ static const gs_text_enum_procs_t flp_text_procs = { * up to the device, in which case we simply pass on the 'begin' method to the device. */ int flp_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text, - gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, - gs_memory_t *memory, gs_text_enum_t **ppte) + gs_font *font, const gx_clip_path *pcpath, + gs_text_enum_t **ppte) { flp_text_enum_t *penum; int code; + gs_memory_t *memory = pgs->memory; /* We don't want to simply ignore stringwidth for 2 reasons; * firstly because following elelments may be positioned based on the value returned @@ -845,19 +846,19 @@ int flp_text_begin(gx_device *dev, gs_gstate *pgs, const gs_text_params_t *text, * stringwidth operation, or they won;t be able to cache the glyphs properly. * So always pass stringwidth operations to the child. */ - return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte); + return default_subclass_text_begin(dev, pgs, text, font, pcpath, ppte); code = SkipPage(dev); if (code < 0) return code; if (!code) - return default_subclass_text_begin(dev, pgs, text, font, path, pdcolor, pcpath, memory, ppte); + return default_subclass_text_begin(dev, pgs, text, font, pcpath, ppte); rc_alloc_struct_1(penum, flp_text_enum_t, &st_flp_text_enum, memory, return_error(gs_error_VMerror), "gdev_flp_text_begin"); penum->rc.free = rc_free_text_enum; code = gs_text_enum_init((gs_text_enum_t *)penum, &flp_text_procs, - dev, pgs, text, font, path, pdcolor, pcpath, memory); + dev, pgs, text, font, pcpath, memory); if (code < 0) { gs_free_object(memory, penum, "gdev_flp_text_begin"); return code; |