From f2784b18c030b27de68804ad0b6343f9cecd7b14 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 11 Jun 2021 12:21:56 +0900 Subject: [PATCH] evas vector: do not redraw the canvas if the both cache tree & user tree are valid. previous logic has a potential issue that cache tree drawing result is erased if the user tree is valid. To fix this, tvg canvas must draw once after update both trees. Change-Id: I59405d17b22cc587b69d268dbc86ab525f626905 --- src/lib/evas/canvas/efl_canvas_vg_object.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 4393499..761b7eb 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -417,16 +417,13 @@ _efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data *pd } static void -_render_to_tvg_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_VG *root) +_update_scene(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_VG *root) { if (!efl_isa(root, EFL_CANVAS_VG_GRADIENT_CLASS)) { Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(root, EFL_CANVAS_VG_NODE_CLASS); if (nd) nd->render_pre(obj, root, nd, NULL, pd->tvg_canvas, NULL); } - - if (tvg_canvas_draw(pd->tvg_canvas) == TVG_RESULT_SUCCESS) - tvg_canvas_sync(pd->tvg_canvas); } static void @@ -514,17 +511,23 @@ _efl_canvas_vg_object_render(Evas_Object *eo_obj EINA_UNUSED, Efl_VG *root = evas_cache_vg_tree_get(pd->vg_entry, pd->frame_idx); if (!root) return; - if (updated) _render_to_tvg_buffer(obj, pd, root); + if (updated) _update_scene(obj, pd, root); } - if (pd->user_entry && updated) _render_to_tvg_buffer(obj, pd, pd->user_entry->root); + if (pd->user_entry && updated) _update_scene(obj, pd, pd->user_entry->root); + + //Render the vector canvas + if (updated) + { + if (tvg_canvas_draw(pd->tvg_canvas) == TVG_RESULT_SUCCESS) + tvg_canvas_sync(pd->tvg_canvas); + tvg_canvas_clear(pd->tvg_canvas, EINA_FALSE); + } _render_tvg_buffer_to_screen(obj, pd, engine, output, context, surface, obj->cur->geometry.x + x, obj->cur->geometry.y + y, do_async); - - tvg_canvas_clear(pd->tvg_canvas, EINA_FALSE); pd->changed = EINA_FALSE; } -- 2.7.4