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/gxcpath.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/gxcpath.c')
-rw-r--r-- | base/gxcpath.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/base/gxcpath.c b/base/gxcpath.c index 99ae23431..0520d7fc5 100644 --- a/base/gxcpath.c +++ b/base/gxcpath.c @@ -24,7 +24,7 @@ #include "gxfixed.h" #include "gxpaint.h" #include "gscoord.h" /* needs gsmatrix.h */ -#include "gxistate.h" +#include "gxgstate.h" #include "gzpath.h" #include "gzcpath.h" #include "gzacpath.h" @@ -586,16 +586,15 @@ gx_path_rectangular_type cpath_is_rectangle(const gx_clip_path * pcpath, gs_fixe /* Intersect a new clipping path with an old one. */ /* Flatten the new path first (in a copy) if necessary. */ int -gx_cpath_clip(gs_state *pgs, gx_clip_path *pcpath, +gx_cpath_clip(gs_gstate *pgs, gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig, int rule) { - return gx_cpath_intersect(pcpath, ppath_orig, rule, - (gs_imager_state *)pgs); + return gx_cpath_intersect(pcpath, ppath_orig, rule, pgs); } int gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig, - int rule, gs_imager_state *pis, const gx_fill_params * params) + int rule, gs_gstate *pgs, const gx_fill_params * params) { gx_path fpath; /*const*/ gx_path *ppath = ppath_orig; @@ -604,10 +603,10 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or /* Flatten the path if necessary. */ if (gx_path_has_curves_inline(ppath)) { - gx_path_init_local(&fpath, pis->memory); + gx_path_init_local(&fpath, pgs->memory); code = gx_path_add_flattened_accurate(ppath, &fpath, - gs_currentflat_inline(pis), - pis->accurate_curves); + gs_currentflat_inline(pgs), + pgs->accurate_curves); if (code < 0) return code; ppath = &fpath; @@ -623,14 +622,14 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or /* The new path is void. */ if (gx_path_current_point(ppath, &new_box.p) < 0) { /* Use the user space origin (arbitrarily). */ - new_box.p.x = float2fixed(pis->ctm.tx); - new_box.p.y = float2fixed(pis->ctm.ty); + new_box.p.x = float2fixed(pgs->ctm.tx); + new_box.p.y = float2fixed(pgs->ctm.ty); } new_box.q = new_box.p; changed = 1; } else { { /* Apply same adjustment as for filling the path. */ - gs_fixed_point adjust = params != NULL ? params->adjust : pis->fill_adjust; + gs_fixed_point adjust = params != NULL ? params->adjust : pgs->fill_adjust; fixed adjust_xl, adjust_xu, adjust_yl, adjust_yu; if (adjust.x == -1) @@ -691,7 +690,7 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or goto ex; } code = gx_cpath_intersect_path_slow(pcpath, (params != NULL ? ppath_orig : ppath), - rule, pis, params); + rule, pgs, params); if (code < 0) goto ex; if (path_valid) { @@ -710,10 +709,10 @@ ex: } int gx_cpath_intersect(gx_clip_path *pcpath, /*const*/ gx_path *ppath_orig, - int rule, gs_imager_state *pis) + int rule, gs_gstate *pgs) { return gx_cpath_intersect_with_params(pcpath, ppath_orig, - rule, pis, NULL); + rule, pgs, NULL); } /* Scale a clipping path by a power of 2. */ |