diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-10 09:52:31 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-10 09:52:31 +0000 |
commit | a47f148f2d9a7f06c7dddaf55d7e89c6e04349ef (patch) | |
tree | 1d0db22a55693f79ce5a4f267ebfde00c682d176 /desktop/knockout.c | |
parent | 0fe0a709ceeae77cc5d91aab318aec27320e09af (diff) | |
download | netsurf-a47f148f2d9a7f06c7dddaf55d7e89c6e04349ef.tar.gz netsurf-a47f148f2d9a7f06c7dddaf55d7e89c6e04349ef.tar.bz2 |
Optimise out redundant group_start and group_end calls (speed up rendering.)
svn path=/trunk/netsurf/; revision=2725
Diffstat (limited to 'desktop/knockout.c')
-rw-r--r-- | desktop/knockout.c | 20 |
1 files changed, 17 insertions, 3 deletions
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,12 +409,25 @@ 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 * * \param x0 the left edge of the removal box @@ -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; |