summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-26 10:49:20 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-26 10:52:14 +0900
commit4d6a8a7fce51b5654404226668a27d52d1e30eb3 (patch)
tree0080b296cef1d5321e24e9da0dbc3b92ffc86e19 /src/lib/evas/common
parent8269713fe5071b3eb7748a09b240a128b2d5c883 (diff)
evas sw render: cutout rects may be used in multiple threads
several draw funcs keep a static Cutout_Rect *rects = NULL; variable to cache cutout rects to avoid re-allocating them a lot etc. this is fast and handy but we may use these from multiple threads. thats bad .... mmmkay. so this fixes it the dirty way - makes them thread local. :) this fixes T3348 - the crash mentioned by @zmike @fix
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_font_draw.c2
-rw-r--r--src/lib/evas/common/evas_map_image.c4
-rw-r--r--src/lib/evas/common/evas_rectangle_main.c2
-rw-r--r--src/lib/evas/common/evas_scale_main.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c
index bbeecf6..bf5141b 100644
--- a/src/lib/evas/common/evas_font_draw.c
+++ b/src/lib/evas/common/evas_font_draw.c
@@ -348,7 +348,7 @@ error:
348EAPI Eina_Bool 348EAPI Eina_Bool
349evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, Evas_Common_Font_Draw_Cb cb) 349evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, Evas_Common_Font_Draw_Cb cb)
350{ 350{
351 static Cutout_Rects *rects = NULL; 351 static __thread Cutout_Rects *rects = NULL;
352 int ext_x, ext_y, ext_w, ext_h; 352 int ext_x, ext_y, ext_w, ext_h;
353 int im_w, im_h; 353 int im_w, im_h;
354 RGBA_Gfx_Func func; 354 RGBA_Gfx_Func func;
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index cec21f6..eb94ada 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -745,7 +745,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
745 int smooth, int level, 745 int smooth, int level,
746 Evas_Common_Map_RGBA_Cb cb) 746 Evas_Common_Map_RGBA_Cb cb)
747{ 747{
748 static Cutout_Rects *rects = NULL; 748 static __thread Cutout_Rects *rects = NULL;
749 Cutout_Rect *r; 749 Cutout_Rect *r;
750 int c, cx, cy, cw, ch; 750 int c, cx, cy, cw, ch;
751 int i; 751 int i;
@@ -791,7 +791,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
791EAPI Eina_Bool 791EAPI Eina_Bool
792evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map *map, int smooth, int level, int offset, Evas_Common_Map_Thread_RGBA_Cb cb) 792evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map *map, int smooth, int level, int offset, Evas_Common_Map_Thread_RGBA_Cb cb)
793{ 793{
794 static Cutout_Rects *rects = NULL; 794 static __thread Cutout_Rects *rects = NULL;
795 Cutout_Rect *r; 795 Cutout_Rect *r;
796 int c, cx, cy, cw, ch; 796 int c, cx, cy, cw, ch;
797 int i; 797 int i;
diff --git a/src/lib/evas/common/evas_rectangle_main.c b/src/lib/evas/common/evas_rectangle_main.c
index 220fd0f..bd4649b 100644
--- a/src/lib/evas/common/evas_rectangle_main.c
+++ b/src/lib/evas/common/evas_rectangle_main.c
@@ -12,7 +12,7 @@ evas_common_rectangle_init(void)
12EAPI void 12EAPI void
13evas_common_rectangle_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, Evas_Common_Rectangle_Draw_Cb cb) 13evas_common_rectangle_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, Evas_Common_Rectangle_Draw_Cb cb)
14{ 14{
15 static Cutout_Rects *rects = NULL; 15 static __thread Cutout_Rects *rects = NULL;
16 Cutout_Rect *r; 16 Cutout_Rect *r;
17 int c, cx, cy, cw, ch; 17 int c, cx, cy, cw, ch;
18 int i; 18 int i;
diff --git a/src/lib/evas/common/evas_scale_main.c b/src/lib/evas/common/evas_scale_main.c
index cf34c31..bd30a47 100644
--- a/src/lib/evas/common/evas_scale_main.c
+++ b/src/lib/evas/common/evas_scale_main.c
@@ -40,7 +40,7 @@ evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
40 int dst_region_w, int dst_region_h, 40 int dst_region_w, int dst_region_h,
41 Evas_Common_Scale_In_To_Out_Clip_Cb cb) 41 Evas_Common_Scale_In_To_Out_Clip_Cb cb)
42{ 42{
43 static Cutout_Rects *rects = NULL; 43 static __thread Cutout_Rects *rects = NULL;
44 Cutout_Rect *r; 44 Cutout_Rect *r;
45 int c, cx, cy, cw, ch; 45 int c, cx, cy, cw, ch;
46 int i; 46 int i;