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
This commit is contained in:
Carsten Haitzler 2016-03-26 10:49:20 +09:00
parent 8269713fe5
commit 4d6a8a7fce
4 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;