summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_font_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-05-31 20:06:21 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-05-31 20:09:41 +0900
commit9ecc87713d5cc936c81d10230bd25bb94e42833a (patch)
tree24bef2e2f597f03a10ffeb671d1e17ae506e626e /src/lib/evas/common/evas_font_main.c
parentf55092ab93380915cd451e01bfb0b73436ba411c (diff)
fix slowdown as a result of fixing text ascent/descent for fontsets from tom.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_font_main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c
index 1048ad10d1..860574a1c0 100644
--- a/src/lib/evas/common/evas_font_main.c
+++ b/src/lib/evas/common/evas_font_main.c
@@ -185,11 +185,14 @@ evas_common_font_ascent_get(RGBA_Font *fn)
185 Eina_List *l; 185 Eina_List *l;
186 RGBA_Font_Int *fi; 186 RGBA_Font_Int *fi;
187 187
188 if (fn->have_ascent) return fn->ascent;
188 EINA_LIST_FOREACH(fn->fonts, l, fi) 189 EINA_LIST_FOREACH(fn->fonts, l, fi)
189 { 190 {
190 v = evas_common_font_instance_ascent_get(fi); 191 v = evas_common_font_instance_ascent_get(fi);
191 if (v > max) max = v; 192 if (v > max) max = v;
192 } 193 }
194 fn->ascent = max;
195 fn->have_ascent = 1;
193 return max; 196 return max;
194} 197}
195 198
@@ -201,11 +204,14 @@ evas_common_font_descent_get(RGBA_Font *fn)
201 Eina_List *l; 204 Eina_List *l;
202 RGBA_Font_Int *fi; 205 RGBA_Font_Int *fi;
203 206
207 if (fn->have_descent) return fn->descent;
204 EINA_LIST_FOREACH(fn->fonts, l, fi) 208 EINA_LIST_FOREACH(fn->fonts, l, fi)
205 { 209 {
206 v = evas_common_font_instance_descent_get(fi); 210 v = evas_common_font_instance_descent_get(fi);
207 if (v > max) max = v; 211 if (v > max) max = v;
208 } 212 }
213 fn->descent = max;
214 fn->have_descent = 1;
209 return max; 215 return max;
210} 216}
211 217
@@ -217,11 +223,14 @@ evas_common_font_max_ascent_get(RGBA_Font *fn)
217 Eina_List *l; 223 Eina_List *l;
218 RGBA_Font_Int *fi; 224 RGBA_Font_Int *fi;
219 225
226 if (fn->have_max_ascent) return fn->max_ascent;
220 EINA_LIST_FOREACH(fn->fonts, l, fi) 227 EINA_LIST_FOREACH(fn->fonts, l, fi)
221 { 228 {
222 v = evas_common_font_instance_max_ascent_get(fi); 229 v = evas_common_font_instance_max_ascent_get(fi);
223 if (v > max) max = v; 230 if (v > max) max = v;
224 } 231 }
232 fn->max_ascent = max;
233 fn->have_max_ascent = 1;
225 return max; 234 return max;
226} 235}
227 236
@@ -233,11 +242,14 @@ evas_common_font_max_descent_get(RGBA_Font *fn)
233 Eina_List *l; 242 Eina_List *l;
234 RGBA_Font_Int *fi; 243 RGBA_Font_Int *fi;
235 244
245 if (fn->have_max_descent) return fn->max_descent;
236 EINA_LIST_FOREACH(fn->fonts, l, fi) 246 EINA_LIST_FOREACH(fn->fonts, l, fi)
237 { 247 {
238 v = evas_common_font_instance_max_descent_get(fi); 248 v = evas_common_font_instance_max_descent_get(fi);
239 if (v > max) max = v; 249 if (v > max) max = v;
240 } 250 }
251 fn->max_descent = max;
252 fn->have_max_descent = 1;
241 return max; 253 return max;
242} 254}
243 255