struct _Evas_Filter_Data
{
const Evas_Object_Filter_Data *data;
+ Evas_Object_Protected_Data *obj;
Eina_Bool has_cb;
SLK(lck);
Eina_List *post_data;
static void
_render_post_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
- Eo *eo_obj = data;
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- Evas_Filter_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS);
+ Evas_Filter_Data *pd = data;
+ Evas_Object_Protected_Data *obj = pd->obj;
Eina_List *post_data;
Evas_Filter_Post_Render_Data *task;
static void
_filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool success)
{
- Eo *eo_obj = data;
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
- Evas_Filter_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS);
Evas_Filter_Post_Render_Data *post_data;
+ Evas_Filter_Data *pd = data;
if (!pd)
return;
if (!pd->data->async)
{
- _filter_end_sync(ctx, obj, pd, success);
+ _filter_end_sync(ctx, pd->obj, pd, success);
return;
}
{
// Post render callback is not required anymore
Evas *e = obj->layer->evas->evas;
- efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
+ efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, pd);
pd->has_cb = EINA_FALSE;
}
if (do_async && !pd->has_cb)
{
Evas *e = obj->layer->evas->evas;
- efl_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
+ efl_event_callback_add(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, pd);
pd->has_cb = EINA_TRUE;
}
- evas_filter_context_post_run_callback_set(filter, _filter_cb, eo_obj);
+ evas_filter_context_post_run_callback_set(filter, _filter_cb, pd);
ok = evas_filter_run(filter);
fcow = FCOW_BEGIN(pd);
_efl_canvas_filter_internal_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd,
const char *code, const char *name)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj = pd->obj;
Evas_Filter_Program *pgm = NULL;
Evas_Object_Filter_Data *fcow;
Eina_Bool alpha;
_efl_canvas_filter_internal_efl_gfx_filter_filter_source_set(Eo *eo_obj, Evas_Filter_Data *pd,
const char *name, Efl_Gfx *eo_source)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj = pd->obj;
Evas_Filter_Proxy_Binding *pb, *pb_old = NULL;
Evas_Object_Protected_Data *source = NULL;
Evas_Object_Filter_Data *fcow = NULL;
const char *next_state, double next_val,
double pos)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj = pd->obj;
evas_object_async_block(obj);
if ((cur_state != pd->data->state.cur.name) || (cur_val != pd->data->state.cur.value) ||
obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
pd->data = eina_cow_alloc(evas_object_filter_cow);
+ pd->obj = efl_data_ref(eo_obj, EFL_CANVAS_OBJECT_CLASS);
SLKI(pd->lck);
return obj;
EOLIAN static void
_efl_canvas_filter_internal_efl_object_destructor(Eo *eo_obj, Evas_Filter_Data *pd)
{
- Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj = pd->obj;
Evas_Filter_Data_Binding *db;
Eina_Inlist *il;
if (pd->has_cb)
{
Evas *e = obj->layer->evas->evas;
- efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, eo_obj);
+ efl_event_callback_del(e, EFL_CANVAS_EVENT_RENDER_POST, _render_post_cb, pd);
}
SLKD(pd->lck);
+ efl_data_unref(eo_obj, pd->obj);
efl_destructor(efl_super(eo_obj, MY_CLASS));
}
typedef struct {
Ector_Software_Buffer_Base_Data *base;
- Evas *evas;
+ Evas_Public_Data *evas;
RGBA_Image *image;
} Evas_Ector_Software_Buffer_Data;
return;
}
- pd->evas = efl_xref(evas, obj);
+ pd->evas = efl_data_xref(evas, EVAS_CANVAS_CLASS, obj);
evas_cache_image_ref(&im->cache_entry);
pd->image = im;
Evas_Ector_Software_Buffer_Data *pd,
Evas **evas, void **image)
{
- Evas_Public_Data *e = efl_data_scope_get(pd->evas, EVAS_CANVAS_CLASS);
-
- if (evas) *evas = pd->evas;
- if (e->engine.func->gl_surface_read_pixels)
+ if (!pd->evas)
+ {
+ INF("evas_ector_buffer_engine_image_set was not called on this image");
+ if (evas) *evas = NULL;
+ if (image) *image = NULL;
+ return;
+ }
+ if (evas) *evas = pd->evas->evas;
+ if (pd->evas->engine.func->gl_surface_read_pixels)
{
ERR("Invalid: requesting engine_image from a GL image from a simple SW buffer!");
if (image) *image = NULL;
{
efl_data_xunref(obj, pd->base, obj);
evas_cache_image_drop(&pd->image->cache_entry);
- efl_xunref(pd->evas, obj);
+ if (pd->evas)
+ efl_data_xunref(pd->evas->evas, pd->evas, obj);
efl_destructor(efl_super(obj, MY_CLASS));
}
if (!ie) return NULL;
- buf = efl_add(EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, e, evas_ector_buffer_engine_image_set(efl_added, e, ie));
+ if (!efl_domain_current_push(EFL_ID_DOMAIN_SHARED))
+ return NULL;
+ buf = efl_add(EVAS_ECTOR_SOFTWARE_BUFFER_CLASS, NULL, evas_ector_buffer_engine_image_set(efl_added, e, ie));
+ efl_domain_current_pop();
return buf;
}
if ((flags & (ECTOR_BUFFER_FLAG_RENDERABLE | ECTOR_BUFFER_FLAG_DRAWABLE)) == 0)
{
- buf = efl_add(ECTOR_SOFTWARE_BUFFER_CLASS, evas, ector_buffer_pixels_set(efl_added, pixels, width, height, stride, cspace, writeable, l, r, t, b));
+ if (!efl_domain_current_push(EFL_ID_DOMAIN_SHARED))
+ return NULL;
+ buf = efl_add(ECTOR_SOFTWARE_BUFFER_CLASS, NULL, ector_buffer_pixels_set(efl_added, pixels, width, height, stride, cspace, writeable, l, r, t, b));
+ efl_domain_current_pop();
}
else
{