summaryrefslogtreecommitdiff
path: root/devices/gdevtrac.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-06-14 12:54:00 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-06-15 15:59:25 +0100
commitb08ddcae269aa0804909fc80fc671519e7d8ff75 (patch)
tree4ec08c9dba51d2ef225e6a34fe2897c733db5331 /devices/gdevtrac.c
parent7e0bd07c6a9b7435a3fa89ea4fdd767b8836f0d6 (diff)
downloadghostpdl-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 'devices/gdevtrac.c')
-rw-r--r--devices/gdevtrac.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/devices/gdevtrac.c b/devices/gdevtrac.c
index d5ff53a2b..b85760c2a 100644
--- a/devices/gdevtrac.c
+++ b/devices/gdevtrac.c
@@ -420,8 +420,7 @@ static const gs_text_enum_procs_t trace_text_procs = {
static int
trace_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,
+ const gx_clip_path * pcpath,
gs_text_enum_t ** ppenum)
{
static const char *const tags[sizeof(text->operation) * 8] = {
@@ -436,6 +435,8 @@ trace_text_begin(gx_device * dev, gs_gstate * pgs,
int i;
gs_text_enum_t *pte;
int code;
+ const gx_device_color * pdcolor = gs_currentdevicecolor_inline(pgs);
+ gx_path * path = pgs->path;
dmputs(dev->memory,"text_begin(");
for (i = 0; i < countof(tags); ++i)
@@ -499,7 +500,7 @@ trace_text_begin(gx_device * dev, gs_gstate * pgs,
rc_alloc_struct_1(pte, gs_text_enum_t, &st_gs_text_enum, memory,
goto dflt, "trace_text_begin");
code = gs_text_enum_init(pte, &trace_text_procs, dev, pgs, text, font,
- path, pdcolor, pcpath, memory);
+ path, pcpath, memory);
if (code < 0)
goto dfree;
if ((text->operation & (TEXT_DO_CHARWIDTH | TEXT_RETURN_WIDTH)) &&
@@ -569,8 +570,8 @@ trace_text_begin(gx_device * dev, gs_gstate * pgs,
gs_free_object(memory, pte, "trace_text_begin");
dflt:
dmputs(dev->memory,") DEFAULTED\n");
- return gx_default_text_begin(dev, pgs, text, font, path, pdcolor,
- pcpath, memory, ppenum);
+ return gx_default_text_begin(dev, pgs, text, font,
+ pcpath, ppenum);
}
/* ---------------- The device definition ---------------- */