forked from enlightenment/efl
evas/async_render: use image scalecache
SVN revision: 82890
This commit is contained in:
parent
73667b025c
commit
09f342fdeb
|
@ -55,6 +55,15 @@ EAPI void
|
||||||
int src_region_w, int src_region_h,
|
int src_region_w, int src_region_h,
|
||||||
int dst_region_x, int dst_region_y,
|
int dst_region_x, int dst_region_y,
|
||||||
int dst_region_w, int dst_region_h);
|
int dst_region_w, int dst_region_h);
|
||||||
|
EAPI Eina_Bool
|
||||||
|
evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
|
||||||
|
RGBA_Draw_Context *dc, int smooth,
|
||||||
|
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_sample,
|
||||||
|
Evas_Common_Scale_In_To_Out_Clip_Cb cb_smooth);
|
||||||
|
|
||||||
|
|
||||||
EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
|
EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
|
||||||
|
|
|
@ -495,19 +495,22 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
|
||||||
//static int noscales = 0;
|
//static int noscales = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
|
||||||
RGBA_Draw_Context *dc, int smooth,
|
RGBA_Draw_Context *dc, int smooth,
|
||||||
int src_region_x, int src_region_y,
|
int src_region_x, int src_region_y,
|
||||||
int src_region_w, int src_region_h,
|
int src_region_w, int src_region_h,
|
||||||
int dst_region_x, int dst_region_y,
|
int dst_region_x, int dst_region_y,
|
||||||
int dst_region_w, int dst_region_h)
|
int dst_region_w, int dst_region_h,
|
||||||
|
Evas_Common_Scale_In_To_Out_Clip_Cb cb_sample,
|
||||||
|
Evas_Common_Scale_In_To_Out_Clip_Cb cb_smooth)
|
||||||
{
|
{
|
||||||
#ifdef SCALECACHE
|
#ifdef SCALECACHE
|
||||||
RGBA_Image *im = (RGBA_Image *)ie;
|
RGBA_Image *im = (RGBA_Image *)ie;
|
||||||
Scaleitem *sci;
|
Scaleitem *sci;
|
||||||
int didpop = 0;
|
int didpop = 0;
|
||||||
int dounload = 0;
|
int dounload = 0;
|
||||||
|
Eina_Bool ret = EINA_FALSE;
|
||||||
/*
|
/*
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
|
|
||||||
|
@ -520,7 +523,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if ((dst_region_w == 0) || (dst_region_h == 0) ||
|
if ((dst_region_w == 0) || (dst_region_h == 0) ||
|
||||||
(src_region_w == 0) || (src_region_h == 0)) return;
|
(src_region_w == 0) || (src_region_h == 0)) return EINA_FALSE;
|
||||||
LKL(im->cache.lock);
|
LKL(im->cache.lock);
|
||||||
if ((src_region_w == dst_region_w) && (src_region_h == dst_region_h))
|
if ((src_region_w == dst_region_w) && (src_region_h == dst_region_h))
|
||||||
{
|
{
|
||||||
|
@ -539,13 +542,13 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
LKU(im->cache.lock);
|
LKU(im->cache.lock);
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
|
return cb_sample(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
}
|
}
|
||||||
return;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
LKL(cache_lock);
|
LKL(cache_lock);
|
||||||
sci = _sci_find(im, dc, smooth,
|
sci = _sci_find(im, dc, smooth,
|
||||||
|
@ -570,19 +573,19 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
if (smooth)
|
if (smooth)
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
|
return cb_smooth(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
else
|
else
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
|
return cb_sample(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
}
|
}
|
||||||
return;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
if (sci->populate_me)
|
if (sci->populate_me)
|
||||||
{
|
{
|
||||||
|
@ -658,19 +661,17 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
if (smooth)
|
if (smooth)
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth
|
ret = cb_smooth(im, sci->im, ct,
|
||||||
(im, sci->im, ct,
|
src_region_x, src_region_y,
|
||||||
src_region_x, src_region_y,
|
src_region_w, src_region_h,
|
||||||
src_region_w, src_region_h,
|
0, 0,
|
||||||
0, 0,
|
dst_region_w, dst_region_h);
|
||||||
dst_region_w, dst_region_h);
|
|
||||||
else
|
else
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample
|
ret = cb_sample(im, sci->im, ct,
|
||||||
(im, sci->im, ct,
|
src_region_x, src_region_y,
|
||||||
src_region_x, src_region_y,
|
src_region_w, src_region_h,
|
||||||
src_region_w, src_region_h,
|
0, 0,
|
||||||
0, 0,
|
dst_region_w, dst_region_h);
|
||||||
dst_region_w, dst_region_h);
|
|
||||||
sci->populate_me = 0;
|
sci->populate_me = 0;
|
||||||
#if 0 // visual debug of cached images
|
#if 0 // visual debug of cached images
|
||||||
{
|
{
|
||||||
|
@ -690,7 +691,7 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(xx & 0x1)) *pp = 0x882288ff;
|
if (!(xx & 0x1)) *pp = 0x882288ff;
|
||||||
}
|
}
|
||||||
pp++;
|
pp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -730,12 +731,11 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
}
|
}
|
||||||
// INF("use cached!");
|
// INF("use cached!");
|
||||||
LKU(im->cache.lock);
|
LKU(im->cache.lock);
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample
|
ret |= cb_sample(sci->im, dst, dc,
|
||||||
(sci->im, dst, dc,
|
0, 0,
|
||||||
0, 0,
|
dst_region_w, dst_region_h,
|
||||||
dst_region_w, dst_region_h,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_w, dst_region_h);
|
||||||
dst_region_w, dst_region_h);
|
|
||||||
// hits++;
|
// hits++;
|
||||||
// INF("check %p %i < %i",
|
// INF("check %p %i < %i",
|
||||||
// im,
|
// im,
|
||||||
|
@ -793,21 +793,26 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
if (smooth)
|
if (smooth)
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
|
ret |= cb_smooth(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
else
|
else
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
|
ret |= cb_sample(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
RGBA_Image *im = (RGBA_Image *)ie;
|
RGBA_Image *im = (RGBA_Image *)ie;
|
||||||
|
|
||||||
if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
|
if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_CSERVE2
|
#ifdef EVAS_CSERVE2
|
||||||
|
@ -821,17 +826,36 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
if (smooth)
|
if (smooth)
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth(im, dst, dc,
|
return cb_smooth(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
else
|
else
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample(im, dst, dc,
|
return cb_sample(im, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h);
|
dst_region_w, dst_region_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return EINA_FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
|
RGBA_Draw_Context *dc, int smooth,
|
||||||
|
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_rgba_image_scalecache_do_cbs(
|
||||||
|
ie, dst, dc, smooth,
|
||||||
|
src_region_x, src_region_y, src_region_w, src_region_h,
|
||||||
|
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
||||||
|
evas_common_scale_rgba_in_to_out_clip_sample,
|
||||||
|
evas_common_scale_rgba_in_to_out_clip_smooth);
|
||||||
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ typedef Eina_Bool (*Evas_Common_Scale_In_To_Out_Clip_Cb)(RGBA_Image *src, RGBA_I
|
||||||
EAPI void evas_common_scale_init (void);
|
EAPI void evas_common_scale_init (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, 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 Eina_Bool 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);
|
EAPI Eina_Bool 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);
|
||||||
|
|
||||||
EAPI void evas_common_rgba_image_scalecache_dump(void);
|
EAPI void evas_common_rgba_image_scalecache_dump(void);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
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);
|
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
|
EAPI Eina_Bool
|
||||||
evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
||||||
RGBA_Draw_Context *dc,
|
RGBA_Draw_Context *dc,
|
||||||
int src_region_x, int src_region_y,
|
int src_region_x, int src_region_y,
|
||||||
|
@ -11,7 +11,7 @@ evas_common_scale_rgba_in_to_out_clip_sample(RGBA_Image *src, RGBA_Image *dst,
|
||||||
int dst_region_x, int dst_region_y,
|
int dst_region_x, int dst_region_y,
|
||||||
int dst_region_w, int dst_region_h)
|
int dst_region_w, int dst_region_h)
|
||||||
{
|
{
|
||||||
evas_common_scale_rgba_in_to_out_clip_cb
|
return evas_common_scale_rgba_in_to_out_clip_cb
|
||||||
(src, dst, dc,
|
(src, dst, dc,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
src_region_x, src_region_y, src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
||||||
|
|
|
@ -180,7 +180,7 @@ evas_common_scale_rgba_in_to_out_clip_smooth_c(RGBA_Image *src, RGBA_Image *dst,
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
||||||
RGBA_Draw_Context *dc,
|
RGBA_Draw_Context *dc,
|
||||||
int src_region_x, int src_region_y,
|
int src_region_x, int src_region_y,
|
||||||
|
@ -199,12 +199,12 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
|
||||||
#endif
|
#endif
|
||||||
cb = evas_common_scale_rgba_in_to_out_clip_smooth_c;
|
cb = evas_common_scale_rgba_in_to_out_clip_smooth_c;
|
||||||
|
|
||||||
evas_common_scale_rgba_in_to_out_clip_cb(src, dst, dc,
|
return evas_common_scale_rgba_in_to_out_clip_cb(src, dst, dc,
|
||||||
src_region_x, src_region_y,
|
src_region_x, src_region_y,
|
||||||
src_region_w, src_region_h,
|
src_region_w, src_region_h,
|
||||||
dst_region_x, dst_region_y,
|
dst_region_x, dst_region_y,
|
||||||
dst_region_w, dst_region_h,
|
dst_region_w, dst_region_h,
|
||||||
cb);
|
cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
|
@ -1187,13 +1187,13 @@ _draw_thread_image_draw(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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)
|
_image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
|
||||||
{
|
{
|
||||||
Evas_Thread_Command_Image *cr;
|
Evas_Thread_Command_Image *cr;
|
||||||
int clip_x, clip_y, clip_w, clip_h;
|
int clip_x, clip_y, clip_w, clip_h;
|
||||||
|
|
||||||
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return EINA_FALSE;
|
if ((dst_w <= 0) || (dst_h <= 0)) return EINA_FALSE;
|
||||||
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
if (!(RECTS_INTERSECT(dst_x, dst_y, dst_w, dst_h,
|
||||||
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return EINA_FALSE;
|
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));
|
cr = eina_mempool_malloc(_mp_command_image, sizeof (Evas_Thread_Command_Image));
|
||||||
|
@ -1201,8 +1201,8 @@ _image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||||
|
|
||||||
cr->image = src;
|
cr->image = src;
|
||||||
cr->surface = dst;
|
cr->surface = dst;
|
||||||
EINA_RECTANGLE_SET(&cr->src, src_region_x, src_region_y, src_region_w, src_region_h);
|
EINA_RECTANGLE_SET(&cr->src, src_x, src_y, src_w, src_h);
|
||||||
EINA_RECTANGLE_SET(&cr->dst, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
|
EINA_RECTANGLE_SET(&cr->dst, dst_x, dst_y, dst_w, dst_h);
|
||||||
|
|
||||||
if (dc->clip.use)
|
if (dc->clip.use)
|
||||||
{
|
{
|
||||||
|
@ -1231,23 +1231,39 @@ _image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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_smooth(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
{
|
{
|
||||||
return _image_draw_thread_cmd
|
return _image_draw_thread_cmd(src, dst, dc,
|
||||||
(src, dst, dc,
|
src_x, src_y, src_w, src_h,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
dst_x, dst_y, dst_w, dst_h,
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
1);
|
||||||
1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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_sample(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
{
|
{
|
||||||
return _image_draw_thread_cmd
|
return _image_draw_thread_cmd(src, dst, dc,
|
||||||
(src, dst, dc,
|
src_x, src_y, src_w, src_h,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
dst_x, dst_y, dst_w, dst_h,
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
0);
|
||||||
0);
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_image_thr_cb_smooth(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
|
{
|
||||||
|
return evas_common_scale_rgba_in_to_out_clip_cb(src, dst, dc,
|
||||||
|
src_x, src_y, src_w, src_h,
|
||||||
|
dst_x, dst_y, dst_w, dst_h,
|
||||||
|
_image_draw_thread_cmd_smooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_image_thr_cb_sample(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
|
{
|
||||||
|
return evas_common_scale_rgba_in_to_out_clip_cb(src, dst, dc,
|
||||||
|
src_x, src_y, src_w, src_h,
|
||||||
|
dst_x, dst_y, dst_w, dst_h,
|
||||||
|
_image_draw_thread_cmd_sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -1272,20 +1288,16 @@ eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image
|
||||||
if (!im->cache_entry.flags.loaded) return EINA_FALSE;
|
if (!im->cache_entry.flags.loaded) return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_common_image_colorspace_normalize(im);
|
evas_common_rgba_image_scalecache_prepare(image, surface, context, smooth,
|
||||||
|
src_x, src_y, src_w, src_h,
|
||||||
|
dst_x, dst_y, dst_w, dst_h);
|
||||||
|
|
||||||
if (smooth)
|
return evas_common_rgba_image_scalecache_do_cbs(image, surface,
|
||||||
return evas_common_scale_rgba_in_to_out_clip_cb
|
context, smooth,
|
||||||
(image, surface, context,
|
src_x, src_y, src_w, src_h,
|
||||||
src_x, src_y, src_w, src_h,
|
dst_x, dst_y, dst_w, dst_h,
|
||||||
dst_x, dst_y, dst_w, dst_h,
|
_image_thr_cb_sample,
|
||||||
_image_draw_thread_cmd_smooth);
|
_image_thr_cb_smooth);
|
||||||
else
|
|
||||||
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
|
#ifdef BUILD_PIPE_RENDER
|
||||||
else if ((cpunum > 1))
|
else if ((cpunum > 1))
|
||||||
|
@ -1359,13 +1371,13 @@ image_loaded:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_map_image_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, int smooth)
|
_map_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
|
||||||
{
|
{
|
||||||
int clip_x, clip_y, clip_w, clip_h;
|
int clip_x, clip_y, clip_w, clip_h;
|
||||||
DATA32 mul_col;
|
DATA32 mul_col;
|
||||||
|
|
||||||
if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
|
if ((dst_w <= 0) || (dst_h <= 0)) return;
|
||||||
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
if (!(RECTS_INTERSECT(dst_x, dst_y, dst_w, dst_h,
|
||||||
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
|
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
|
||||||
|
|
||||||
if (dc->clip.use)
|
if (dc->clip.use)
|
||||||
|
@ -1385,38 +1397,34 @@ _map_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src
|
||||||
mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
|
mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
|
||||||
|
|
||||||
if (smooth)
|
if (smooth)
|
||||||
evas_common_scale_rgba_smooth_draw
|
evas_common_scale_rgba_smooth_draw(src, dst,
|
||||||
(src, dst,
|
clip_x, clip_y, clip_w, clip_h,
|
||||||
clip_x, clip_y, clip_w, clip_h,
|
mul_col, dc->render_op,
|
||||||
mul_col, dc->render_op,
|
src_x, src_y, src_w, src_h,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
dst_x, dst_y, dst_w, dst_h);
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
|
|
||||||
else
|
else
|
||||||
evas_common_scale_rgba_sample_draw
|
evas_common_scale_rgba_sample_draw(src, dst,
|
||||||
(src, dst,
|
clip_x, clip_y, clip_w, clip_h,
|
||||||
clip_x, clip_y, clip_w, clip_h,
|
mul_col, dc->render_op,
|
||||||
mul_col, dc->render_op,
|
src_x, src_y, src_w, src_h,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
dst_x, dst_y, dst_w, dst_h);
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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_sample_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
{
|
{
|
||||||
_map_image_draw(src, dst, dc,
|
_map_image_draw(src, dst, dc,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
src_x, src_y, src_w, src_h,
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
dst_x, dst_y, dst_w, dst_h, 0);
|
||||||
0);
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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_smooth_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h)
|
||||||
{
|
{
|
||||||
_map_image_draw(src, dst, dc,
|
_map_image_draw(src, dst, dc,
|
||||||
src_region_x, src_region_y, src_region_w, src_region_h,
|
src_x, src_y, src_w, src_h,
|
||||||
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
|
dst_x, dst_y, dst_w, dst_h, 1);
|
||||||
1);
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1484,7 +1492,7 @@ _draw_thread_map_draw(void *data)
|
||||||
while ((m->count > 4) && (m->count - offset >= 3));
|
while ((m->count > 4) && (m->count - offset >= 3));
|
||||||
|
|
||||||
free_out:
|
free_out:
|
||||||
free(m); // FIXME: allocating and destroying map do have perf impact... ref counting would be better
|
free(m);
|
||||||
eina_mempool_free(_mp_command_map, map);
|
eina_mempool_free(_mp_command_map, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue