path: root/render
diff options
authorJohn Tytgat <>2008-07-30 19:17:27 +0000
committerJohn Tytgat <>2008-07-30 19:17:27 +0000
commit5685170036d59c6db307b014476146513713ad5f (patch)
treed7e2823da84212d070341cd74394d73bf3f43fae /render
parentd43f5777e28b04cceef6389792a52e801f057059 (diff)
Make the knockout plotter calling behaviour optional by 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. 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. In 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: Also removed a 2nd instance of "struct plotter_table plot". - riscos/save_draw.c - riscos/print.c: Also the path plotter function pointer wasn't filled in and this is now fixed. - pdf/pdf_plotters.c: Removed the flush function as this is optional and we only had a dummy implementation there. -> remaining to request knockout mode if it makes sense based on the content type: - gtk/gtk_plotters.c - riscos/plotters.c - desktop/knockout.c - riscos/window.c: Removed what's believed an obsolete test on the content type which determined to additionally install the knockout plotter in front of the real plotter code. svn path=/trunk/netsurf/; revision=4823
Diffstat (limited to 'render')
1 files changed, 9 insertions, 6 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 6a6a0d170..16eb47dd3 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -115,24 +115,27 @@ bool html_redraw(struct content *c, int x, int y,
float scale, unsigned long background_colour)
struct box *box;
- bool result;
+ bool result, want_knockout;
box = c->data.html.layout;
- knockout_plot_start(&plot);
+ want_knockout = plot.option_knockout;
+ if (want_knockout)
+ knockout_plot_start(&plot);
/* clear to background colour */
- plot.clip(clip_x0, clip_y0, clip_x1, clip_y1);
+ result = plot.clip(clip_x0, clip_y0, clip_x1, clip_y1);
if (c->data.html.background_colour != TRANSPARENT)
background_colour = c->data.html.background_colour;
- plot.clg(background_colour);
+ result &= plot.clg(background_colour);
- result = html_redraw_box(box, x, y,
+ result &= html_redraw_box(box, x, y,
clip_x0, clip_y0, clip_x1, clip_y1,
scale, background_colour, 0);
- knockout_plot_end();
+ if (want_knockout)
+ knockout_plot_end();
return result;