}
}
+//TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+/* This function checks if there is only one image object, and returns it */
+static Eina_Bool
+_map_source_image_get(Evas_Object *eo_obj, Evas_Object **src_img)
+{
+ Eina_Bool ret;
+ Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj2;
+
+ if (obj->is_image_object)
+ {
+ if (*src_img)
+ {
+ /* more than one image object */
+ *src_img = NULL;
+ return EINA_FALSE;
+ }
+ *src_img = obj->object;
+ }
+ else if (obj->is_smart)
+ {
+ EINA_INLIST_FOREACH
+ (evas_object_smart_members_get_direct(eo_obj), obj2)
+ {
+ ret = _map_source_image_get(obj2->object, src_img);
+ if (!ret) return ret;
+ }
+ }
+
+ return EINA_TRUE;
+}
+
+static void
+_map_direct_render(Evas_Public_Data *evas, void *ctx, Evas_Object *src_img,
+ int w, int h, Evas_Object_Protected_Data *obj,
+ void *output, void *surface, int off_x, int off_y,
+ Eina_Bool do_async)
+{
+ int i;
+ Evas_Map_Point points[4];
+ Evas_Map_Point *p;
+
+ Evas_Object_Protected_Data *src_img_pd = efl_data_scope_get(src_img, EFL_CANVAS_OBJECT_CLASS);
+ const Evas_Object_Map_Data *tmap = src_img_pd->map;
+
+ src_img_pd->map = obj->map;
+
+ for (i = 0; i < obj->map->cur.map->count; i++)
+ {
+ p = obj->map->cur.map->points + i;
+ points[i].u = p->u;
+ points[i].v = p->v;
+ switch (i)
+ {
+ case 0:
+ p->u = 0;
+ p->v = 0;
+ break;
+ case 1:
+ p->u = w;
+ p->v = 0;
+ break;
+ case 2:
+ p->u = w;
+ p->v = h;
+ break;
+ case 3:
+ p->u = 0;
+ p->v = h;
+ break;
+ default:
+ break;
+ }
+ }
+
+ src_img_pd->func->render(src_img, src_img_pd, src_img_pd->private_data,
+ ENC, output, ctx, surface,
+ off_x, off_y, do_async);
+
+ for (i = 0; i < obj->map->cur.map->count; i++)
+ {
+ p = obj->map->cur.map->points + i;
+ p->u = points[i].u;
+ p->v = points[i].v;
+ }
+
+ src_img_pd->map = tmap;
+}
+//
+
Eina_Bool
evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj, void *context,
int sw, sh;
Eina_Bool changed = EINA_FALSE, rendered = EINA_FALSE, pchanged = EINA_FALSE;
+ //TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+ int src_img_w = 0;
+ int src_img_h = 0;
+ Evas_Object *direct_render_src_img = NULL;
+ if (obj->map->cur.map->direct_render && obj->map->cur.map->count == 4)
+ {
+ _map_source_image_get(eo_obj, &direct_render_src_img);
+ if (direct_render_src_img)
+ {
+ evas_object_image_size_get(direct_render_src_img,
+ &src_img_w, &src_img_h);
+ if (src_img_w == 0 || src_img_h == 0)
+ {
+ direct_render_src_img = NULL;
+ }
+ else
+ {
+ /* direct render will work, surface is not necessary */
+ if (obj->map->surface)
+ {
+ ENFN->image_free(ENC, obj->map->surface);
+ EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
+ map_write->surface = NULL;
+ EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
+ }
+ }
+ }
+ }
+ //
+
clean_them = EINA_TRUE;
sw = obj->cur->geometry.w;
EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
}
}
+ //TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+ /*
if (!obj->map->surface)
+ */
+ if (!obj->map->surface && !direct_render_src_img)
+ //
{
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
{
ENFN->context_clip_unset(ENC, ctx);
//ENFN->context_multiplier_unset(ENC, ctx); // this probably should be here, too
+ //TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+ /*
if (obj->map->surface)
+ */
+ if (obj->map->surface || direct_render_src_img)
+ //
{
Evas_Object_Protected_Data *mask = obj->clip.mask;
_c = ENFN->context_clip_get(ENC, ctx, &_cx, &_cy, &_cw, &_ch);
RD(level, " draw image map(clip: [%d] %d,%d %dx%d)\n", _c, _cx, _cy, _cw, _ch);
#endif
+
+ //TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+ if (direct_render_src_img)
+ {
+ _map_direct_render(evas, ctx, direct_render_src_img,
+ src_img_w, src_img_h, obj, output,
+ surface, off_x, off_y, do_async);
+ }
+ else
+ {
+ //
evas_draw_image_map_async_check
(obj, ENC, output, ctx, surface,
obj->map->surface, obj->map->spans,
obj->map->cur.map->smooth, 0, do_async);
+ //TIZEN_ONLY(20210503): Add evas_map_direct_render_set
+ }
+ //
}
}