From 865c9d36108b145e995de2e8c7055501ede29863 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Mon, 24 Apr 2017 21:30:17 +0200 Subject: Update kolibrios frontend to use invalidate window area API (Applied change becd386) --- frontends/kolibrios/fb/gui.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'frontends/kolibrios/fb/gui.c') diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c index 469c06494..fbaf36f54 100644 --- a/frontends/kolibrios/fb/gui.c +++ b/frontends/kolibrios/fb/gui.c @@ -1815,21 +1815,33 @@ gui_window_destroy(struct gui_window *gw) free(gw); } -static void -gui_window_redraw_window(struct gui_window *g) -{ - fb_queue_redraw(g->browser, 0, 0, fbtk_get_width(g->browser), fbtk_get_height(g->browser) ); -} -static void -gui_window_update_box(struct gui_window *g, const struct rect *rect) +/** + * Invalidates an area of a framebuffer browser window + * + * \param gw The netsurf window being invalidated. + * \param rect area to redraw or NULL for the entire window area + * \return NSERROR_OK on success or appropriate error code + */ +static nserror +fb_window_invalidate_area(struct gui_window *g, const struct rect *rect) { struct browser_widget_s *bwidget = fbtk_get_userpw(g->browser); - fb_queue_redraw(g->browser, - rect->x0 - bwidget->scrollx, - rect->y0 - bwidget->scrolly, - rect->x1 - bwidget->scrollx, - rect->y1 - bwidget->scrolly); + + if (rect != NULL) { + fb_queue_redraw(g->browser, + rect->x0 - bwidget->scrollx, + rect->y0 - bwidget->scrolly, + rect->x1 - bwidget->scrollx, + rect->y1 - bwidget->scrolly); + } else { + fb_queue_redraw(g->browser, + 0, + 0, + fbtk_get_width(g->browser), + fbtk_get_height(g->browser)); + } + return NSERROR_OK; } static bool @@ -2063,8 +2075,7 @@ static void framebuffer_window_reformat(struct gui_window *gw) static struct gui_window_table framebuffer_window_table = { .create = gui_window_create, .destroy = gui_window_destroy, - .redraw = gui_window_redraw_window, - .update = gui_window_update_box, + .invalidate = fb_window_invalidate_area, .get_scroll = gui_window_get_scroll, .set_scroll = gui_window_set_scroll, .get_dimensions = gui_window_get_dimensions, @@ -2120,7 +2131,6 @@ int main(int argc, char** argv) MKARGV(1, "-V"); MKARGV(2, "/tmp0/1/netsurf.log"); MKARGV(ARGC, "\0"); - argc = ARGC; /* args fixed */ -- cgit v1.2.3