From 1304964f92249a1f8e685db89aa694f77307d6ae Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 27 Apr 2011 13:50:49 +0000 Subject: Reduce number of page reflows and viewport redraws as images are fetched: + Flag known-sized boxes generated by images. + Treat them as replaced all through layout. + Only reflow the document for fetched images if we don't already have the box at the right size. svn path=/trunk/netsurf/; revision=12243 --- render/html_redraw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'render/html_redraw.c') diff --git a/render/html_redraw.c b/render/html_redraw.c index 9ae43bce1..c5d20b26f 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -427,7 +427,8 @@ bool html_redraw_box(struct box *box, int x_parent, int y_parent, if (bg_box && bg_box->type != BOX_BR && bg_box->type != BOX_TEXT && bg_box->type != BOX_INLINE_END && - (bg_box->type != BOX_INLINE || bg_box->object)) { + (bg_box->type != BOX_INLINE || bg_box->object || + box->flags & REPLACE_DIM)) { /* find intersection of clip box and border edge */ struct rect p; p.x0 = x - border_left < r.x0 ? r.x0 : x - border_left; @@ -471,7 +472,8 @@ bool html_redraw_box(struct box *box, int x_parent, int y_parent, /* borders for block level content and replaced inlines */ if (box->style && box->type != BOX_TEXT && box->type != BOX_INLINE_END && - (box->type != BOX_INLINE || box->object) && + (box->type != BOX_INLINE || box->object || + box->flags & REPLACE_DIM) && (border_top || border_right || border_bottom || border_left)) { if (!html_redraw_borders(box, x_parent, y_parent, -- cgit v1.2.3