remove redundant code...
Change-Id: Icbe384b0768c24c2b37012571bfecc5bda6ee1a5
cnd->render_pre(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?
+ //we can avoid to call render_pre for composite objects.
if (cd->comp.src) return;
if (scene) tvg_scene_push(scene, cd->scene);
return evas_cache_vg_file_save(pd->root, w, h, file, key, info);
}
-static void
-_cleanup_reference(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Efl_Canvas_Vg_Object_Data *pd = data;
- Eo *renderer;
-
- /* unref all renderer and may also destroy them async */
- while ((renderer = eina_array_pop(&pd->cleanup)))
- efl_unref(renderer);
-}
-
EOLIAN static void
_efl_canvas_vg_object_efl_object_invalidate(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
{
- Evas *e = evas_object_evas_get(eo_obj);
-
- efl_event_callback_del(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd);
- eina_array_flush(&pd->cleanup);
-
efl_unref(pd->root);
pd->root = NULL;
free(pd->tvg_buffer);
pd->tvg_buffer = NULL;
}
-
if (pd->tvg_canvas)
{
tvg_canvas_clear(pd->tvg_canvas, false);
/* default root node */
pd->obj = obj;
pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, NULL);
- pd->sync_render = EINA_FALSE;
-
pd->tvg_canvas = tvg_swcanvas_create();
pd->tvg_canvas_size.w = 0;
pd->tvg_canvas_size.h = 0;
- eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8);
+
return eo_obj;
}
static Efl_Object *
_efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data *pd)
{
- Evas *e = evas_object_evas_get(obj);
-
/* Container must have a set parent after construction.
efl_add_ref() with a parent won't work this case
because container needs some jobs in overriding parent_set()
after proper intialization. */
efl_parent_set(pd->root, obj);
- // TODO: If we start to have to many Evas_Object_VG per canvas, it may be nice
- // to actually have one event per canvas and one array per canvas to.
- efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd);
-
return obj;
}
Eina_Rect fill;
Eina_Rect viewbox;
unsigned int width, height;
- Eina_Array cleanup;
double align_x, align_y;
Efl_Canvas_Vg_Fill_Mode fill_mode;
int frame_idx;
void *ckeys[2]; //cache keys for first, last frames if animation
Eina_Bool changed : 1;
- Eina_Bool sync_render : 1;
Tvg_Canvas *tvg_canvas;
Eina_Size2D tvg_canvas_size;
typedef struct _Vg_Composite
{
Evas_Object_Protected_Data *vg_pd; //Vector Object (for accessing backend engine)
- Ector_Buffer *buffer; //Composite Ector Buffer
- void *pixels; //Composite pixel buffer (actual data)
- unsigned int length; //pixel buffer data size
- unsigned int stride; //pixel buffer stride
- Eina_Size2D size; //Composite boundary
Eina_List *src; //Composite Sources
Efl_Gfx_Vg_Composite_Method method; //Composite Method
} Vg_Comp;
Efl_Canvas_Vg_Node *comp_target; //Composite target
Vg_Comp comp; //Composite target data
- /* Layer transparency feature.
- This buffer is only valid when the layer has transparency. */
- struct {
- Ector_Buffer *buffer;
- void *pixels;
- unsigned int length; //blend buffer data size
- unsigned int stride; //blend buffer stride
- } blend;
-
Tvg_Paint *scene;
};
struct _Efl_Canvas_Vg_Gradient_Data
{
- // FIXME: Later on we should deduplicate it somehow (Using Ector ?).
Evas_Vg_Gradient_Stop *colors;
unsigned int colors_count;
Efl_Gfx_Gradient_Spread spread;
return ctx;
}
-static Eina_Bool use_gl = EINA_FALSE;
-
static Ector_Buffer *
eng_ector_buffer_wrap(void *engine EINA_UNUSED, Evas *evas, void *engine_image)
{