evas/async_render: only get a ref if a thread cmd was issued

This patch should make us get a reference on images, maps and glyphs
which are sent in a command to the render thread. Before we were doing
some useless ref and unref operations.



SVN revision: 82666
This commit is contained in:
Ulisses Furquim 2013-01-11 19:57:09 +00:00
parent f0f9f7b7a6
commit 48c15aaa74
10 changed files with 124 additions and 105 deletions

View File

@ -17,11 +17,11 @@ EAPI int evas_common_font_max_descent_get (RGBA_Font *fn);
EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
/* draw */
typedef void (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
typedef Eina_Bool (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI void 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);
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);
EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs);
EAPI void evas_common_font_rgba_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI Eina_Bool evas_common_font_rgba_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl);
EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
EAPI Eina_Bool evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg);

View File

@ -27,7 +27,7 @@ evas_common_font_draw_init(void)
* and then for kerning we have to switch the order of the kerning query (as the prev
* is on the right, and not on the left).
*/
EAPI void
EAPI Eina_Bool
evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w,
int ext_h, int im_w, int im_h EINA_UNUSED)
@ -35,8 +35,8 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
DATA32 *im;
Evas_Glyph *glyph;
if (!glyphs) return;
if (!glyphs->array) return;
if (!glyphs) return EINA_FALSE;
if (!glyphs->array) return EINA_FALSE;
im = dst->image.data;
@ -88,7 +88,7 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
font_alpha_buffer,
w * sizeof(DATA32));
if (!font_mask_image) return;
if (!font_mask_image) return EINA_FALSE;
# endif
#endif
@ -220,6 +220,8 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
else
break;
}
return EINA_TRUE;
}
void
@ -319,7 +321,7 @@ error:
eina_inarray_free(glyphs);
}
EAPI void
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;
@ -330,7 +332,7 @@ evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, E
int c, cx, cy, cw, ch;
int i;
if (!glyphs) return;
if (!glyphs) return EINA_FALSE;
im_w = dst->cache_entry.w;
im_h = dst->cache_entry.h;
@ -362,15 +364,16 @@ evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, E
if ((ext_y + ext_h) > im_h)
ext_h = im_h - ext_y;
}
if (ext_w <= 0) return;
if (ext_h <= 0) return;
if (ext_w <= 0) return EINA_FALSE;
if (ext_h <= 0) return EINA_FALSE;
cb(dst, dc, x, y, glyphs,
func, ext_x, ext_y, ext_w, ext_h,
im_w, im_h);
return cb(dst, dc, x, y, glyphs,
func, ext_x, ext_y, ext_w, ext_h,
im_w, im_h);
}
else
{
Eina_Bool ret = EINA_FALSE;
c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = dc->clip.h;
evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
/* our clip is 0 size.. abort */
@ -381,12 +384,14 @@ evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, E
{
r = rects->rects + i;
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
cb(dst, dc, x, y, glyphs,
func, r->x, r->y, r->w, r->h,
im_w, im_h);
ret |= cb(dst, dc, x, y, glyphs,
func, r->x, r->y, r->w, r->h,
im_w, im_h);
}
}
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
return ret;
}
}

View File

@ -712,7 +712,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
Cutout_Rect *r;
int c, cx, cy, cw, ch;
int i;
if (src->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
{
#ifdef EVAS_CSERVE2
@ -722,6 +722,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
#endif
evas_cache_image_load_data(&src->cache_entry);
}
evas_common_image_colorspace_normalize(src);
if (!src->image.data) return;
@ -750,13 +751,14 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
}
EAPI void
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;
Cutout_Rect *r;
int c, cx, cy, cw, ch;
int i;
Eina_Bool ret = EINA_FALSE;
if (src->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
{
@ -770,12 +772,11 @@ evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Conte
evas_common_image_colorspace_normalize(src);
if (!src->image.data) return;
if (!src->image.data) return EINA_FALSE;
if ((!dc->cutout.rects) && (!dc->clip.use))
{
cb(src, dst, dc, map, smooth, level, offset);
return;
return cb(src, dst, dc, map, smooth, level, offset);
}
/* save out clip info */
@ -785,7 +786,7 @@ evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Conte
if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
{
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
return;
return EINA_FALSE;
}
rects = evas_common_draw_context_apply_cutouts(dc, rects);
@ -793,11 +794,13 @@ evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Conte
{
r = rects->rects + i;
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
cb(src, dst, dc, map, smooth, level, offset);
ret |= cb(src, dst, dc, map, smooth, level, offset);
}
/* restore clip info */
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
return ret;
}
EAPI void

View File

@ -2,7 +2,7 @@
#define _EVAS_MAP_H
typedef void (*Evas_Common_Map_RGBA_Cb) (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level);
typedef void (*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);
typedef 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);
EAPI void
evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
@ -11,7 +11,7 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
int smooth, int level,
Evas_Common_Map_RGBA_Cb cb);
EAPI void 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);
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);
EAPI void
evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,

View File

@ -31,7 +31,7 @@ evas_common_scale_rgba_in_to_out_clip_prepare(Cutout_Rects *reuse, const RGBA_Im
return EINA_TRUE;
}
EAPI void
EAPI Eina_Bool
evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
@ -44,19 +44,19 @@ evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
Cutout_Rect *r;
int c, cx, cy, cw, ch;
int i;
/* handle cutouts here! */
Eina_Bool ret = EINA_FALSE;
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
/* handle cutouts here! */
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return EINA_FALSE;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
return;
return EINA_FALSE;
/* no cutouts - cut right to the chase */
if (!dc->cutout.rects)
{
cb(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
return;
return cb(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
/* save out clip info */
@ -68,7 +68,7 @@ evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
{
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
return;
return EINA_FALSE;
}
rects = evas_common_draw_context_apply_cutouts(dc, rects);
@ -76,11 +76,13 @@ evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
{
r = rects->rects + i;
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
cb(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
ret |= cb(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
/* restore clip info */
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
return ret;
}

View File

@ -1,11 +1,11 @@
#ifndef _EVAS_SCALE_MAIN_H
#define _EVAS_SCALE_MAIN_H
typedef void (*Evas_Common_Scale_In_To_Out_Clip_Cb)(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
typedef Eina_Bool (*Evas_Common_Scale_In_To_Out_Clip_Cb)(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI void evas_common_scale_init (void);
EAPI void evas_common_scale_rgba_in_to_out_clip_cb (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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, Evas_Common_Scale_In_To_Out_Clip_Cb cb);
EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_cb (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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, Evas_Common_Scale_In_To_Out_Clip_Cb cb);
EAPI void evas_common_scale_rgba_in_to_out_clip_smooth (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI void evas_common_scale_rgba_in_to_out_clip_sample (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);

View File

@ -1,7 +1,7 @@
#include "evas_common.h"
#include "evas_blend_private.h"
static void scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
static Eina_Bool scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI void
evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
@ -242,7 +242,7 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
}
}
static void
static Eina_Bool
scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
@ -260,9 +260,9 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
RGBA_Gfx_Func func;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
return;
return EINA_FALSE;
if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
return;
return EINA_FALSE;
src_w = src->cache_entry.w;
src_h = src->cache_entry.h;
@ -319,7 +319,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
if ((src_region_w <= 0) || (src_region_h <= 0) ||
(dst_region_w <= 0) || (dst_region_h <= 0) ||
(dst_clip_w <= 0) || (dst_clip_h <= 0))
return;
return EINA_FALSE;
/* sanitise x */
if (src_region_x < 0)
@ -329,21 +329,21 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
src_region_w += src_region_x;
src_region_x = 0;
}
if (src_region_x >= src_w) return;
if (src_region_x >= src_w) return EINA_FALSE;
if ((src_region_x + src_region_w) > src_w)
{
dst_region_w = (dst_region_w * (src_w - src_region_x)) / (src_region_w);
src_region_w = src_w - src_region_x;
}
if (dst_region_w <= 0) return;
if (src_region_w <= 0) return;
if (dst_region_w <= 0) return EINA_FALSE;
if (src_region_w <= 0) return EINA_FALSE;
if (dst_clip_x < 0)
{
dst_clip_w += dst_clip_x;
dst_clip_x = 0;
}
if (dst_clip_w <= 0) return;
if (dst_clip_x >= dst_w) return;
if (dst_clip_w <= 0) return EINA_FALSE;
if (dst_clip_x >= dst_w) return EINA_FALSE;
if (dst_clip_x < dst_region_x)
{
dst_clip_w += (dst_clip_x - dst_region_x);
@ -353,7 +353,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
{
dst_clip_w = dst_w - dst_clip_x;
}
if (dst_clip_w <= 0) return;
if (dst_clip_w <= 0) return EINA_FALSE;
/* sanitise y */
if (src_region_y < 0)
@ -363,21 +363,21 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
src_region_h += src_region_y;
src_region_y = 0;
}
if (src_region_y >= src_h) return;
if (src_region_y >= src_h) return EINA_FALSE;
if ((src_region_y + src_region_h) > src_h)
{
dst_region_h = (dst_region_h * (src_h - src_region_y)) / (src_region_h);
src_region_h = src_h - src_region_y;
}
if (dst_region_h <= 0) return;
if (src_region_h <= 0) return;
if (dst_region_h <= 0) return EINA_FALSE;
if (src_region_h <= 0) return EINA_FALSE;
if (dst_clip_y < 0)
{
dst_clip_h += dst_clip_y;
dst_clip_y = 0;
}
if (dst_clip_h <= 0) return;
if (dst_clip_y >= dst_h) return;
if (dst_clip_h <= 0) return EINA_FALSE;
if (dst_clip_y >= dst_h) return EINA_FALSE;
if (dst_clip_y < dst_region_y)
{
dst_clip_h += (dst_clip_y - dst_region_y);
@ -387,7 +387,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
{
dst_clip_h = dst_h - dst_clip_y;
}
if (dst_clip_h <= 0) return;
if (dst_clip_h <= 0) return EINA_FALSE;
/* allocate scale lookup tables */
lin_ptr = alloca(dst_clip_w * sizeof(int));
@ -491,4 +491,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
}
}
}
return EINA_TRUE;
}

View File

@ -103,7 +103,7 @@ scale_calc_a_points(int *p, int s, int d, int c, int cc)
#include "evas_scale_smooth_scaler.c"
#ifdef BUILD_MMX
void
Eina_Bool
evas_common_scale_rgba_in_to_out_clip_smooth_mmx(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
@ -137,10 +137,12 @@ evas_common_scale_rgba_in_to_out_clip_smooth_mmx(RGBA_Image *src, RGBA_Image *ds
mul_col, dc->render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
return EINA_TRUE;
}
#endif
void
Eina_Bool
evas_common_scale_rgba_in_to_out_clip_smooth_c(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
@ -174,6 +176,8 @@ evas_common_scale_rgba_in_to_out_clip_smooth_c(RGBA_Image *src, RGBA_Image *dst,
mul_col, dc->render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
return EINA_TRUE;
}
EAPI void

View File

@ -1,7 +1,7 @@
#ifndef _EVAS_SCALE_SMOOTH_H
#define _EVAS_SCALE_SMOOTH_H
EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_mmx (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_c (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_smooth_mmx (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_smooth_c (RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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);
#endif /* _EVAS_SCALE_SMOOTH_H */

View File

@ -1154,7 +1154,7 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const void *t
}
static void
draw_thread_image_draw(void *data)
_draw_thread_image_draw(void *data)
{
Evas_Thread_Command_Image *image = data;
@ -1176,18 +1176,18 @@ draw_thread_image_draw(void *data)
eina_mempool_free(_mp_command_image, image);
}
static void
static Eina_Bool
_image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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, int smooth)
{
Evas_Thread_Command_Image *cr;
int clip_x, clip_y, clip_w, clip_h;
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return EINA_FALSE;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return EINA_FALSE;
cr = eina_mempool_malloc(_mp_command_image, sizeof (Evas_Thread_Command_Image));
if (!cr) return;
if (!cr) return EINA_FALSE;
cr->image = src;
cr->surface = dst;
@ -1215,27 +1215,29 @@ _image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc,
cr->render_op = dc->render_op;
cr->smooth = smooth;
evas_thread_cmd_enqueue(draw_thread_image_draw, cr);
evas_thread_cmd_enqueue(_draw_thread_image_draw, cr);
return EINA_TRUE;
}
static void
static Eina_Bool
_image_draw_thread_cmd_smooth(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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)
{
_image_draw_thread_cmd
(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1);
return _image_draw_thread_cmd
(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1);
}
static void
static Eina_Bool
_image_draw_thread_cmd_sample(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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)
{
_image_draw_thread_cmd
(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0);
return _image_draw_thread_cmd
(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0);
}
static Eina_Bool
@ -1263,19 +1265,17 @@ eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image
evas_common_image_colorspace_normalize(im);
if (smooth)
evas_common_scale_rgba_in_to_out_clip_cb
(image, surface, context,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h,
_image_draw_thread_cmd_smooth);
return evas_common_scale_rgba_in_to_out_clip_cb
(image, surface, context,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h,
_image_draw_thread_cmd_smooth);
else
evas_common_scale_rgba_in_to_out_clip_cb
(image, surface, context,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h,
_image_draw_thread_cmd_sample);
return EINA_TRUE;
return evas_common_scale_rgba_in_to_out_clip_cb
(image, surface, context,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h,
_image_draw_thread_cmd_sample);
}
#ifdef BUILD_PIPE_RENDER
else if ((cpunum > 1))
@ -1390,22 +1390,24 @@ _map_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
static void
static Eina_Bool
_map_image_sample_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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)
{
_map_image_draw(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0);
return EINA_TRUE;
}
static void
static Eina_Bool
_map_image_smooth_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, 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)
{
_map_image_draw(src, dst, dc,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1);
return EINA_TRUE;
}
static void
@ -1476,14 +1478,14 @@ _draw_thread_map_draw(void *data)
eina_mempool_free(_mp_command_map, map);
}
static void
static Eina_Bool
_map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map *map, int smooth, int level, int offset)
{
Evas_Thread_Command_Map *cm;
int clip_x, clip_y, clip_w, clip_h;
cm = eina_mempool_malloc(_mp_command_map, sizeof (Evas_Thread_Command_Map));
if (!cm) return;
if (!cm) return EINA_FALSE;
cm->image = src;
memcpy(&cm->image_ctx, dc, sizeof(*dc));
@ -1525,6 +1527,8 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RG
cm->offset = offset;
evas_thread_cmd_enqueue(_draw_thread_map_draw, cm);
return EINA_TRUE;
}
static void
@ -1611,11 +1615,9 @@ eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_M
if (!im->cache_entry.flags.loaded) return EINA_FALSE;
}
evas_common_map_thread_rgba_cb(im, surface, context,
m, smooth, level, 0,
_map_draw_thread_cmd);
return EINA_TRUE;
return evas_common_map_thread_rgba_cb(im, surface, context,
m, smooth, level, 0,
_map_draw_thread_cmd);
}
else
evas_software_image_map_draw(data, context, surface, im, m,
@ -1934,13 +1936,13 @@ _draw_thread_font_draw(void *data)
eina_mempool_free(_mp_command_font, font);
}
static void
static Eina_Bool
_font_draw_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h)
{
Evas_Thread_Command_Font *cf;
cf = eina_mempool_malloc(_mp_command_font, sizeof (Evas_Thread_Command_Font));
if (!cf) return ;
if (!cf) return EINA_FALSE;
cf->dst = dst;
cf->x = x;
@ -1960,6 +1962,8 @@ _font_draw_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas
cf->im_h = im_h;
evas_thread_cmd_enqueue(_draw_thread_font_draw, cf);
return EINA_TRUE;
}
static Eina_Bool
@ -1970,9 +1974,8 @@ eng_font_draw(void *data EINA_UNUSED, void *context, void *surface, Evas_Font_Se
evas_common_font_draw_prepare(text_props);
if (!text_props->glyphs) return EINA_FALSE;
evas_common_font_draw_cb(surface, context, x, y, text_props->glyphs,
_font_draw_thread_cmd);
return EINA_TRUE;
return evas_common_font_draw_cb(surface, context, x, y, text_props->glyphs,
_font_draw_thread_cmd);
}
#ifdef BUILD_PIPE_RENDER
else if ((cpunum > 1))