diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-03-26 10:49:20 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-03-26 10:52:14 +0900 |
commit | 4d6a8a7fce51b5654404226668a27d52d1e30eb3 (patch) | |
tree | 0080b296cef1d5321e24e9da0dbc3b92ffc86e19 /src/lib/evas/common | |
parent | 8269713fe5071b3eb7748a09b240a128b2d5c883 (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.c | 2 | ||||
-rw-r--r-- | src/lib/evas/common/evas_map_image.c | 4 | ||||
-rw-r--r-- | src/lib/evas/common/evas_rectangle_main.c | 2 | ||||
-rw-r--r-- | src/lib/evas/common/evas_scale_main.c | 2 |
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 bbeecf61a5..bf5141bf66 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c | |||
@@ -348,7 +348,7 @@ error: | |||
348 | EAPI Eina_Bool | 348 | EAPI Eina_Bool |
349 | evas_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) | 349 | evas_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 cec21f6480..eb94adad54 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, | |||
791 | EAPI Eina_Bool | 791 | EAPI Eina_Bool |
792 | evas_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) | 792 | evas_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 220fd0f565..bd4649baa3 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) | |||
12 | EAPI void | 12 | EAPI void |
13 | evas_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) | 13 | evas_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 cf34c31257..bd30a4778d 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; |