2015-04-03 07:12:59 -07:00
|
|
|
#include "evas_common_private.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2015-04-03 07:22:58 -07:00
|
|
|
#include "evas_vg_private.h"
|
2015-04-03 07:30:59 -07:00
|
|
|
#include "efl_vg_root_node.eo.h"
|
2015-04-03 07:12:59 -07:00
|
|
|
|
|
|
|
#define MY_CLASS EVAS_VG_CLASS
|
|
|
|
|
|
|
|
/* private magic number for rectangle objects */
|
2015-04-03 07:22:50 -07:00
|
|
|
static const char o_type[] = "vectors";
|
2015-04-03 07:12:59 -07:00
|
|
|
|
|
|
|
const char *o_vg_type = o_type;
|
|
|
|
|
|
|
|
|
|
|
|
static void evas_object_vg_render(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
2017-05-12 15:03:05 -07:00
|
|
|
void *engine, void *output, void *context, void *surface,
|
2015-04-03 07:12:59 -07:00
|
|
|
int x, int y, Eina_Bool do_async);
|
|
|
|
static void evas_object_vg_render_pre(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static void evas_object_vg_render_post(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static unsigned int evas_object_vg_id_get(Evas_Object *eo_obj);
|
|
|
|
static unsigned int evas_object_vg_visual_id_get(Evas_Object *eo_obj);
|
|
|
|
static void *evas_object_vg_engine_data_get(Evas_Object *eo_obj);
|
|
|
|
static int evas_object_vg_is_opaque(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
static int evas_object_vg_was_opaque(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data);
|
|
|
|
|
|
|
|
static const Evas_Object_Func object_func =
|
|
|
|
{
|
|
|
|
/* methods (compulsory) */
|
|
|
|
NULL,
|
|
|
|
evas_object_vg_render,
|
|
|
|
evas_object_vg_render_pre,
|
|
|
|
evas_object_vg_render_post,
|
|
|
|
evas_object_vg_id_get,
|
|
|
|
evas_object_vg_visual_id_get,
|
|
|
|
evas_object_vg_engine_data_get,
|
|
|
|
/* these are optional. NULL = nothing */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
evas_object_vg_is_opaque,
|
|
|
|
evas_object_vg_was_opaque,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2015-07-21 06:44:38 -07:00
|
|
|
NULL,
|
2016-11-14 18:22:14 -08:00
|
|
|
NULL, // render_prepare
|
2015-04-03 07:12:59 -07:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* the actual api call to add a vector graphic object */
|
|
|
|
EAPI Evas_Object *
|
|
|
|
evas_object_vg_add(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2017-07-06 00:47:41 -07:00
|
|
|
// TODO: Ask backend to return the main Ector_Surface
|
|
|
|
return efl_add(MY_CLASS, e, efl_canvas_object_legacy_ctor(efl_added));
|
2015-04-03 07:12:59 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:30:59 -07:00
|
|
|
Efl_VG *
|
2015-04-03 07:12:59 -07:00
|
|
|
_evas_vg_root_node_get(Eo *obj EINA_UNUSED, Evas_VG_Data *pd)
|
|
|
|
{
|
|
|
|
return pd->root;
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_cleanup_reference(void *data, const Efl_Event *event EINA_UNUSED)
|
2015-08-20 06:39:16 -07:00
|
|
|
{
|
|
|
|
Evas_VG_Data *pd = data;
|
|
|
|
Eo *renderer;
|
|
|
|
|
|
|
|
/* unref all renderer and may also destroy them async */
|
|
|
|
while ((renderer = eina_array_pop(&pd->cleanup)))
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(renderer);
|
2015-08-20 06:39:16 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:30:49 -07:00
|
|
|
void
|
2016-08-10 07:23:04 -07:00
|
|
|
_evas_vg_efl_object_destructor(Eo *eo_obj, Evas_VG_Data *pd)
|
2015-04-03 07:30:49 -07:00
|
|
|
{
|
2015-11-19 04:15:51 -08:00
|
|
|
Evas_Object_Protected_Data *obj;
|
2015-08-20 06:39:16 -07:00
|
|
|
Evas *e = evas_object_evas_get(eo_obj);
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2015-11-19 04:15:51 -08:00
|
|
|
if (pd->engine_data)
|
|
|
|
obj->layer->evas->engine.func->ector_free(pd->engine_data);
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
2015-08-20 06:39:16 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(pd->root);
|
2015-06-16 08:21:50 -07:00
|
|
|
pd->root = NULL;
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(eo_obj, MY_CLASS));
|
2015-04-03 07:30:49 -07:00
|
|
|
}
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_evas_vg_efl_object_constructor(Eo *eo_obj, Evas_VG_Data *pd)
|
2015-04-03 07:12:59 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2015-04-03 07:12:59 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
|
2015-04-03 07:12:59 -07:00
|
|
|
|
|
|
|
/* set up methods (compulsory) */
|
|
|
|
obj->func = &object_func;
|
2016-08-15 06:44:41 -07:00
|
|
|
obj->private_data = efl_data_ref(eo_obj, MY_CLASS);
|
2015-04-03 07:12:59 -07:00
|
|
|
obj->type = o_type;
|
|
|
|
|
2015-04-03 07:22:37 -07:00
|
|
|
/* root node */
|
2016-08-15 06:44:41 -07:00
|
|
|
pd->root = efl_add(EFL_VG_ROOT_NODE_CLASS, eo_obj);
|
|
|
|
efl_ref(pd->root);
|
2015-04-03 07:22:37 -07:00
|
|
|
|
2015-08-19 07:06:39 -07:00
|
|
|
eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8);
|
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
return eo_obj;
|
2015-04-03 07:12:59 -07:00
|
|
|
}
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
static Efl_Object *
|
|
|
|
_evas_vg_efl_object_finalize(Eo *obj, Evas_VG_Data *pd)
|
2015-08-20 06:39:16 -07:00
|
|
|
{
|
|
|
|
Evas *e = evas_object_evas_get(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.
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _cleanup_reference, pd);
|
2015-08-20 06:39:16 -07:00
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:23:00 -07:00
|
|
|
static void
|
2015-08-19 07:06:39 -07:00
|
|
|
_evas_vg_render(Evas_Object_Protected_Data *obj, Evas_VG_Data *vd,
|
2017-05-12 15:03:05 -07:00
|
|
|
void *engine, void *output, void *context, void *surface, Efl_VG *n,
|
2015-04-03 07:33:19 -07:00
|
|
|
Eina_Array *clips, Eina_Bool do_async)
|
2015-04-03 07:23:00 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
if (efl_isa(n, EFL_VG_CONTAINER_CLASS))
|
2015-04-03 07:23:00 -07:00
|
|
|
{
|
2015-08-19 07:12:58 -07:00
|
|
|
Efl_VG_Container_Data *vc;
|
2015-04-03 07:30:59 -07:00
|
|
|
Efl_VG *child;
|
2015-04-03 07:23:00 -07:00
|
|
|
Eina_List *l;
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
vc = efl_data_scope_get(n, EFL_VG_CONTAINER_CLASS);
|
2015-08-19 07:12:58 -07:00
|
|
|
|
2015-08-19 07:06:39 -07:00
|
|
|
EINA_LIST_FOREACH(vc->children, l, child)
|
|
|
|
_evas_vg_render(obj, vd,
|
2017-05-12 15:03:05 -07:00
|
|
|
engine, output, context, surface, child,
|
2015-04-03 07:33:19 -07:00
|
|
|
clips, do_async);
|
2015-04-03 07:23:00 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-05-11 05:13:27 -07:00
|
|
|
Efl_VG_Data *nd;
|
2015-04-03 07:30:54 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
nd = efl_data_scope_get(n, EFL_VG_CLASS);
|
2015-04-03 07:23:00 -07:00
|
|
|
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->ector_renderer_draw(engine, output, context, surface, vd->engine_data, nd->renderer, clips, do_async);
|
2015-08-19 07:06:39 -07:00
|
|
|
|
|
|
|
if (do_async)
|
2016-08-15 06:44:41 -07:00
|
|
|
eina_array_push(&vd->cleanup, efl_ref(nd->renderer));
|
2015-04-03 07:23:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
static void
|
|
|
|
evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
|
2015-04-03 07:23:00 -07:00
|
|
|
Evas_Object_Protected_Data *obj,
|
|
|
|
void *type_private_data,
|
2017-05-12 15:03:05 -07:00
|
|
|
void *engine, void *output, void *context, void *surface,
|
2015-04-03 07:23:00 -07:00
|
|
|
int x, int y, Eina_Bool do_async)
|
2015-04-03 07:12:59 -07:00
|
|
|
{
|
2015-04-03 07:23:00 -07:00
|
|
|
Evas_VG_Data *vd = type_private_data;
|
2017-08-25 10:52:10 -07:00
|
|
|
Ector_Surface *ector = evas_ector_get(obj->layer->evas);
|
2015-04-03 07:15:40 -07:00
|
|
|
// FIXME: Set context (that should affect Ector_Surface) and
|
|
|
|
// then call Ector_Renderer render from bottom to top. Get the
|
|
|
|
// Ector_Surface that match the output from Evas engine API.
|
|
|
|
// It is a requirement that you can reparent an Ector_Renderer
|
|
|
|
// to another Ector_Surface as long as that Ector_Surface is a
|
|
|
|
// child of the main Ector_Surface (necessary for Evas_Map).
|
|
|
|
|
2015-11-19 04:15:51 -08:00
|
|
|
if (!vd->engine_data)
|
2017-05-12 15:03:05 -07:00
|
|
|
vd->engine_data = obj->layer->evas->engine.func->ector_new(engine, context, ector, surface);
|
2015-11-19 04:15:51 -08:00
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
/* render object to surface with context, and offxet by x,y */
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_color_set(engine,
|
2015-04-03 07:23:00 -07:00
|
|
|
context,
|
2015-05-09 02:44:31 -07:00
|
|
|
255,
|
|
|
|
255,
|
|
|
|
255,
|
|
|
|
255);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_multiplier_set(engine,
|
2015-05-09 02:44:31 -07:00
|
|
|
context,
|
|
|
|
obj->cur->cache.clip.r,
|
|
|
|
obj->cur->cache.clip.g,
|
|
|
|
obj->cur->cache.clip.b,
|
|
|
|
obj->cur->cache.clip.a);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_anti_alias_set(engine, context,
|
2015-04-03 07:23:00 -07:00
|
|
|
obj->cur->anti_alias);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->context_render_op_set(engine, context,
|
2015-04-03 07:23:00 -07:00
|
|
|
obj->cur->render_op);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->ector_begin(engine, context,
|
2015-08-24 23:32:35 -07:00
|
|
|
ector, surface,
|
2015-11-19 04:15:51 -08:00
|
|
|
vd->engine_data,
|
2015-04-03 07:33:19 -07:00
|
|
|
obj->cur->geometry.x + x, obj->cur->geometry.y + y,
|
|
|
|
do_async);
|
2015-08-19 07:06:39 -07:00
|
|
|
_evas_vg_render(obj, vd,
|
2017-05-12 15:03:05 -07:00
|
|
|
engine, output, context, surface,
|
2015-08-19 07:06:39 -07:00
|
|
|
vd->root, NULL,
|
2015-04-03 07:23:00 -07:00
|
|
|
do_async);
|
2017-05-12 15:03:05 -07:00
|
|
|
obj->layer->evas->engine.func->ector_end(engine, context, ector, surface, vd->engine_data, do_async);
|
2015-04-03 07:12:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
evas_object_vg_render_pre(Evas_Object *eo_obj,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
2015-04-03 07:22:58 -07:00
|
|
|
void *type_private_data)
|
2015-04-03 07:12:59 -07:00
|
|
|
{
|
2015-04-03 07:22:58 -07:00
|
|
|
Evas_VG_Data *vd = type_private_data;
|
2016-05-11 05:13:27 -07:00
|
|
|
Efl_VG_Data *rnd;
|
2015-04-03 07:12:59 -07:00
|
|
|
int is_v, was_v;
|
2015-04-03 07:22:58 -07:00
|
|
|
Ector_Surface *s;
|
2015-04-03 07:12:59 -07:00
|
|
|
|
|
|
|
/* dont pre-render the obj twice! */
|
|
|
|
if (obj->pre_render_done) return;
|
|
|
|
obj->pre_render_done = EINA_TRUE;
|
2015-04-03 07:33:42 -07:00
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
/* pre-render phase. this does anything an object needs to do just before */
|
|
|
|
/* rendering. this could mean loading the image data, retrieving it from */
|
|
|
|
/* elsewhere, decoding video etc. */
|
|
|
|
/* then when this is done the object needs to figure if it changed and */
|
|
|
|
/* if so what and where and add the appropriate redraw rectangles */
|
|
|
|
/* if someone is clipping this obj - go calculate the clipper */
|
|
|
|
if (obj->cur->clipper)
|
|
|
|
{
|
|
|
|
if (obj->cur->cache.clip.dirty)
|
|
|
|
evas_object_clip_recalc(obj->cur->clipper);
|
|
|
|
obj->cur->clipper->func->render_pre(obj->cur->clipper->object,
|
|
|
|
obj->cur->clipper,
|
|
|
|
obj->cur->clipper->private_data);
|
|
|
|
}
|
2015-08-24 23:32:35 -07:00
|
|
|
|
|
|
|
// FIXME: handle damage only on changed renderer.
|
2017-08-25 10:52:10 -07:00
|
|
|
s = evas_ector_get(obj->layer->evas);
|
2015-08-24 23:32:35 -07:00
|
|
|
if (vd->root && s)
|
|
|
|
_evas_vg_render_pre(vd->root, s, NULL);
|
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
/* now figure what changed and add draw rects */
|
|
|
|
/* if it just became visible or invisible */
|
|
|
|
is_v = evas_object_is_visible(eo_obj, obj);
|
|
|
|
was_v = evas_object_was_visible(eo_obj,obj);
|
|
|
|
if (!(is_v | was_v)) goto done;
|
2015-04-03 07:33:42 -07:00
|
|
|
|
|
|
|
// FIXME: for now the walking Evas_VG_Node tree doesn't trigger any damage
|
|
|
|
// So just forcing it here if necessary
|
2016-08-15 06:44:41 -07:00
|
|
|
rnd = efl_data_scope_get(vd->root, EFL_VG_CLASS);
|
2015-05-08 04:32:40 -07:00
|
|
|
|
2015-06-16 08:21:50 -07:00
|
|
|
// Once the destructor has been called, root node will be zero
|
|
|
|
// and a full redraw is still necessary.
|
|
|
|
if (!rnd)
|
|
|
|
{
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
else if (rnd->changed)
|
2015-04-03 07:33:42 -07:00
|
|
|
{
|
|
|
|
rnd->changed = EINA_FALSE;
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
if (is_v != was_v)
|
|
|
|
{
|
|
|
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
if (obj->changed_map || obj->changed_src_visible)
|
|
|
|
{
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
/* it's not visible - we accounted for it appearing or not so just abort */
|
|
|
|
if (!is_v) goto done;
|
|
|
|
/* clipper changed this is in addition to anything else for obj */
|
|
|
|
evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, eo_obj);
|
|
|
|
/* if we restacked (layer or just within a layer) and don't clip anyone */
|
|
|
|
if ((obj->restack) && (!obj->clip.clipees))
|
|
|
|
{
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
/* if it changed render op */
|
|
|
|
if (obj->cur->render_op != obj->prev->render_op)
|
|
|
|
{
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
/* if it changed color */
|
|
|
|
if ((obj->cur->color.r != obj->prev->color.r) ||
|
|
|
|
(obj->cur->color.g != obj->prev->color.g) ||
|
|
|
|
(obj->cur->color.b != obj->prev->color.b) ||
|
|
|
|
(obj->cur->color.a != obj->prev->color.a))
|
|
|
|
{
|
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
/* if it changed geometry - and obviously not visibility or color */
|
|
|
|
/* calculate differences since we have a constant color fill */
|
|
|
|
/* we really only need to update the differences */
|
|
|
|
if ((obj->cur->geometry.x != obj->prev->geometry.x) ||
|
|
|
|
(obj->cur->geometry.y != obj->prev->geometry.y) ||
|
|
|
|
(obj->cur->geometry.w != obj->prev->geometry.w) ||
|
|
|
|
(obj->cur->geometry.h != obj->prev->geometry.h))
|
|
|
|
{
|
2015-06-12 01:24:55 -07:00
|
|
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj);
|
2015-04-03 07:12:59 -07:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
|
|
|
|
/* area so if there were updates for it they get wiped. don't do it if we */
|
|
|
|
/* arent fully opaque and we are visible */
|
|
|
|
if (evas_object_is_visible(eo_obj, obj) &&
|
|
|
|
evas_object_is_opaque(eo_obj, obj) &&
|
|
|
|
(!obj->clip.clipees))
|
|
|
|
{
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
|
|
|
x = obj->cur->cache.clip.x;
|
|
|
|
y = obj->cur->cache.clip.y;
|
|
|
|
w = obj->cur->cache.clip.w;
|
|
|
|
h = obj->cur->cache.clip.h;
|
|
|
|
if (obj->cur->clipper)
|
|
|
|
{
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->cur->clipper->cur->cache.clip.x,
|
|
|
|
obj->cur->clipper->cur->cache.clip.y,
|
|
|
|
obj->cur->clipper->cur->cache.clip.w,
|
|
|
|
obj->cur->clipper->cur->cache.clip.h);
|
|
|
|
}
|
2016-11-25 17:47:34 -08:00
|
|
|
evas_render_update_del(obj->layer->evas,
|
|
|
|
x + obj->layer->evas->framespace.x,
|
|
|
|
y + obj->layer->evas->framespace.y,
|
|
|
|
w, h);
|
2015-04-03 07:12:59 -07:00
|
|
|
}
|
|
|
|
done:
|
|
|
|
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_vg_render_post(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj,
|
2015-08-20 06:39:16 -07:00
|
|
|
void *type_private_data EINA_UNUSED)
|
2015-04-03 07:12:59 -07:00
|
|
|
{
|
|
|
|
/* this moves the current data to the previous state parts of the object */
|
|
|
|
/* in whatever way is safest for the object. also if we don't need object */
|
|
|
|
/* data anymore we can free it if the object deems this is a good idea */
|
|
|
|
/* remove those pesky changes */
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_clip_changes_clean(obj);
|
2015-04-03 07:12:59 -07:00
|
|
|
/* move cur to prev safely for object data */
|
2017-02-03 18:31:55 -08:00
|
|
|
evas_object_cur_prev(obj);
|
2015-04-03 07:12:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned int
|
|
|
|
evas_object_vg_id_get(Evas_Object *eo_obj)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_VG_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
|
2015-04-03 07:12:59 -07:00
|
|
|
if (!o) return 0;
|
|
|
|
return MAGIC_OBJ_VG;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned int
|
|
|
|
evas_object_vg_visual_id_get(Evas_Object *eo_obj)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_VG_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
|
2015-04-03 07:12:59 -07:00
|
|
|
if (!o) return 0;
|
|
|
|
return MAGIC_OBJ_SHAPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
|
|
|
evas_object_vg_engine_data_get(Evas_Object *eo_obj)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_VG_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
|
2015-04-03 07:12:59 -07:00
|
|
|
return o->engine_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
evas_object_vg_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
evas_object_vg_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
|
|
|
|
Evas_Object_Protected_Data *obj EINA_UNUSED,
|
|
|
|
void *type_private_data EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-04-03 07:14:55 -07:00
|
|
|
void
|
2016-03-01 23:18:40 -08:00
|
|
|
_evas_vg_efl_gfx_view_view_size_get(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
|
|
|
|
int *w, int *h)
|
2015-04-03 07:22:51 -07:00
|
|
|
{
|
|
|
|
if (w) *w = pd->width;
|
|
|
|
if (h) *h = pd->height;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-03-01 23:18:40 -08:00
|
|
|
_evas_vg_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
|
|
|
|
int w, int h)
|
2015-04-03 07:22:51 -07:00
|
|
|
{
|
|
|
|
pd->width = w;
|
|
|
|
pd->height = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-04-03 07:23:25 -07:00
|
|
|
_evas_vg_efl_gfx_fill_fill_set(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
|
|
|
|
int x, int y, int w, int h)
|
2015-04-03 07:22:51 -07:00
|
|
|
{
|
|
|
|
pd->fill.x = x;
|
|
|
|
pd->fill.y = y;
|
|
|
|
pd->fill.w = w;
|
|
|
|
pd->fill.h = h;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-04-03 07:23:25 -07:00
|
|
|
_evas_vg_efl_gfx_fill_fill_get(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
|
|
|
|
int *x, int *y, int *w, int *h)
|
2015-04-03 07:14:55 -07:00
|
|
|
{
|
2015-04-03 07:22:51 -07:00
|
|
|
if (x) *x = pd->fill.x;
|
|
|
|
if (y) *y = pd->fill.y;
|
|
|
|
if (w) *w = pd->fill.w;
|
|
|
|
if (h) *h = pd->fill.h;
|
2015-04-03 07:14:55 -07:00
|
|
|
}
|
|
|
|
|
2015-04-03 07:12:59 -07:00
|
|
|
#include "evas_vg.eo.c"
|