From a66575dfebd6460d5134c22543458030c7ae817d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 19 Feb 2011 22:17:54 +0000 Subject: Remove thumbnail_create() from browser.h. Make RO front end use the core thumbnail_redraw function. Make other front ends include the right header for thumbnail_create(). svn path=/trunk/netsurf/; revision=11716 --- riscos/save.c | 1 + riscos/thumbnail.c | 17 ++++++----------- riscos/window.c | 1 + 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'riscos') diff --git a/riscos/save.c b/riscos/save.c index 2430c13aa..a47de318f 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -43,6 +43,7 @@ #include "desktop/save_complete.h" #include "desktop/save_text.h" #include "desktop/selection.h" +#include "desktop/thumbnail.h" #include "image/bitmap.h" #include "render/box.h" #include "render/form.h" diff --git a/riscos/thumbnail.c b/riscos/thumbnail.c index fba43f6bf..9229ebd2e 100644 --- a/riscos/thumbnail.c +++ b/riscos/thumbnail.c @@ -35,6 +35,7 @@ #include "content/hlcache.h" #include "content/urldb.h" #include "desktop/plotters.h" +#include "desktop/thumbnail.h" #include "image/bitmap.h" #include "render/font.h" #include "riscos/bitmap.h" @@ -83,7 +84,6 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, { float scale = 1.0; struct thumbnail_save_area *save_area; - struct rect clip; osspriteop_area *sprite_area = NULL; osspriteop_header *sprite_header = NULL; _kernel_oserror *error; @@ -115,10 +115,9 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, ro_plot_origin_x = 0; ro_plot_origin_y = bitmap->height * 2; if (content_get_width(content)) - scale = (float)bitmap->width / - (float)content_get_width(content); + scale = thumbnail_get_redraw_scale(content, bitmap->width); + ro_plot_set_scale(scale); - current_redraw_browser = NULL; /* no selection */ /* switch output and redraw */ save_area = thumbnail_switch_output(sprite_area, sprite_header); @@ -130,13 +129,9 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, rufl_invalidate_cache(); colourtrans_set_gcol(os_COLOUR_WHITE, colourtrans_SET_BG_GCOL, os_ACTION_OVERWRITE, 0); - os_clg(); - clip.x0 = 0; - clip.y0 = 0; - clip.x1 = bitmap->width; - clip.y1 = bitmap->height; - content_redraw(content, 0, 0, bitmap->width, bitmap->height, - &clip, scale, 0xFFFFFF); + + thumbnail_redraw(content, bitmap->width, bitmap->height); + thumbnail_restore_output(save_area); rufl_invalidate_cache(); diff --git a/riscos/window.c b/riscos/window.c index ab5fcab3c..1aa2a82f2 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -50,6 +50,7 @@ #include "desktop/mouse.h" #include "desktop/plotters.h" #include "desktop/textinput.h" +#include "desktop/thumbnail.h" #include "desktop/tree.h" #include "desktop/gui.h" #include "render/box.h" -- cgit v1.2.3