efl: let's not do useless over allocation and memcpy.

SVN revision: 82872
This commit is contained in:
Cedric BAIL 2013-01-16 10:45:04 +00:00
parent 29b56951a7
commit 7e4e3fe5b8
1 changed files with 16 additions and 12 deletions

View File

@ -696,16 +696,22 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
if ((do_async) && (ENFN->multi_font_draw)) if ((do_async) && (ENFN->multi_font_draw))
{ {
Eina_Bool async_unref; Eina_Bool async_unref;
Evas_Font_Array_Data *fad;
texts = malloc(sizeof(*texts)); texts = malloc(sizeof(*texts));
texts->array = eina_inarray_new(sizeof(Evas_Font_Array_Data), texts->array = eina_inarray_new(sizeof(Evas_Font_Array_Data), 1); /* FIXME: Wasting 1 int here */
32);
texts->refcount = 1; texts->refcount = 1;
fad = eina_inarray_grow(texts->array, row->texts_num);
if (!fad)
{
ERR("Failed to allocate Evas_Font_Array_Data.");
return ;
}
for (xx = 0; xx < row->texts_num; xx++) for (xx = 0; xx < row->texts_num; xx++)
{ {
Evas_Text_Props *props; Evas_Text_Props *props;
Evas_Font_Array_Data fad;
props = props =
evas_object_textgrid_textprop_int_to evas_object_textgrid_textprop_int_to
@ -717,16 +723,14 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
evas_unref_queue_glyph_put(obj->layer->evas, evas_unref_queue_glyph_put(obj->layer->evas,
props->glyphs); props->glyphs);
fad.color.r = row->texts[xx].r; fad->color.r = row->texts[xx].r;
fad.color.g = row->texts[xx].g; fad->color.g = row->texts[xx].g;
fad.color.b = row->texts[xx].b; fad->color.b = row->texts[xx].b;
fad.color.a = row->texts[xx].a; fad->color.a = row->texts[xx].a;
fad.x = row->texts[xx].x; fad->x = row->texts[xx].x;
fad.glyphs = props->glyphs; fad->glyphs = props->glyphs;
if (eina_inarray_push(texts->array, &fad) < 0) fad++;
ERR("Failed to push text onto texts array %p",
texts->array);
} }
async_unref = async_unref =