}
static void
+eng_context_mask_set(void *data __UNUSED__, void *context, void *mask, int x, int y, int w, int h)
+{
+ evas_common_draw_context_set_mask(context, mask, x, y, w, h);
+}
+
+static void
+eng_context_mask_unset(void *data __UNUSED__, void *context)
+{
+ evas_common_draw_context_unset_mask(context);
+}
+
+static void *
+eng_context_mask_get(void *data __UNUSED__, void *context)
+{
+ return ((RGBA_Draw_Context *)context)->mask.mask;
+}
+
+static void
eng_context_cutout_add(void *data __UNUSED__, void *context, int x, int y, int w, int h)
{
evas_common_draw_context_add_cutout(context, x, y, w, h);
return im->space;
}
+static void
+eng_image_mask_create(void *data __UNUSED__, void *image)
+{
+ RGBA_Image *im;
+ int sz;
+ uint8_t *dst,*end;
+ uint32_t *src;
+
+ if (!image) return;
+ im = image;
+ if (im->mask.mask && !im->mask.dirty) return;
+
+ if (im->mask.mask) free(im->mask.mask);
+ sz = im->cache_entry.w * im->cache_entry.h;
+ im->mask.mask = malloc(sz);
+ dst = im->mask.mask;
+ if (!im->image.data)
+ evas_cache_image_load_data(&im->cache_entry);
+ src = im->image.data;
+ for (end = dst + sz ; dst < end ; dst ++, src ++)
+ *dst = *src >> 24;
+ im->mask.dirty = 0;
+}
+
+
static void *
eng_image_alpha_set(void *data __UNUSED__, void *image, int has_alpha)
{
if (!im->cs.no_free) free(im->cs.data);
}
im->cs.data = image_data;
- evas_common_image_colorspace_dirty(im);
}
break;
default:
#endif
)
{
- evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im),
+ evas_common_rgba_image_scalecache_prepare((Image_Entry *)(im),
surface, context, smooth,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h);
-
+
evas_common_pipe_image_draw(im, surface, context, smooth,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h);
evas_common_rgba_image_scalecache_do(&im->cache_entry, surface, context, smooth,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h);
-/*
+/*
if (smooth)
evas_common_scale_rgba_in_to_out_clip_smooth(im, surface, context,
src_x, src_y, src_w, src_h,
}
static void
-eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
+eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level)
{
- RGBA_Image *im, *srf;
-// RGBA_Map_Point *pt = p;
+ RGBA_Image *im;
if (!image) return;
+ if (npoints < 3) return;
im = image;
- srf = surface;
+
if ((p[0].x == p[3].x) &&
(p[1].x == p[2].x) &&
(p[0].y == p[1].y) &&
(p[0].y <= p[2].y) &&
(p[0].u == 0) &&
(p[0].v == 0) &&
- (p[1].u == (im->cache_entry.w << FP)) &&
+ (p[1].u == (int)(im->cache_entry.w << FP)) &&
(p[1].v == 0) &&
- (p[2].u == (im->cache_entry.w << FP)) &&
- (p[2].v == (im->cache_entry.h << FP)) &&
+ (p[2].u == (int)(im->cache_entry.w << FP)) &&
+ (p[2].v == (int)(im->cache_entry.h << FP)) &&
(p[3].u == 0) &&
- (p[3].v == (im->cache_entry.h << FP)) &&
+ (p[3].v == (int)(im->cache_entry.h << FP)) &&
(p[0].col == 0xffffffff) &&
(p[1].col == 0xffffffff) &&
(p[2].col == 0xffffffff) &&
&& evas_common_frameq_enabled()
# endif
)
- evas_common_pipe_map4_draw(im, surface, context, p, smooth, level);
+ evas_common_pipe_map_draw(im, surface, context, npoints, p, smooth, level);
else
#endif
- evas_common_map4_rgba(im, surface, context, p, smooth, level);
+ evas_common_map_rgba(im, surface, context, npoints, p, smooth, level);
}
evas_common_cpu_end_opt();
+
+ if (npoints > 4)
+ {
+ eng_image_map_draw(data, context, surface, image, npoints - 2, p + 2,
+ smooth, level);
+ }
}
static void *
eng_context_clip_clip,
eng_context_clip_unset,
eng_context_clip_get,
+ eng_context_mask_set,
+ eng_context_mask_unset,
eng_context_color_set,
eng_context_color_get,
eng_context_multiplier_set,
eng_image_format_get,
eng_image_colorspace_set,
eng_image_colorspace_get,
+ eng_image_mask_create,
eng_image_native_set,
eng_image_native_get,
/* image cache funcs */
/* more font draw functions */
eng_font_last_up_to_pos,
/* FUTURE software generic calls go here (done) */
- eng_image_map4_draw,
+ eng_image_map_draw,
eng_image_map_surface_new,
eng_image_map_surface_free,
- NULL, // eng_image_content_hint_set - software doesnt use it
- NULL // eng_image_content_hint_get - software doesnt use it
+ NULL, // eng_image_content_hint_set - software doesn't use it
+ NULL // eng_image_content_hint_get - software doesn't use it
/* FUTURE software generic calls go here */
};
module_open(Evas_Module *em)
{
if (!em) return 0;
- _evas_soft_gen_log_dom = eina_log_domain_register("EvasSoftGeneric", EVAS_DEFAULT_LOG_COLOR);
+ _evas_soft_gen_log_dom = eina_log_domain_register
+ ("evas-software_generic", EVAS_DEFAULT_LOG_COLOR);
if(_evas_soft_gen_log_dom<0)
{
- EINA_LOG_ERR("Evas SoftGen : Impossible to create a log domain for the software generic engine.\n");
- return 0;
+ EINA_LOG_ERR("Can not create a module log domain.");
+ return 0;
}
em->functions = (void *)(&func);
cpunum = eina_cpu_count();
}
static void
-module_close(Evas_Module *em)
+module_close(Evas_Module *em __UNUSED__)
{
eina_log_domain_unregister(_evas_soft_gen_log_dom);
}