diff options
author | Rob Kendrick <rjek@netsurf-browser.org> | 2008-03-11 00:14:39 +0000 |
---|---|---|
committer | Rob Kendrick <rjek@netsurf-browser.org> | 2008-03-11 00:14:39 +0000 |
commit | 4ec38922ac17f72a52cccb1e3ad875618ce00df5 (patch) | |
tree | 15bb061c9c22f7eda752e36374273706018da779 /render | |
parent | b91ad2b1ffdb2b52bcb23a81fb272ab5d4e9877b (diff) | |
download | netsurf-4ec38922ac17f72a52cccb1e3ad875618ce00df5.tar.gz netsurf-4ec38922ac17f72a52cccb1e3ad875618ce00df5.tar.bz2 |
Change meaning of c->redraw_time to be the earliest time to reflow during page asset fetch. Have the time selected vary depending on how long the last reflow took.
svn path=/trunk/netsurf/; revision=3925
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/render/html.c b/render/html.c index d7dff203a..e803f2ea6 100644 --- a/render/html.c +++ b/render/html.c @@ -407,6 +407,7 @@ bool html_convert(struct content *c, int width, int height) xmlDoc *document; xmlNode *html, *head; union content_msg_data msg_data; + unsigned int time_before, time_taken; /* finish parsing */ if (c->source_size == 0) @@ -491,8 +492,15 @@ bool html_convert(struct content *c, int width, int height) html_set_status(c, messages_get("Formatting")); content_broadcast(c, CONTENT_MSG_STATUS, msg_data); LOG(("Layout document")); + time_before = wallclock(); html_reformat(c, width, height); - c->reformat_time = wallclock(); + time_taken = wallclock() - time_before; + LOG(("Layout took %dcs", time_taken)); + c->reformat_time = wallclock() + + ((time_taken < option_min_reflow_period ? + option_min_reflow_period : time_taken * 1.25)); + LOG(("Scheduling relayout no sooner than %dcs", + c->reformat_time - wallclock())); /*box_dump(c->data.html.layout->children, 0);*/ if (c->active == 0) @@ -1417,10 +1425,13 @@ void html_object_callback(content_msg msg, struct content *object, else if (option_incremental_reflow && msg == CONTENT_MSG_DONE && (c->status == CONTENT_STATUS_READY || c->status == CONTENT_STATUS_DONE) && - (option_min_reflow_period < - (int)(wallclock() - c->reformat_time))) { + (wallclock() > c->reformat_time)) { + unsigned int time_before = wallclock(), time_taken; content_reformat(c, c->available_width, c->height); - c->reformat_time = wallclock(); + time_taken = wallclock() - time_before; + c->reformat_time = wallclock() + + ((time_taken < option_min_reflow_period ? + option_min_reflow_period : time_taken * 1.25)); } if (c->status == CONTENT_STATUS_READY) html_set_status(c, ""); |