allow both x and y dimensions of redraw tiles to be configured

svn path=/trunk/netsurf/; revision=13502
This commit is contained in:
Chris Young 2012-02-29 19:09:55 +00:00
parent 6ab79f9868
commit 3e77ceeb81
5 changed files with 28 additions and 20 deletions

View File

@ -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);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 - 2011 Chris Young <chris@unsatisfactorysoftware.co.uk>
* Copyright 2008 - 2012 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* 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}, \

View File

@ -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);

View File

@ -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;

View File

@ -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,