| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The erasepage optimisation device uses the fill_rectangle method from
the terminating device to do operations like actually erase the page.
It turns out the display device (on Linux at least) doesn't actually
implement this method (it may do so with a gtk+ build), leaving it at
NULL, and causing a seg fault if we try to use it.
Guard that here to prevent a crash.
|
|
|
|
|
| |
Introduce new lock_pattern device proc and clist implementation.
Call that for fill_stroke operations.
|
|
|
|
|
|
|
|
|
|
| |
In tweaking the epo device, I'd messed up the forwarding of the
'composite' device call. The default subclass handling has some
complex handling to cope with correctly ordering the devices. By
simply forwarding the call on, I was missing this out.
Fix this by calling the default subclass procedure to do the
forwarding.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several commits ago, I modified the Nup device so that whenever
PageUsesTransparency was specified, we forced it to be true.
This avoided PDF pages flushing the nest as we flip/flop between
pages with and without transparency.
Unfortunately, with parameters that were themselves 'collections'
(like arrays), this would both leak a bit and corrupt them due
to not copying them properly. Here we steal a bit of code from
gsparamx.c to properly recursively copy such things, and hack it
set PageUsesTransparency as part of the copy process.
We also extend that to ensure that it is ALWAYS set (whether it
is specified or not), to ensure that going from (say) a PS job
to a PDF one does not cause the nest to be unnecessarily flushed.
Also, because of the way params report errors, we need to copy
the reported errors back from the copied param list to the original
one. This requires extensions to the param list handling functions.
Because put_params is not always called between the Nup device
being instantiated and the first page started, we need to call
put_params ourselves. To do that write our own install procedure
and get gdevkrnlsclass.c to call that rather than doing the
subclass itself.
Also, incorporate a SEGV fix from Ray.
The devn_put_params can close the device, but if the device is a
child of the Nup device, the Nup device won't have a chance to flush
the nest.
Also, just in case, when we switch a printer device from clist mode
(as we do when we tear down a device), clear the 'pmemdev->base' that
is assumed to be NULL or valid in non-clist mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you have a device chain A -> epo -> C, then when epo unsubclasses
itself, this moves device C into the memory previously occupied by
epo.
If this happens at 'unexpected' times, callers can be left holding a
pointer to C that is now stale.
The particular instance is running with the Nup device to psdcmyk.
The device chain is therefore Nup -> epo -> psd. We get a put_params
to change the device n parameters (the number of spots). This call
filters down through Nup, epo, and reaches psd. That calls the devn
prn code that spots this change, and closes the device.
The close device jumps up the device chain to close Nup. This decides
to flush the nest of pages rendered so far, so calls the epo device.
This decides to unsubclass itself. This moves psd into the memory
that epo used to occupy, frees the 'psd' pointer, and closes the psd
device.
This exits, returning back up the chain to where the devn prn code
has just called gs_closedevice. That code is holding a dev pointer
pointed to where psd used to be. As soon as it tries to access it
it dies.
In general, it's much less painful for the epo device to avoid
'unpredicated' unsubclassings, so we change it to stay linked in and
just 'disable' itself.
|
|
|
|
|
|
| |
Specifically, we want epo to be under Nup, but in general the
purpose of epo is to avoid needless redrawing, which means
we only need to wrap the actual rendering device.
|
|
|
|
|
|
|
|
|
|
| |
The N-up device has the effect of supressing all but the first
fillpage for a nest. If the epo-device is spawned under an N-up
device, this means it ends up clearing the complete page with
color 0 (the value to which last_color is initialised).
Here we tweak the device so that it only sends a fillpage if one
has been swallowed.
|
|
|
|
|
|
|
| |
Currently, all subclassing devices redirect the page_procs to
the defaults rather than passing them on to the devices.
Fix that here.
|
|
|
|
| |
No one sets it. No one reads it. It's pointless, so excise it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The device initialize function currently performs 2 jobs. Firstly,
it fills out the device_procs. Secondly, it performs any minimal
initialization required by the device (typically none).
At various points in the code we want to be able to copy procs
from one 'prototype' device to another, so we call initialize
for that. This populates the device procs, but does other work
that typically requires a 'derived device' structure rather
than a vanilla gx_device to work in.
Accordingly, we split the job into two; initialize_device_procs
(the first part) and initialize_device (the second part). The
initialize_device_procs function will set up the initialize_device
function pointer along with the rest if required.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Move the initialize procedure out of the device procs table,
and into a bare function pointer at the start of the device proc.
Devices just initialise this, and the rest should fall into place.
This means changes to the device instantion macros (and all the uses
thereof), but makes the code nicer overall. In particular, this
removes the vestigial 'static_procs' structure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
It used to be that finish_copydevice(dev, const old_dev) would be
used to copy stuff from a prototype to a new instance of a device.
Now, no copying is ever done.
Also, it's a confusing name. Rename it to be 'initialize', which
is clearer. Also, it should become even more appropriate in
future, if we have this function be the one that is responsible
for filling out the procs.
|
|
|
|
|
|
|
|
|
|
|
| |
The erasepage optimisation device, when checking to see whether the
underlying device permitted optimisaton, was assuming that its own child
would always be the 'final' device. If we have a chain of subclass
devices this might not be true.
Run down the chain to the fist non-subclass device and check that
instead. In future this should be replaced by a spec_op or something
but this resolves the problem for now.
|
| |
|
|
|
|
|
|
|
|
|
| |
The epo device assumed that it was the current device, then checked the child
of that device to decide if it could optimize. If another subclass device was
the current device the decision could be invalid.
Note that the comparison of the child's fillpage proc is not ideal, but the
change to that is more involved and risky, and left for a subsequent change.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This branch had several contributors including Robin Watts,
Ken Sharp and Ray Johnston.
The intent was to add a "fill and stroke" path device method
to ensure we get proper rendering when doing fill/stroke
methods with overprint and transparency. In addition,
adding the method made it possible for pdfwrite to match
the original pdf source file if it also had fill/stroke methods.
The interaction with overprint and transparency led to significant
changes in parts of the code related to those sections. In particular,
overprint was reworked to ensure that the overprint compositor and
the transparency compositor were aware if it was to be using
the overprint drawn_comps for stroke or for fill. The code was
rewritten so that the overprint compositor actions only occurred when
an actual operation occurred (e.g. fill, stroke, image, text) as opposed
to every time that the overprint graphic state values changed.
When there is a fill-stroke operation with transparency, depending upon the
graphic state values, a non-isolated knockout group may be pushed. From this,
an issue with knockout groups within knockout groups was revealed, which was
related to the backdrop selection. The backdrop selection code was simplified.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use this for handling image type 4 rendering.
The default version of this goes to rectangles. It also knows how to
send portrait images of 8bps to copy_color.
Next step is to write versions of this for the memory mapped devices
to know how to go direct.
Essentially we are copying the guts of the
image_render_color_icc_{portrait,landscape,skew} into a default
device method, and making the code that called those functions
call the device method instead.
|
|
|
|
| |
There are no bad effects from this, just pointless.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The put_image device method was unique in that the device parameter
passed to the method was not a pointer to a device structure of the
device implementing the method, but was a pointer to a device
structure describing a memory device.
This allowed the memory device to use code from the underlying device,
which knows how its page buffer is laid out, but data from the memory
device which rendered the composited transparent operations.
However, this doesn't work at all if we have a chain of devices because
the device method which we pull from the device at the head of the
chain, is not the method used to actually rendeer to the page buffer
of the terminating deevice in the chain.
This commit alters the prorotype to take two device pointers, one for
the 'terget' device, and one for the memory device which executed the
put_image. This allows the final device in the chain to use its own
code to format the buffer pointers from the memory device, while
allowing intermediate devices to simply pass on the call.
Note that previously a few places checked the put_image method against
gx_default_put_image (before the device API rationalisation this was a
check against NULL) and only called put_image if it was not the default.
Now that we have a default implementation (which returns an error), and
knowing that the existing device methods return an error if they do not
implment some aspect of the memory layout, we can avoid the test
altogether; simply call the put_image, the code is already prepared
to deal with an error return whether that be because the device does not
implement the method or becuase the device cannot cope with some aspect
of the layout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The erasepage optimisation (epo) subclass device shouldn't be allowed to be
copied because the subclass private data, child and parent pointers end up
being shared between the original device and the copy.
Add an epo_finish_copydevice which NULLs the three offending pointers, and
then communicates to the caller that copying is not allowed.
This also exposed a separate issue with the stype for subclasses devices.
Devices are, I think, unique in having two stype objects associated with them:
the usual one in the memory manager header, and the other stored in the device
structere directly. In order for the stype to be correct, we have to use the
stype for the incoming device, with the ssize of the original device (ssize
should reflect the size of the memory allocation). We correctly did so with the
stype in the device structure, but then used the prototype device's stype to
patch the memory manager stype - meaning the ssize potentially no longer
matched the allocated memory. This caused problems in the garbager where there
is an implicit assumption that the size of a single object clump (c_alone == 1)
is also the size (+ memory manager overheads) of the single object it contains.
The solution is to use the same stype instance to patch the memory manager
data as we do in the device structure (with the correct ssize).
|
| |
|
|
|
|
|
|
|
| |
I am using 3 flags -- epo-details, epo-install-only, epo-disable.
Can also call "epo_disable(1)" during a gdb session to turn on/off
during the session.
|
|
This optimization only works for devices that have a fillpage
implementation that is "gx_default_fillpage". For other devices the
subclass device will not be installed. If the device transitions to
clist (or any other non-gx_default_fillpage device), we will stop
doing the optimization.
The optimization basically swallows(defers) all fillpages, remembering
the color (which is probably always white, but it will work with any
"pure" color). Then when the first actual marking operation happens,
we do a fill_rectangle operation with the remembered color.
|