raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4d6a8a7fce51b5654404226668a27d52d1e30eb3

commit 4d6a8a7fce51b5654404226668a27d52d1e30eb3
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sat Mar 26 10:49:20 2016 +0900

    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
---
 src/lib/evas/common/evas_font_draw.c      | 2 +-
 src/lib/evas/common/evas_map_image.c      | 4 ++--
 src/lib/evas/common/evas_rectangle_main.c | 2 +-
 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 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:
 EAPI Eina_Bool
 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)
 {
-   static Cutout_Rects *rects = NULL;
+   static __thread Cutout_Rects *rects = NULL;
    int ext_x, ext_y, ext_w, ext_h;
    int im_w, im_h;
    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,
                         int smooth, int level,
                         Evas_Common_Map_RGBA_Cb cb)
 {
-   static Cutout_Rects *rects = NULL;
+   static __thread Cutout_Rects *rects = NULL;
    Cutout_Rect  *r;
    int          c, cx, cy, cw, ch;
    int          i;
@@ -791,7 +791,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
 EAPI Eina_Bool
 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)
 {
-   static Cutout_Rects *rects = NULL;
+   static __thread Cutout_Rects *rects = NULL;
    Cutout_Rect  *r;
    int          c, cx, cy, cw, ch;
    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)
 EAPI void
 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)
 {
-   static Cutout_Rects *rects = NULL;
+   static __thread Cutout_Rects *rects = NULL;
    Cutout_Rect  *r;
    int          c, cx, cy, cw, ch;
    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,
                                          int dst_region_w, int dst_region_h,
                                          Evas_Common_Scale_In_To_Out_Clip_Cb 
cb)
 {
-   static Cutout_Rects *rects = NULL;
+   static __thread Cutout_Rects *rects = NULL;
    Cutout_Rect  *r;
    int          c, cx, cy, cw, ch;
    int          i;

-- 


Reply via email to