diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2016-02-24 12:50:47 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2016-06-06 15:25:53 +0100 |
commit | 45dcf097558e880a76f569dd8d6c678f6ed186ce (patch) | |
tree | a6053769310375ff63efd5e493e8562d410e0112 /base/gximag3x.c | |
parent | 41d8d83a77ee6ea12109dde7b72dedc61cca01a3 (diff) | |
download | ghostpdl-45dcf097558e880a76f569dd8d6c678f6ed186ce.tar.gz |
Make gs_imager_state == gs_state.
Change how gstate initialisation is done:
Previously we relied on the imager state being a subset of the gstate (thus
assigning an imager state to a graphics state over wrote to the entries
common to both, and didn't overwrite any already set graphics state specific
entries).
Making the imager and graphics states the same means that approach doesn't work,
so this changes it to initialise the entries individually.
Renames gsistate.c->gsgstate.c and gxistate.h->gxgstate.h
Cleanup and fix the gs_state gc stuff.
Uses different check for pre/post clist pdf14 device
Previously, the code used "is_gstate" in the imager/graphics state object
to determine if the code was being called pre or post clist (post clist would
only ever have had an imager_state so is_gstate = false).
With no imager state any more, that test would no longer work (and I am dubious
about whether it was really safe, anyway). Other places check for the presence
of a clist reader device in the pdf14 device structure - so use that here
too.
Adds initial (NULL) value for show_gstate pointer in gs_state.
Removes the now pointless macro for the contents of the graphics state
Changes function names that had "imager" to use "gstate"
Removes the redundant 'is_state' flag
Cleans up gs_(g)state_putdeviceparams():
Previously we had to similar routines: one took a graphics state, and used the
device from the graphics state, the other took an imager state and the device
as an explicit parameter.
With the removal of the imager state, "merge" those two functions
Replaces gs_state with gs_gstate
It makes for less confusion as it really is a g(raphics)state
Diffstat (limited to 'base/gximag3x.c')
-rw-r--r-- | base/gximag3x.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/base/gximag3x.c b/base/gximag3x.c index 3cd8e5ec4..2e6adc2a4 100644 --- a/base/gximag3x.c +++ b/base/gximag3x.c @@ -27,7 +27,7 @@ #include "gxdevice.h" #include "gxdevmem.h" #include "gximag3x.h" -#include "gxistate.h" +#include "gxgstate.h" #include "gdevbbox.h" extern_st(st_color_space); @@ -125,7 +125,7 @@ static int check_image3x_mask(const gs_image3x_t *pim, gs_memory_t *mem); int gx_begin_image3x_generic(gx_device * dev, - const gs_imager_state *pis, const gs_matrix *pmat, + const gs_gstate *pgs, const gs_matrix *pmat, const gs_image_common_t *pic, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *mem, @@ -198,7 +198,7 @@ gx_begin_image3x_generic(gx_device * dev, penum->bpc = pim->BitsPerComponent; penum->memory = mem; if (pmat == 0) - pmat = &ctm_only(pis); + pmat = &ctm_only(pgs); for (i = 0; i < NUM_MASKS; ++i) { gs_rect mrect; gx_device *mdev; @@ -263,15 +263,15 @@ gx_begin_image3x_generic(gx_device * dev, m_mat.tx -= origin[i].x; m_mat.ty -= origin[i].y; /* - * Peter put in a comment that said " Note that pis = NULL here, - * since we don't want to have to create another imager state with - * default log_op, etc." and passed NULL instead of pis to this - * routine. However Image type 1 need the imager state (see + * Peter put in a comment that said " Note that pgs = NULL here, + * since we don't want to have to create another gs_gstate with + * default log_op, etc." and passed NULL instead of pgs to this + * routine. However Image type 1 need the gs_gstate (see * bug 688348) thus his optimization was removed. * dcolor = NULL is OK because this is an opaque image with * CombineWithColor = false. */ - code = gx_device_begin_typed_image(mdev, pis, &m_mat, + code = gx_device_begin_typed_image(mdev, pgs, &m_mat, (const gs_image_common_t *)&mask[i].image, &mask[i].rect, NULL, NULL, mem, &penum->mask[i].info); @@ -289,7 +289,7 @@ gx_begin_image3x_generic(gx_device * dev, pixel.image.type = type1; pixel.image.image_parent_type = gs_image_type3x; } - code = make_mcde(dev, pis, pmat, (const gs_image_common_t *)&pixel.image, + code = make_mcde(dev, pgs, pmat, (const gs_image_common_t *)&pixel.image, prect, pdcolor, pcpath, mem, &penum->pixel.info, &pcdev, midev, minfo, origin, pim); if (code < 0) @@ -526,7 +526,7 @@ make_midx_default(gx_device **pmidev, gx_device *dev, int width, int height, } static IMAGE3X_MAKE_MCDE_PROC(make_mcdex_default); /* check prototype */ static int -make_mcdex_default(gx_device *dev, const gs_imager_state *pis, +make_mcdex_default(gx_device *dev, const gs_gstate *pgs, const gs_matrix *pmat, const gs_image_common_t *pic, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *mem, @@ -567,7 +567,7 @@ make_mcdex_default(gx_device *dev, const gs_imager_state *pis, gx_device_bbox_fwd_open_close(bbdev, false); code = dev_proc(bbdev, begin_typed_image) - ((gx_device *)bbdev, pis, pmat, pic, prect, pdcolor, pcpath, mem, + ((gx_device *)bbdev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, pinfo); if (code < 0) { gs_free_object(mem, bbdev, "make_mcdex_default"); @@ -578,12 +578,12 @@ make_mcdex_default(gx_device *dev, const gs_imager_state *pis, } static int gx_begin_image3x(gx_device * dev, - const gs_imager_state * pis, const gs_matrix * pmat, + const gs_gstate * pgs, const gs_matrix * pmat, const gs_image_common_t * pic, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * mem, gx_image_enum_common_t ** pinfo) { - return gx_begin_image3x_generic(dev, pis, pmat, pic, prect, pdcolor, + return gx_begin_image3x_generic(dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem, make_midx_default, make_mcdex_default, pinfo); } |