forked from enlightenment/efl
evas vg: code refactoring.
No logic changes. I know this is not a good case in alpha freeze. but code was too dirty, need more polishing.
This commit is contained in:
parent
e680ff7426
commit
dc729e8ece
|
@ -173,15 +173,13 @@ _efl_canvas_vg_object_root_node_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_
|
|||
// set the parent so that vg canvas can render it.
|
||||
efl_parent_set(pd->user_entry->root, pd->root);
|
||||
}
|
||||
else
|
||||
else if (pd->user_entry)
|
||||
{
|
||||
if (pd->user_entry)
|
||||
{
|
||||
// drop any surface cache attached to it.
|
||||
Evas_Object_Protected_Data *eobj = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
eobj->layer->evas->engine.func->ector_surface_cache_drop(_evas_engine_context(eobj->layer->evas), pd->user_entry);
|
||||
free(pd->user_entry);
|
||||
}
|
||||
// drop any surface cache attached to it.
|
||||
Evas_Object_Protected_Data *eobj = efl_data_scope_get(obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
eobj->layer->evas->engine.func->ector_surface_cache_drop(_evas_engine_context(eobj->layer->evas),
|
||||
pd->user_entry);
|
||||
free(pd->user_entry);
|
||||
pd->user_entry = NULL;
|
||||
}
|
||||
|
||||
|
@ -389,11 +387,8 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *vd,
|
|||
else
|
||||
{
|
||||
Efl_Canvas_Vg_Node_Data *nd;
|
||||
|
||||
nd = efl_data_scope_get(n, EFL_CANVAS_VG_NODE_CLASS);
|
||||
|
||||
obj->layer->evas->engine.func->ector_renderer_draw(engine, output, context, surface, nd->renderer, clips, do_async);
|
||||
|
||||
if (do_async)
|
||||
eina_array_push(&vd->cleanup, efl_ref(nd->renderer));
|
||||
}
|
||||
|
@ -444,6 +439,7 @@ _render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *vd
|
|||
context, surface,
|
||||
root, NULL,
|
||||
do_async);
|
||||
|
||||
obj->layer->evas->engine.func->image_dirty_region(engine, buffer, 0, 0, 0, 0);
|
||||
obj->layer->evas->engine.func->ector_end(engine, buffer,
|
||||
context, surface,
|
||||
|
|
|
@ -212,31 +212,17 @@ _efl_canvas_vg_node_parent_checked_get(Eo *obj,
|
|||
*parent = efl_parent_get(obj);
|
||||
|
||||
if (efl_isa(*parent, EFL_CANVAS_VG_CONTAINER_CLASS))
|
||||
{
|
||||
*cd = efl_data_scope_get(*parent, EFL_CANVAS_VG_CONTAINER_CLASS);
|
||||
if (!*cd)
|
||||
{
|
||||
ERR("Can't get EFL_CANVAS_VG_CONTAINER_CLASS data.");
|
||||
goto on_error;
|
||||
}
|
||||
}
|
||||
*cd = efl_data_scope_get(*parent, EFL_CANVAS_VG_CONTAINER_CLASS);
|
||||
else if (efl_isa(*parent, EFL_CANVAS_VG_OBJECT_CLASS))
|
||||
{
|
||||
*cd = NULL;
|
||||
*parent = NULL;
|
||||
}
|
||||
else if (*parent != NULL)
|
||||
*parent = NULL;
|
||||
else if (*parent)
|
||||
{
|
||||
ERR("Parent of unauthorized class '%s'.", efl_class_name_get(efl_class_get(*parent)));
|
||||
goto on_error;
|
||||
*parent = NULL;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
|
||||
on_error:
|
||||
*parent = NULL;
|
||||
*cd = NULL;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eo *
|
||||
|
@ -336,13 +322,13 @@ _efl_canvas_vg_node_efl_object_parent_set(Eo *obj,
|
|||
{
|
||||
Efl_Canvas_Vg_Container_Data *cd = NULL;
|
||||
Efl_Canvas_Vg_Container_Data *old_cd;
|
||||
Eo *old_parent;
|
||||
Efl_VG *old_parent;
|
||||
Eina_Bool parent_container = EINA_TRUE;
|
||||
|
||||
if (efl_isa(parent, EFL_CANVAS_VG_CONTAINER_CLASS))
|
||||
cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
|
||||
cd = efl_data_scope_get(parent, EFL_CANVAS_VG_CONTAINER_CLASS);
|
||||
else if (efl_isa(parent, EFL_CANVAS_VG_OBJECT_CLASS))
|
||||
parent_container = EINA_FALSE;
|
||||
parent_container = EINA_FALSE;
|
||||
else if (parent)
|
||||
{
|
||||
ERR("parent(%p, class = %s) is not allowed by vg node(%p).",
|
||||
|
|
Loading…
Reference in New Issue