On Wed, 30 Jul 2008, John Tytgat wrote:

I'm seeking feedback on my changes to make the knockout plotting optional
based on the plotter backend (patch attached).  I've added a new entry
'option_knockout' to 'struct plotter_table' which basically is a request
from that plotter backend for the content redraw routine to get called in
such a way that overlapping render areas are avoided as much as possible
(that's what I'm assuming the knockout.c code is doing).

This looks fine to me.

However, it is up to the content redraw code to actually implement this
option if it is reasonably profitable.  This was and is currently done
explicitly by the html content redraw code.  On top of that the riscos
plotter code was installing the knockout plotter itself for all content
types except plaintext and SVG and this is no longer being done in this
patch.

This seems cleaner, yes. I have a suspicion that the RO code manipulating the knockout plotter is legacy that can be removed. Certainly, the content-specific redraw routines are far more likely to know whether knockout's required.

In patch more detail:

- desktop/plotters.h: added struct plotter_table::option_knockout
- render/html_redraw.c(html_redraw): if the plotter backend wants the
knockout calling behaviour, install the knockout plotter which will then
call the real backend.  Also check on the return values of clg and clip
plotter calls.
- Plotter backend changes:
 -> no longer plotting in knockout mode:
    - gtk/gtk_print.c: BTW, also removed what I think is a 2nd instance
      of "struct plotter_table plot" (the first one is in
      gtk/gtk_plotters.c), right ?

It looks that way, yes.

- riscos/window.c: I'm a bit confused why there were tests on the
 content type which determine to additionally install the
 knockout plotter in front of the real plotter code as as far as
 I believe that only HTML content is profitable to be plotted
 in knockout mode, no ?

Yeah. Everything else is basically flat objects, so wouldn't benefit from knockout.


J.

Reply via email to