diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-01 18:16:05 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-07-01 18:16:05 +0000 |
commit | cf4294d3a85518a6502ce63a58c0b05d5baab949 (patch) | |
tree | 86af17af135871cee20434cad3fbfecca9a7f310 /render/html_redraw.c | |
parent | f22838ab626bed6948b18bd6eeb28c8bdf210057 (diff) | |
download | netsurf-cf4294d3a85518a6502ce63a58c0b05d5baab949.tar.gz netsurf-cf4294d3a85518a6502ce63a58c0b05d5baab949.tar.bz2 |
Implement knockout rendering (controlled by 'knockout_rendering' option or Ctrl+F11, default is off). This attempts to minimise the amount of overlapping redraw performed, and thus can drasticly reduce the rendering time of many pages.
svn path=/trunk/netsurf/; revision=2682
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r-- | render/html_redraw.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index aeac805ab..3e70168c0 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -17,8 +17,10 @@ #include "netsurf/css/css.h" #include "netsurf/desktop/gui.h" #include "netsurf/desktop/plotters.h" +#include "netsurf/desktop/knockout.h" #include "netsurf/desktop/selection.h" #include "netsurf/desktop/textinput.h" +#include "netsurf/desktop/options.h" #include "netsurf/render/box.h" #include "netsurf/render/font.h" #include "netsurf/render/form.h" @@ -70,7 +72,6 @@ static bool html_redraw_scrollbars(struct box *box, float scale, bool html_redraw_debug = false; - /** * Draw a CONTENT_HTML using the current set of plotters (plot). * @@ -96,18 +97,29 @@ bool html_redraw(struct content *c, int x, int y, float scale, unsigned long background_colour) { struct box *box; + bool result; box = c->data.html.layout; assert(box); + if (option_knockout_rendering) + knockout_plot_start(&plot); + /* clear to background colour */ + 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); - return html_redraw_box(box, x, y, + result = html_redraw_box(box, x, y, clip_x0, clip_y0, clip_x1, clip_y1, scale, background_colour); + + if (option_knockout_rendering) + knockout_plot_end(); + + return result; + } |