diff options
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/htmlredraw.c | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/riscos/htmlredraw.c b/riscos/htmlredraw.c index b0c2c4e5d..ce5ce211a 100644 --- a/riscos/htmlredraw.c +++ b/riscos/htmlredraw.c @@ -102,11 +102,7 @@ void html_redraw_box(struct content *content, struct box * box, int padding_left, padding_top; int padding_width, padding_height; int x0, y0, x1, y1; - int px0, py0, px1, py1; int colour; - os_VDU_VAR_LIST(5) vars = { { os_VDUVAR_GWL_COL, os_VDUVAR_GWB_ROW, - os_VDUVAR_GWR_COL, os_VDUVAR_GWT_ROW, -1 } }; - os_vdu_var cgw[4]; x += box->x * 2 * scale; y -= box->y * 2 * scale; @@ -215,37 +211,43 @@ void html_redraw_box(struct content *content, struct box * box, y1 = clip_y1; } - /* find intersection of clip box and padding box */ - px0 = x < x0 ? x0 : x; - py0 = y - padding_height < y0 ? y0 : y - padding_height; - px1 = x + padding_width < x1 ? x + padding_width : x1; - py1 = y < y1 ? y : y1; - - /* background colour */ - if (box->style != 0 && box->style->background_color != TRANSPARENT) { - colourtrans_set_gcol(box->style->background_color << 8, - colourtrans_USE_ECFS, os_ACTION_OVERWRITE, 0); - os_plot(os_MOVE_TO, px0, py0); - if (px0 < px1 && py0 < py1) - os_plot(os_PLOT_RECTANGLE | os_PLOT_TO, px1, py1); - current_background_color = box->style->background_color; - } - - /* read current graphics window dimensions */ - xos_read_vdu_variables((os_vdu_var_list const *) &vars, (int*)&cgw); + /* background colour and image */ + if (box->style && (box->type != BOX_INLINE || + box->style != box->parent->parent->style)) { + /* find intersection of clip box and padding box */ + int px0 = x < x0 ? x0 : x; + int py0 = y - padding_height < y0 ? y0 : y - padding_height; + int px1 = x + padding_width < x1 ? x + padding_width : x1; + int py1 = y < y1 ? y : y1; + + /* background colour */ + /* optimisation: skip if fully repeated background image */ + if (box->style->background_color != TRANSPARENT && + (!box->background || + box->style->background_repeat != + CSS_BACKGROUND_REPEAT_REPEAT)) { + colourtrans_set_gcol(box->style->background_color << 8, + colourtrans_USE_ECFS, + os_ACTION_OVERWRITE, 0); + os_plot(os_MOVE_TO, px0, py0); + if (px0 < px1 && py0 < py1) + os_plot(os_PLOT_RECTANGLE | os_PLOT_TO, + px1, py1); + current_background_color = box->style->background_color; + } - /* clip to padding box */ - html_redraw_clip(px0, py0, px1, py1); + if (box->background) { + /* clip to padding box */ + html_redraw_clip(px0, py0, px1, py1); - /* plot background image */ - /* the if statement below causes regression on acornarcade.com - * but fixes some issues with the CSS testsuite background section */ -// if (box->type != BOX_INLINE && box->background) - html_redraw_background(x, y, width, clip_y1-clip_y0, box, scale); + /* plot background image */ + html_redraw_background(x, y, width, clip_y1 - clip_y0, + box, scale); - /* restore previous graphics window */ - /* should probably take account of the eigvalues here... */ - html_redraw_clip(cgw[0]*2, cgw[1]*2, cgw[2]*2, cgw[3]*2); + /* restore previous graphics window */ + html_redraw_clip(x0, y0, x1, y1); + } + } if (box->object) { content_redraw(box->object, x + padding_left, y - padding_top, |