summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-04-24 19:30:17 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-06-10 06:25:29 (GMT)
commitfd16a63ad237e4bb4431bf78a5fcb80274131a92 (patch)
tree1dc3c1295f71d6064b91f0e1aa734b76e4d3cc01
parentbf5cb1e98ed9c4fb1c6dc157892fd8ac25dda42f (diff)
downloadnetsurf-fd16a63ad237e4bb4431bf78a5fcb80274131a92.tar.gz
netsurf-fd16a63ad237e4bb4431bf78a5fcb80274131a92.tar.bz2
Update kolibrios frontend to use invalidate window area API (Applied change becd386)
-rw-r--r--frontends/kolibrios/fb/gui.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index 469c064..fbaf36f 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 */