diff options
author | John Tytgat <joty@netsurf-browser.org> | 2008-07-30 19:17:27 +0000 |
---|---|---|
committer | John Tytgat <joty@netsurf-browser.org> | 2008-07-30 19:17:27 +0000 |
commit | 5685170036d59c6db307b014476146513713ad5f (patch) | |
tree | d7e2823da84212d070341cd74394d73bf3f43fae /riscos | |
parent | d43f5777e28b04cceef6389792a52e801f057059 (diff) | |
download | netsurf-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 'riscos')
-rw-r--r-- | riscos/plotters.c | 1 | ||||
-rw-r--r-- | riscos/print.c | 19 | ||||
-rw-r--r-- | riscos/save_draw.c | 1 | ||||
-rw-r--r-- | riscos/window.c | 22 |
4 files changed, 15 insertions, 28 deletions
diff --git a/riscos/plotters.c b/riscos/plotters.c index 18b53701a..bfba10c39 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -77,6 +77,7 @@ const struct plotter_table ro_plotters = { NULL, NULL, ro_plot_path, + true }; int ro_plot_origin_x = 0; diff --git a/riscos/print.c b/riscos/print.c index 10296ebf3..e1474aa96 100644 --- a/riscos/print.c +++ b/riscos/print.c @@ -119,8 +119,8 @@ static bool print_fonts_plot_bitmap(int x, int y, int width, int height, static bool print_fonts_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 print_fonts_plot_group_start(const char *name); -static bool print_fonts_plot_group_end(void); +static bool print_fonts_plot_path(float *p, unsigned int n, colour fill, float width, + colour c, float *transform); static void print_fonts_callback(void *context, const char *font_name, unsigned int font_size, const char *s8, unsigned short *s16, unsigned int n, @@ -141,10 +141,11 @@ static const struct plotter_table print_fonts_plotters = { print_fonts_plot_arc, print_fonts_plot_bitmap, print_fonts_plot_bitmap_tile, - print_fonts_plot_group_start, - print_fonts_plot_group_end, NULL, - NULL + NULL, + NULL, + print_fonts_plot_path, + false }; @@ -629,6 +630,7 @@ bool print_document(struct gui_window *g, const char *filename) } plot = ro_plotters; + plot.option_knockout = false; ro_plot_set_scale(print_scale); ro_gui_current_redraw_gui = g; current_redraw_browser = NULL; /* we don't want to print the @@ -863,11 +865,8 @@ bool print_fonts_plot_bitmap_tile(int x, int y, int width, int height, { return true; } -bool print_fonts_plot_group_start(const char *name) -{ - return true; -} -bool print_fonts_plot_group_end(void) +bool print_fonts_plot_path(float *p, unsigned int n, colour fill, float width, + colour c, float *transform) { return true; } diff --git a/riscos/save_draw.c b/riscos/save_draw.c index fd4208a52..dd9d32990 100644 --- a/riscos/save_draw.c +++ b/riscos/save_draw.c @@ -79,6 +79,7 @@ const struct plotter_table ro_save_draw_plotters = { ro_save_draw_group_end, NULL, ro_save_draw_path, + false }; static struct pencil_diagram *ro_save_draw_diagram; diff --git a/riscos/window.c b/riscos/window.c index 5da8662b6..571ed9af0 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -45,7 +45,6 @@ #include "css/css.h" #include "desktop/browser.h" #include "desktop/frames.h" -#include "desktop/knockout.h" #include "desktop/plotters.h" #include "desktop/textinput.h" #include "desktop/tree.h" @@ -1409,11 +1408,9 @@ void ro_gui_window_redraw_all(void) void ro_gui_window_redraw(wimp_draw *redraw) { osbool more; - bool knockout = true; struct gui_window *g = (struct gui_window *)ro_gui_wimp_event_get_user_data(redraw->w); float scale = g->bw->scale; struct content *c = g->bw->current_content; - int clip_x0, clip_y0, clip_x1, clip_y1, clear_x1, clear_y1; os_error *error; /* Handle no content quickly @@ -1435,15 +1432,6 @@ void ro_gui_window_redraw(wimp_draw *redraw) ro_gui_current_redraw_gui = g; current_redraw_browser = g->bw; - /* rendering textplain has no advantages using knockout rendering other - * than to slow things down. */ - if (c->type == CONTENT_TEXTPLAIN -#ifdef WITH_NS_SVG - || c->type == CONTENT_SVG -#endif - ) - knockout = false; - /* HTML rendering handles scale itself */ if (c->type == CONTENT_HTML) scale = 1; @@ -1456,6 +1444,8 @@ void ro_gui_window_redraw(wimp_draw *redraw) return; } while (more) { + int clip_x0, clip_y0, clip_x1, clip_y1, clear_x1, clear_y1; + ro_plot_origin_x = redraw->box.x0 - redraw->xscroll; ro_plot_origin_y = redraw->box.y1 - redraw->yscroll; clip_x0 = (redraw->clip.x0 - ro_plot_origin_x) / 2; @@ -1468,10 +1458,7 @@ void ro_gui_window_redraw(wimp_draw *redraw) if (ro_gui_current_redraw_gui->option.buffer_everything) ro_gui_buffer_open(redraw); - if (knockout) { - knockout_plot_start(&plot); - plot.clip(clip_x0, clip_y0, clip_x1, clip_y1); - } + plot.clip(clip_x0, clip_y0, clip_x1, clip_y1); if (c->type != CONTENT_HTML) plot.clg(0x00ffffff); @@ -1481,8 +1468,7 @@ void ro_gui_window_redraw(wimp_draw *redraw) clip_x0, clip_y0, clip_x1, clip_y1, g->bw->scale, 0xFFFFFF); - if (knockout) - knockout_plot_end(); + if (ro_gui_current_redraw_gui->option.buffer_everything) ro_gui_buffer_close(); |