summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-16 09:15:50 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-08-16 09:15:50 +0100
commit2b0a98bd47938b3ecc09c1b5751240626b691467 (patch)
tree4ece18b6910034d3b9d2cb11fbfe2bef43a50219
parent9d624ce17f9d7d7d3282846a21e386fc0bf8b6c2 (diff)
downloadnetsurf-2b0a98bd47938b3ecc09c1b5751240626b691467.tar.gz
netsurf-2b0a98bd47938b3ecc09c1b5751240626b691467.tar.bz2
Avoid background blending overhead for treeview text.
-rw-r--r--riscos/font.c7
-rw-r--r--riscos/gui.h1
-rw-r--r--riscos/treeview.c5
3 files changed, 11 insertions, 2 deletions
diff --git a/riscos/font.c b/riscos/font.c
index 68ee6b636..06bea088c 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -424,6 +424,7 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const char *string,
{
const char *font_family;
unsigned int font_size;
+ unsigned int flags = rufl_BLEND_FONT;
rufl_style font_style;
rufl_code code;
@@ -431,9 +432,11 @@ bool nsfont_paint(const plot_font_style_t *fstyle, const char *string,
if (font_size == 0)
return true;
+ if (no_font_blending || print_active)
+ flags = 0;
+
code = rufl_paint(font_family, font_style, font_size,
- string, length, x, y,
- print_active ? 0 : rufl_BLEND_FONT);
+ string, length, x, y, flags);
if (code != rufl_OK) {
if (code == rufl_FONT_MANAGER_ERROR)
LOG(("rufl_paint: rufl_FONT_MANAGER_ERROR: 0x%x: %s",
diff --git a/riscos/gui.h b/riscos/gui.h
index aa9873cfc..b9e0647c1 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -64,6 +64,7 @@ extern bool gui_redraw_debug;
extern osspriteop_area *gui_sprites;
extern bool dialog_folder_add, dialog_entry_add, hotlist_insert;
extern bool print_active, print_text_black;
+extern bool no_font_blending;
typedef enum { GUI_DRAG_NONE, GUI_DRAG_SELECTION, GUI_DRAG_DOWNLOAD_SAVE,
GUI_DRAG_SAVE, GUI_DRAG_SCROLL, GUI_DRAG_STATUS_RESIZE,
diff --git a/riscos/treeview.c b/riscos/treeview.c
index 68fb4a7f7..84450cdb4 100644
--- a/riscos/treeview.c
+++ b/riscos/treeview.c
@@ -455,6 +455,10 @@ void ro_treeview_redraw_loop(wimp_draw *redraw, ro_treeview *tv, osbool more)
if (tv != NULL && tv->tree != NULL) {
struct rect clip;
+
+ /* Treeview text alwyas has flat background colour,
+ * so disable unnecessary background blending */
+ no_font_blending = true;
tree_draw(tv->tree, tv->origin.x/2, -(tv->origin.y/2),
(redraw->clip.x0
-(ro_plot_origin_x+tv->origin.x))/2,
@@ -463,6 +467,7 @@ void ro_treeview_redraw_loop(wimp_draw *redraw, ro_treeview *tv, osbool more)
(redraw->clip.x1 - redraw->clip.x0)/2,
(redraw->clip.y1 - redraw->clip.y0)/2,
&ctx);
+ no_font_blending = false;
/* Put the graphcis window back how the Wimp set it. */
clip.x0 = (redraw->clip.x0 - ro_plot_origin_x) / 2;