From 3128ecf2a5c94102e0e1659f947a345d36750afe Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 28 Jun 2011 20:17:39 +0000 Subject: Unify content_redraw params in content_redraw_data struct. Core and RISC OS content handlers updated. svn path=/trunk/netsurf/; revision=12529 --- desktop/browser.c | 15 +++++++++++++-- desktop/print.c | 18 +++++++++++++----- desktop/thumbnail.c | 15 +++++++++++++-- desktop/tree.c | 17 ++++++++++++++--- 4 files changed, 53 insertions(+), 12 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 95fff4d8b..fdd021369 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -100,6 +100,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y, int height = 0; bool plot_ok = true; content_type content_type; + struct content_redraw_data data; if (bw == NULL) { LOG(("NULL browser window")); @@ -131,10 +132,20 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y, plot_ok &= plot.rectangle(clip->x0, clip->y0, clip->x1, clip->y1, plot_style_fill_white); } + + /* Set up content redraw data */ + data.x = x; + data.y = y; + data.width = width; + data.height = height; + + data.background_colour = 0xFFFFFF; + data.scale = bw->scale; + data.repeat_x = false; + data.repeat_y = false; /* Render the content */ - plot_ok &= content_redraw(bw->current_content, x, y, width, height, - clip, bw->scale, 0xFFFFFF, false, false); + plot_ok &= content_redraw(bw->current_content, &data, clip); if (bw->browser_window_type != BROWSER_WINDOW_IFRAME && plot.option_knockout) diff --git a/desktop/print.c b/desktop/print.c index 42dd0a77a..373c338fa 100644 --- a/desktop/print.c +++ b/desktop/print.c @@ -122,6 +122,7 @@ bool print_draw_next_page(const struct printer *printer, struct print_settings *settings) { struct rect clip; + struct content_redraw_data data; plot = *(printer->plotter); html_redraw_printing_top_cropped = INT_MAX; @@ -130,14 +131,21 @@ bool print_draw_next_page(const struct printer *printer, clip.y0 = 0; clip.x1 = page_content_width * settings->scale; clip.y1 = page_content_height * settings->scale; - + + data.x = 0; + data.y = -done_height; + data.width = 0; + data.height = 0; + data.background_colour = 0xFFFFFF; + data.scale = settings->scale; + data.repeat_x = false; + data.repeat_y = false; + html_redraw_printing = true; html_redraw_printing_border = clip.y1; - + printer->print_next_page(); - if (!content_redraw(printed_content, 0, -done_height, - 0, 0, - &clip, settings->scale, 0xffffff, false, false)) + if (!content_redraw(printed_content, &data, &clip)) return false; done_height += page_content_height - diff --git a/desktop/thumbnail.c b/desktop/thumbnail.c index bf1db7ca1..6f5fd0318 100644 --- a/desktop/thumbnail.c +++ b/desktop/thumbnail.c @@ -60,6 +60,7 @@ bool thumbnail_redraw(struct hlcache_handle *content, int width, int height) { struct rect clip; + struct content_redraw_data data; float scale; bool plot_ok = true; @@ -86,9 +87,19 @@ bool thumbnail_redraw(struct hlcache_handle *content, /* Find the scale we're using */ scale = thumbnail_get_redraw_scale(content, width); + /* Set up content redraw data */ + data.x = 0; + data.y = 0; + data.width = width; + data.height = height; + + data.background_colour = 0xFFFFFF; + data.scale = scale; + data.repeat_x = false; + data.repeat_y = false; + /* Render the content */ - plot_ok &= content_redraw(content, 0, 0, width, height, &clip, scale, - 0xFFFFFF, false, false); + plot_ok &= content_redraw(content, &data, &clip); if (plot.option_knockout) knockout_plot_end(); diff --git a/desktop/tree.c b/desktop/tree.c index ee911ea67..0bf9ba625 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -1655,10 +1655,21 @@ static void tree_draw_node_element(struct tree *tree, if (c.x1 > c.x0 && c.y1 > c.y0) { /* Valid clip rectangles only */ + struct content_redraw_data data; + plot.clip(&c); - content_redraw(icon , x, y + icon_inset, - TREE_ICON_SIZE, TREE_ICON_SIZE, - &c, 1, 0, false, false); + + data.x = x; + data.y = y + icon_inset; + data.width = TREE_ICON_SIZE; + data.height = TREE_ICON_SIZE; + + data.background_colour = 0xFFFFFF; + data.scale = 1; + data.repeat_x = false; + data.repeat_y = false; + + content_redraw(icon, &data, &c); /* Restore previous clipping area */ plot.clip(clip); -- cgit v1.2.3