summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJohn Tytgat <joty@netsurf-browser.org>2008-07-30 19:17:27 +0000
committerJohn Tytgat <joty@netsurf-browser.org>2008-07-30 19:17:27 +0000
commit5685170036d59c6db307b014476146513713ad5f (patch)
treed7e2823da84212d070341cd74394d73bf3f43fae /desktop
parentd43f5777e28b04cceef6389792a52e801f057059 (diff)
downloadnetsurf-5685170036d59c6db307b014476146513713ad5f.tar.gz
netsurf-5685170036d59c6db307b014476146513713ad5f.tar.bz2
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 'desktop')
-rw-r--r--desktop/knockout.c7
-rw-r--r--desktop/plotters.h7
2 files changed, 8 insertions, 6 deletions
diff --git a/desktop/knockout.c b/desktop/knockout.c
index 4a82dc47f..658503313 100644
--- a/desktop/knockout.c
+++ b/desktop/knockout.c
@@ -38,7 +38,6 @@ struct knockout_entry;
static void knockout_set_plotters(void);
-static bool knockout_plot_flush(void);
static void knockout_calculate(int x0, int y0, int x1, int y1, struct knockout_box *box);
static bool knockout_plot_fill_recursive(struct knockout_box *box, colour c);
static bool knockout_plot_bitmap_tile_recursive(struct knockout_box *box,
@@ -50,8 +49,6 @@ static bool knockout_plot_rectangle(int x0, int y0, int width, int height,
static bool knockout_plot_line(int x0, int y0, int x1, int y1, int width,
colour c, bool dotted, bool dashed);
static bool knockout_plot_polygon(int *p, unsigned int n, colour fill);
-static bool knockout_plot_path(float *p, unsigned int n, colour fill,
- float width, colour c, float *transform);
static bool knockout_plot_fill(int x0, int y0, int x1, int y1, colour c);
static bool knockout_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
@@ -65,8 +62,11 @@ static bool knockout_plot_bitmap(int x, int y, int width, int height,
static bool knockout_plot_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bool repeat_x, bool repeat_y, struct content *content);
+static bool knockout_plot_flush(void);
static bool knockout_plot_group_start(const char *name);
static bool knockout_plot_group_end(void);
+static bool knockout_plot_path(float *p, unsigned int n, colour fill,
+ float width, colour c, float *transform);
const struct plotter_table knockout_plotters = {
@@ -85,6 +85,7 @@ const struct plotter_table knockout_plotters = {
knockout_plot_group_end,
knockout_plot_flush,
knockout_plot_path,
+ true
};
diff --git a/desktop/plotters.h b/desktop/plotters.h
index 16e0d47e6..2e7502c37 100644
--- a/desktop/plotters.h
+++ b/desktop/plotters.h
@@ -52,11 +52,12 @@ struct plotter_table {
bool (*bitmap_tile)(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bool repeat_x, bool repeat_y, struct content *content);
- bool (*group_start)(const char *name); /** optional */
- bool (*group_end)(void); /** optional */
- bool (*flush)(void);
+ bool (*group_start)(const char *name); /**< optional, may be NULL */
+ bool (*group_end)(void); /**< optional, may be NULL */
+ bool (*flush)(void); /**< optional, may be NULL */
bool (*path)(float *p, unsigned int n, colour fill, float width,
colour c, float *transform);
+ bool option_knockout; /**< when set, avoid areas are replotted more than once. */
};
/** Current plotters, must be assigned before use. */