From 3e77ceeb81deb21494b8f87ef166fcf978837c7e Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 29 Feb 2012 19:09:55 +0000 Subject: allow both x and y dimensions of redraw tiles to be configured svn path=/trunk/netsurf/; revision=13502 --- amiga/gui.c | 12 ++++++------ amiga/options.h | 11 +++++++---- amiga/plotters.c | 7 ++++--- amiga/thumbnail.c | 6 +++++- amiga/tree.c | 12 ++++++------ 5 files changed, 28 insertions(+), 20 deletions(-) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index 39f2d9f72..8f83f5609 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3251,15 +3251,15 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin, //printf("%ld %ld %ld %ld\n",left, top, width, height); - for(y = top; y < (top + height); y += option_redraw_tile_size) { + for(y = top; y < (top + height); y += option_redraw_tile_size_y) { clip.y0 = 0; - clip.y1 = option_redraw_tile_size; - if(((top + height) - y) < option_redraw_tile_size) clip.y1 = (top + height) - y; + clip.y1 = option_redraw_tile_size_y; + if(((top + height) - y) < option_redraw_tile_size_y) clip.y1 = (top + height) - y; - for(x = left; x < (left + width); x += option_redraw_tile_size) { + for(x = left; x < (left + width); x += option_redraw_tile_size_x) { clip.x0 = 0; - clip.x1 = option_redraw_tile_size; - if(((left + width) - x) < option_redraw_tile_size) clip.x1 = (left + width) - x; + clip.x1 = option_redraw_tile_size_x; + if(((left + width) - x) < option_redraw_tile_size_x) clip.x1 = (left + width) - x; //printf("%ld %ld -> %ld %ld\n",clip.x0 - (int)(x / gwin->bw->scale), clip.y0 - (int)(y / gwin->bw->scale), clip.x1, clip.y1); diff --git a/amiga/options.h b/amiga/options.h index b03ff70ee..d11c5908b 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -1,5 +1,5 @@ /* - * Copyright 2008 - 2011 Chris Young + * Copyright 2008 - 2012 Chris Young * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -65,7 +65,8 @@ extern int option_cookies_window_ysize; extern int option_cairo_renderer; extern bool option_direct_render; extern int option_amiga_ydpi; -extern int option_redraw_tile_size; +extern int option_redraw_tile_size_x; +extern int option_redraw_tile_size_y; extern int option_monitor_aspect_x; extern int option_monitor_aspect_y; extern bool option_accept_lang_locale; @@ -117,7 +118,8 @@ int option_cookies_window_ysize = 0; \ int option_cairo_renderer = 1; \ bool option_direct_render = false; \ int option_amiga_ydpi = 72; \ -int option_redraw_tile_size = 300; \ +int option_redraw_tile_size_x = 0; \ +int option_redraw_tile_size_y = 100; \ int option_monitor_aspect_x = 0; \ int option_monitor_aspect_y = 0; \ bool option_accept_lang_locale = true; \ @@ -169,7 +171,8 @@ int option_menu_refresh = 0; \ { "cairo_renderer", OPTION_INTEGER, &option_cairo_renderer}, \ { "direct_render", OPTION_BOOL, &option_direct_render}, \ { "amiga_ydpi", OPTION_INTEGER, &option_amiga_ydpi}, \ -{ "redraw_tile_size", OPTION_INTEGER, &option_redraw_tile_size}, \ +{ "redraw_tile_size_x", OPTION_INTEGER, &option_redraw_tile_size_x}, \ +{ "redraw_tile_size_y", OPTION_INTEGER, &option_redraw_tile_size_y}, \ { "monitor_aspect_x", OPTION_INTEGER, &option_monitor_aspect_x}, \ { "monitor_aspect_y", OPTION_INTEGER, &option_monitor_aspect_y}, \ { "accept_lang_locale", OPTION_BOOL, &option_accept_lang_locale}, \ diff --git a/amiga/plotters.c b/amiga/plotters.c index a1112de47..4dd6256ff 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -121,9 +121,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB bitmaps */ - if(option_redraw_tile_size <= 0) option_redraw_tile_size = scrn->Width; - if(!width) width = option_redraw_tile_size; - if(!height) height = option_redraw_tile_size; + if(option_redraw_tile_size_x <= 0) option_redraw_tile_size_x = scrn->Width; + if(option_redraw_tile_size_y <= 0) option_redraw_tile_size_y = scrn->Height; + if(!width) width = option_redraw_tile_size_x; + if(!height) height = option_redraw_tile_size_y; gg->layerinfo = NewLayerInfo(); gg->areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR); diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c index 4658f6bdd..ae8993a72 100755 --- a/amiga/thumbnail.c +++ b/amiga/thumbnail.c @@ -42,13 +42,17 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, struct BitScaleArgs bsa; int plot_width; int plot_height; + int redraw_tile_size = option_redraw_tile_size_x; struct redraw_context ctx = { .interactive = false, .background_images = true, .plot = &amiplot }; - plot_width = MIN(content_get_width(content), option_redraw_tile_size); + if(option_redraw_tile_size_y < option_redraw_tile_size_x) + redraw_tile_size = option_redraw_tile_size_y; + + plot_width = MIN(content_get_width(content), redraw_tile_size); plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) / bitmap->width; diff --git a/amiga/tree.c b/amiga/tree.c index 0e17ae836..51cb35865 100755 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -1248,14 +1248,14 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data) y = pos_y; } - for(tile_y = y; tile_y < (y + height); tile_y += option_redraw_tile_size) { - tile_h = option_redraw_tile_size; - if(((y + height) - tile_y) < option_redraw_tile_size) + for(tile_y = y; tile_y < (y + height); tile_y += option_redraw_tile_size_y) { + tile_h = option_redraw_tile_size_y; + if(((y + height) - tile_y) < option_redraw_tile_size_y) tile_h = (y + height) - tile_y; - for(tile_x = x; tile_x < (x + width); tile_x += option_redraw_tile_size) { - tile_w = option_redraw_tile_size; - if(((x + width) - tile_x) < option_redraw_tile_size) + for(tile_x = x; tile_x < (x + width); tile_x += option_redraw_tile_size_x) { + tile_w = option_redraw_tile_size_x; + if(((x + width) - tile_x) < option_redraw_tile_size_x) tile_w = (x + width) - tile_x; tree_draw(twin->tree, - tile_x, - tile_y, -- cgit v1.2.3