[project @ 2004-03-30 11:45:48 by bursa]

Reduce frequency of gui_multitask() to improve performance.

svn path=/import/netsurf/; revision=691
This commit is contained in:
James Bursa 2004-03-30 11:45:48 +00:00
parent ead74d2f01
commit 804cd42a34
2 changed files with 8 additions and 1 deletions

View File

@ -304,11 +304,12 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
assert(n != 0 && parent_style != 0 && parent != 0);
LOG(("node %p, node type %i", n, n->type));
gui_multitask();
if (n->type == XML_ELEMENT_NODE) {
struct element_entry *element;
gui_multitask();
style = box_get_style(content->data.html.stylesheet_content,
content->data.html.stylesheet_count, parent_style, n);
LOG(("display: %s", css_display_name[style->display]));

View File

@ -60,6 +60,7 @@ bool gui_reformat_pending = false; /**< Some windows have been resized,
and should be reformatted. */
gui_drag_type gui_current_drag_type;
static wimp_t task_handle; /**< RISC OS wimp task handle. */
static clock_t gui_last_poll; /**< Time of last wimp_poll. */
/** Accepted wimp user messages. */
static const wimp_MESSAGE_LIST(26) task_messages = { {
message_DATA_SAVE,
@ -321,6 +322,7 @@ void gui_poll(bool active)
event = wimp_poll(wimp_MASK_NULL | mask, &block, 0);
}
xhourglass_on();
gui_last_poll = clock();
ro_gui_handle_event(event, &block);
schedule_run();
@ -412,9 +414,13 @@ void gui_multitask(void)
wimp_event_no event;
wimp_block block;
if (clock() < gui_last_poll + 10)
return;
xhourglass_off();
event = wimp_poll(wimp_MASK_LOSE | wimp_MASK_GAIN, &block, 0);
xhourglass_on();
gui_last_poll = clock();
switch (event) {
case wimp_CLOSE_WINDOW_REQUEST: