forked from enlightenment/efl
fix slowdown as a result of fixing text ascent/descent for fontsets from tom.
This commit is contained in:
parent
f55092ab93
commit
9ecc87713d
|
@ -185,11 +185,14 @@ evas_common_font_ascent_get(RGBA_Font *fn)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
RGBA_Font_Int *fi;
|
RGBA_Font_Int *fi;
|
||||||
|
|
||||||
|
if (fn->have_ascent) return fn->ascent;
|
||||||
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
||||||
{
|
{
|
||||||
v = evas_common_font_instance_ascent_get(fi);
|
v = evas_common_font_instance_ascent_get(fi);
|
||||||
if (v > max) max = v;
|
if (v > max) max = v;
|
||||||
}
|
}
|
||||||
|
fn->ascent = max;
|
||||||
|
fn->have_ascent = 1;
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,11 +204,14 @@ evas_common_font_descent_get(RGBA_Font *fn)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
RGBA_Font_Int *fi;
|
RGBA_Font_Int *fi;
|
||||||
|
|
||||||
|
if (fn->have_descent) return fn->descent;
|
||||||
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
||||||
{
|
{
|
||||||
v = evas_common_font_instance_descent_get(fi);
|
v = evas_common_font_instance_descent_get(fi);
|
||||||
if (v > max) max = v;
|
if (v > max) max = v;
|
||||||
}
|
}
|
||||||
|
fn->descent = max;
|
||||||
|
fn->have_descent = 1;
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,11 +223,14 @@ evas_common_font_max_ascent_get(RGBA_Font *fn)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
RGBA_Font_Int *fi;
|
RGBA_Font_Int *fi;
|
||||||
|
|
||||||
|
if (fn->have_max_ascent) return fn->max_ascent;
|
||||||
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
||||||
{
|
{
|
||||||
v = evas_common_font_instance_max_ascent_get(fi);
|
v = evas_common_font_instance_max_ascent_get(fi);
|
||||||
if (v > max) max = v;
|
if (v > max) max = v;
|
||||||
}
|
}
|
||||||
|
fn->max_ascent = max;
|
||||||
|
fn->have_max_ascent = 1;
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,11 +242,14 @@ evas_common_font_max_descent_get(RGBA_Font *fn)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
RGBA_Font_Int *fi;
|
RGBA_Font_Int *fi;
|
||||||
|
|
||||||
|
if (fn->have_max_descent) return fn->max_descent;
|
||||||
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
EINA_LIST_FOREACH(fn->fonts, l, fi)
|
||||||
{
|
{
|
||||||
v = evas_common_font_instance_max_descent_get(fi);
|
v = evas_common_font_instance_max_descent_get(fi);
|
||||||
if (v > max) max = v;
|
if (v > max) max = v;
|
||||||
}
|
}
|
||||||
|
fn->max_descent = max;
|
||||||
|
fn->have_max_descent = 1;
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -880,8 +880,13 @@ struct _RGBA_Font
|
||||||
Fash_Int *fash;
|
Fash_Int *fash;
|
||||||
Font_Hint_Flags hinting;
|
Font_Hint_Flags hinting;
|
||||||
int references;
|
int references;
|
||||||
|
short ascent, descent, max_ascent, max_descent;
|
||||||
LK(lock);
|
LK(lock);
|
||||||
unsigned char sizeok : 1;
|
unsigned char sizeok : 1;
|
||||||
|
unsigned char have_ascent : 1;
|
||||||
|
unsigned char have_descent : 1;
|
||||||
|
unsigned char have_max_ascent : 1;
|
||||||
|
unsigned char have_max_descent : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "../common/evas_font_ot.h"
|
#include "../common/evas_font_ot.h"
|
||||||
|
|
Loading…
Reference in New Issue