From 04a118c4153a4c727c5843162f147311054ebf5a Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 14 Sep 2013 12:44:32 +0100 Subject: treeview deferred redraw --- amiga/tree.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'amiga') diff --git a/amiga/tree.c b/amiga/tree.c index c67c4a0eb..a017f0fe5 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -53,6 +53,7 @@ #include "amiga/drag.h" /* drag icon stuff */ #include "amiga/theme.h" /* pointers */ #include "amiga/filetype.h" +#include "amiga/schedule.h" #include "utils/nsoption.h" #include "content/urldb.h" #include "desktop/cookie_manager.h" @@ -101,6 +102,14 @@ struct treeview_window { struct MinList shared_pens; }; +struct ami_tree_redraw_req { + int x; + int y; + int width; + int height; + struct treeview_window *twin; +}; + void ami_tree_draw(struct treeview_window *twin); static void ami_tree_redraw_request(int x, int y, int width, int height, void *data); @@ -1214,9 +1223,14 @@ void ami_tree_draw(struct treeview_window *twin) ami_tree_redraw_request(x, y, bbox->Width, bbox->Height, twin); } -void ami_tree_redraw_request(int x, int y, int width, int height, void *data) +static void ami_tree_redraw_req(void *p) { - struct treeview_window *twin = data; + struct ami_tree_redraw_req *atrr_data = (struct ami_tree_redraw_req *)p; + int x = atrr_data->x; + int y = atrr_data->y; + int width = atrr_data->width; + int height = atrr_data->height; + struct treeview_window *twin = atrr_data->twin; struct IBox *bbox; int pos_x, pos_y; int tile_x, tile_y, tile_w, tile_h; @@ -1276,6 +1290,21 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data) } } + FreeVec(atrr_data); ami_update_pointer(twin->win, GUI_POINTER_DEFAULT); glob = &browserglob; } + +void ami_tree_redraw_request(int x, int y, int width, int height, void *data) +{ + struct ami_tree_redraw_req *atrr_data = AllocVec(sizeof(struct ami_tree_redraw_req), MEMF_CLEAR | MEMF_PRIVATE); + + atrr_data->x = x; + atrr_data->y = y; + atrr_data->width = width; + atrr_data->height = height; + atrr_data->twin = (struct treeview_window *)data; + + schedule(0, ami_tree_redraw_req, atrr_data); +} + -- cgit v1.2.3