Avoid background blending overhead for treeview text.

This commit is contained in:
Michael Drake 2013-08-16 09:15:50 +01:00
parent 9d624ce17f
commit 2b0a98bd47
3 changed files with 11 additions and 2 deletions

View File

@ -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",

View File

@ -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,

View File

@ -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;