From c642d2d97171aa8301fc16911e998beec3d6c29e Mon Sep 17 00:00:00 2001 From: Michal Szczecinski Date: Tue, 30 Mar 2021 14:02:22 +0200 Subject: [PATCH] evas vg: Enabled composition for containers. Use tvg_paint_set_composite_method() for scenes. Currently because of other issues only MATTE_ALPHA method is supported. Change-Id: I2f42d28e5ae71ebd56c4c3057287461d0ad80e34 --- src/lib/evas/canvas/efl_canvas_vg_container.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index 53e41ec..5f4f36c 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -186,6 +186,14 @@ _efl_canvas_vg_container_render_pre_tvg(Evas_Object_Protected_Data *obj, cnd->render_pre_tvg(obj, child, cnd, cTransform, canvas, cd->scene); } + //We don't want to push composition sources + //FIX_TVG: when thorvg will be default, Vg_Comp structure with additional buffer and pixels + //will be removed. Then we can use only one boolean to verify if render_pre is called for + //composite object + + //FIX_TVG: or maybe we can avoid to call render_pre for composite objects? + if (cd->comp.src) return; + if (scene) tvg_scene_push(scene, cd->scene); else if (canvas) tvg_canvas_push(canvas, cd->scene); } @@ -479,6 +487,11 @@ _efl_canvas_vg_container_efl_canvas_vg_node_comp_method_set(Eo *obj, { Efl_Canvas_Vg_Container_Data *pd2 = efl_data_scope_get(target, MY_CLASS); pd2->comp.src = eina_list_append(pd2->comp.src, obj); +#ifdef HAVE_THORVG + //FIX_TVG: currently only matte alpha is supported. Observed crash in thorvg when CLIP_PATH method is used. + if (method == EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA) + tvg_paint_set_composite_method(pd->scene, pd2->scene, TVG_COMPOSITE_METHOD_ALPHA_MASK); +#endif } pd->comp.method = method; -- 2.7.4