summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-06-17 04:32:54 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-06-17 04:32:54 +0000
commit67a8db57b18b9f5d0b059175f25d1348dd88ab22 (patch)
tree3c6bf4d8322c01efc41336884625aa2acb5bac48 /legacy/evas/src/lib/engines
parent873d5ed76a75b92a7860642a73090267cc352488 (diff)
evas: let's have an O(1) check instead of O(N).
SVN revision: 72266
Diffstat (limited to 'legacy/evas/src/lib/engines')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_pipe.c16
-rw-r--r--legacy/evas/src/lib/engines/common/evas_pipe.h2
-rw-r--r--legacy/evas/src/lib/engines/common/evas_text_utils.h1
3 files changed, 7 insertions, 12 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.c b/legacy/evas/src/lib/engines/common/evas_pipe.c
index 37bc12eaa6..0249595f93 100644
--- a/legacy/evas/src/lib/engines/common/evas_pipe.c
+++ b/legacy/evas/src/lib/engines/common/evas_pipe.c
@@ -619,6 +619,7 @@ evas_common_pipe_load(void *data)
619 { 619 {
620 evas_common_font_draw_prepare(text_props); 620 evas_common_font_draw_prepare(text_props);
621 text_props->changed = EINA_FALSE; 621 text_props->changed = EINA_FALSE;
622 text_props->prepare = EINA_FALSE;
622 } 623 }
623 LKU(fi->ft_mutex); 624 LKU(fi->ft_mutex);
624 } 625 }
@@ -738,11 +739,9 @@ evas_common_pipe_image_load(RGBA_Image *im)
738} 739}
739 740
740EAPI void 741EAPI void
741evas_common_pipe_text_prepare(const Evas_Text_Props *text_props) 742evas_common_pipe_text_prepare(Evas_Text_Props *text_props)
742{ 743{
743 RGBA_Font_Int *fi; 744 RGBA_Font_Int *fi;
744 const Evas_Text_Props *tmp_props;
745 const Eina_List *l;
746 745
747 fi = text_props->font_instance; 746 fi = text_props->font_instance;
748 if (!fi) return ; 747 if (!fi) return ;
@@ -750,22 +749,17 @@ evas_common_pipe_text_prepare(const Evas_Text_Props *text_props)
750 if (!text_props->changed && text_props->generation == fi->generation && text_props->bin) 749 if (!text_props->changed && text_props->generation == fi->generation && text_props->bin)
751 return ; 750 return ;
752 751
753 fi = text_props->font_instance;
754 if (!fi) return ;
755
756 LKL(fi->ft_mutex); 752 LKL(fi->ft_mutex);
757 753
758 if (!fi->task) 754 if (!fi->task)
759 { 755 {
760 LKL(text_task_mutex); 756 LKL(text_task_mutex);
761 text_task = eina_list_append(text_task, fi); 757 text_task = eina_list_append(text_task, fi);
762 LKU(text_task_mutex); 758 LKU(text_task_mutex);
763 } 759 }
764 760
765 EINA_LIST_FOREACH(fi->task, l, tmp_props) 761 if (text_props->prepare) goto end;
766 if (tmp_props == text_props) 762 text_props->prepare = EINA_TRUE;
767 goto end;
768
769 fi->task = eina_list_append(fi->task, text_props); 763 fi->task = eina_list_append(fi->task, text_props);
770 764
771 end: 765 end:
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.h b/legacy/evas/src/lib/engines/common/evas_pipe.h
index 42531e1c52..b4614241b7 100644
--- a/legacy/evas/src/lib/engines/common/evas_pipe.h
+++ b/legacy/evas/src/lib/engines/common/evas_pipe.h
@@ -23,7 +23,7 @@ EAPI void evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc
23EAPI void evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1); 23EAPI void evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
24EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y); 24EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
25EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Text_Props *intl_props); 25EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Text_Props *intl_props);
26EAPI void evas_common_pipe_text_prepare(const Evas_Text_Props *text_props); 26EAPI void evas_common_pipe_text_prepare(Evas_Text_Props *text_props);
27EAPI void evas_common_pipe_image_load(RGBA_Image *im); 27EAPI void evas_common_pipe_image_load(RGBA_Image *im);
28EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); 28EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
29EAPI void evas_common_pipe_map_begin(RGBA_Image *root); 29EAPI void evas_common_pipe_map_begin(RGBA_Image *root);
diff --git a/legacy/evas/src/lib/engines/common/evas_text_utils.h b/legacy/evas/src/lib/engines/common/evas_text_utils.h
index 69489d0c5b..e30827db9b 100644
--- a/legacy/evas/src/lib/engines/common/evas_text_utils.h
+++ b/legacy/evas/src/lib/engines/common/evas_text_utils.h
@@ -35,6 +35,7 @@ struct _Evas_Text_Props
35 35
36 int generation; 36 int generation;
37 Eina_Bool changed : 1; 37 Eina_Bool changed : 1;
38 Eina_Bool prepare : 1;
38}; 39};
39 40
40struct _Evas_Text_Props_Info 41struct _Evas_Text_Props_Info