From a47f148f2d9a7f06c7dddaf55d7e89c6e04349ef Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Mon, 10 Jul 2006 09:52:31 +0000 Subject: Optimise out redundant group_start and group_end calls (speed up rendering.) svn path=/trunk/netsurf/; revision=2725 --- desktop/knockout.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'desktop/knockout.c') diff --git a/desktop/knockout.c b/desktop/knockout.c index 16029c3d7..eeab21c11 100644 --- a/desktop/knockout.c +++ b/desktop/knockout.c @@ -27,6 +27,7 @@ struct knockout_box; 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); @@ -235,7 +236,7 @@ bool knockout_plot_start(struct plotter_table *plotter) /* take over the plotter */ real_plot = *plotter; - plot = knockout_plotters; + knockout_set_plotters(); return true; } @@ -408,11 +409,24 @@ bool knockout_plot_flush(void) /* re-instate knockout plotters if we are still active */ if (nested_depth > 0) - plot = knockout_plotters; + knockout_set_plotters(); return success; } +/** + * Override the current plotters with the knockout plotters + */ +void knockout_set_plotters(void) +{ + plot = knockout_plotters; + if (!real_plot.group_start) + plot.group_start = NULL; + if (!real_plot.group_end) + plot.group_end = NULL; +} + + /** * Knockout a section of previous rendering * @@ -704,7 +718,7 @@ bool knockout_plot_clip(int clip_x0, int clip_y0, clip_x0, clip_y0, clip_x1, clip_y1)); return false; } - + /* memorise clip for bitmap tiling */ clip_x0_cur = clip_x0; clip_y0_cur = clip_y0; -- cgit v1.2.3