forked from enlightenment/efl
efl: roll in first use of Eina_Cow for Evas_Object.proxy.
Expedite biggest test memory win 100KB, average 10KB. No slow down in proxy test (+/-3%). Speed up in most other case (average speed up is +5%), likely due to much more cache hit. Elementary test show a win between 100KB to 600KB depending on the test you are considering. Now, you can see how I intend to use Eina_Cow and the expected win we can have from it. I don't intend to do more for the rest of the week so you have time to comment. SVN revision: 82924
This commit is contained in:
parent
515282006f
commit
4c828392da
|
@ -195,6 +195,14 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||
Evas_Coord_Point canvas = ev->canvas;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
Evas_Object_Protected_Data *child;
|
||||
Evas_Object *eo_child;
|
||||
Eina_List *l;
|
||||
int no_rep = 0;
|
||||
int addgrab = 0;
|
||||
Evas_Coord_Point point;
|
||||
Eina_List *copy;
|
||||
|
||||
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
||||
|
||||
|
@ -202,25 +210,28 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
|
||||
ev->event_src = eo_obj;
|
||||
|
||||
if (src->proxy.src_event_in)
|
||||
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
int no_rep = 0;
|
||||
Eina_List *l;
|
||||
Evas_Object *eo_child;
|
||||
Evas_Object_Protected_Data *child;
|
||||
if (proxy_write->src_event_in)
|
||||
proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
|
||||
|
||||
if (src->is_smart)
|
||||
{
|
||||
src->proxy.src_event_in = _evas_event_object_list_raw_in_get(eo_e, src->proxy.src_event_in, evas_object_smart_members_get_direct(eo_src), NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE);
|
||||
proxy_write->src_event_in = _evas_event_object_list_raw_in_get(eo_e,
|
||||
proxy_write->src_event_in,
|
||||
evas_object_smart_members_get_direct(eo_src),
|
||||
NULL, ev->canvas.x, ev->canvas.y, &no_rep, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
src->proxy.src_event_in = eina_list_append(src->proxy.src_event_in, eo_src);
|
||||
proxy_write->src_event_in = eina_list_append(proxy_write->src_event_in, eo_src);
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy), proxy_write);
|
||||
|
||||
int addgrab = 0;
|
||||
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
||||
|
||||
EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
|
||||
EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
if ((child->pointer_mode == EVAS_OBJECT_POINTER_MODE_AUTOGRAB) ||
|
||||
|
@ -237,8 +248,8 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
}
|
||||
}
|
||||
|
||||
Evas_Coord_Point point = ev->canvas;
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
point = ev->canvas;
|
||||
copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
|
@ -283,7 +294,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
if (e->pointer.mouse_grabbed)
|
||||
{
|
||||
Eina_List *outs = NULL;
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
|
@ -320,6 +331,8 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
if ((child->mouse_grabbed == 0) && (!e->delete_me))
|
||||
{
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
if (child->mouse_in) continue;
|
||||
child->mouse_in = 0;
|
||||
if (child->delete_me || e->is_frozen) continue;
|
||||
|
@ -329,8 +342,15 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
_evas_event_havemap_adjust(eo_child, child, &ev->cur.canvas.x,
|
||||
&ev->cur.canvas.y,
|
||||
child->mouse_grabbed);
|
||||
src->proxy.src_event_in =
|
||||
eina_list_remove(src->proxy.src_event_in, eo_child);
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**) &src->proxy));
|
||||
proxy_write->src_event_in =
|
||||
eina_list_remove(proxy_write->src_event_in, eo_child);
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_write);
|
||||
|
||||
evas_object_event_callback_call(eo_child, child,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
ev, event_id);
|
||||
|
@ -340,7 +360,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
else
|
||||
{
|
||||
Eina_List *ins = NULL;
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
if (src->is_smart)
|
||||
{
|
||||
int no_rep = 0;
|
||||
|
@ -403,7 +423,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
EINA_LIST_FOREACH(ins, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
|
||||
if (!eina_list_data_find(src->proxy->src_event_in, eo_child))
|
||||
{
|
||||
if (!child->mouse_in)
|
||||
{
|
||||
|
@ -426,9 +446,17 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
}
|
||||
if (e->pointer.mouse_grabbed == 0)
|
||||
{
|
||||
if (src->proxy.src_event_in)
|
||||
eina_list_free(src->proxy.src_event_in);
|
||||
src->proxy.src_event_in = ins;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
eina_list_free(proxy_write->src_event_in);
|
||||
proxy_write->src_event_in = ins;
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_write);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -458,7 +486,7 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_M
|
|||
Evas_Object_Protected_Data *child;
|
||||
Evas_Coord_Point point = ev->canvas;
|
||||
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
if (src->delete_me) return;
|
||||
|
@ -505,7 +533,7 @@ _evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void
|
|||
Eina_List *l;
|
||||
Evas_Object *child_eo;
|
||||
Evas_Object_Protected_Data *child;
|
||||
EINA_LIST_FOREACH(src->proxy.src_event_in, l, child_eo)
|
||||
EINA_LIST_FOREACH(src->proxy->src_event_in, l, child_eo)
|
||||
{
|
||||
if (src->delete_me) return;
|
||||
child = eo_data_get(child_eo, EVAS_OBJ_CLASS);
|
||||
|
@ -533,7 +561,7 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_Mous
|
|||
Evas_Object_Protected_Data *child;
|
||||
Evas_Coord_Point point = ev->canvas;
|
||||
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
if (src->delete_me) return;
|
||||
|
@ -575,7 +603,7 @@ _evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
int addgrab = 0;
|
||||
if (e->pointer.downs > 1) addgrab = e->pointer.downs - 1;
|
||||
|
||||
EINA_LIST_FOREACH(src->proxy.src_event_in, l, eo_child)
|
||||
EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
if (child->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
|
||||
|
@ -587,7 +615,7 @@ _evas_event_source_multi_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
|
||||
Evas_Coord_Precision_Point point = ev->canvas;
|
||||
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
ev->canvas = point;
|
||||
|
@ -624,7 +652,7 @@ _evas_event_source_multi_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_M
|
|||
|
||||
Evas_Coord_Precision_Point point = ev->canvas;
|
||||
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
|
||||
Eina_List *l;
|
||||
Evas_Object *eo_child;
|
||||
|
@ -680,7 +708,7 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
|
||||
if (e->pointer.mouse_grabbed > 0)
|
||||
{
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
|
@ -718,7 +746,7 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
}
|
||||
else
|
||||
ins = eina_list_append(ins, eo_src);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
child = eo_data_get(eo_child, EVAS_OBJ_CLASS);
|
||||
|
@ -754,8 +782,17 @@ _evas_event_source_multi_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event
|
|||
eina_list_free(copy);
|
||||
if (e->pointer.mouse_grabbed == 0)
|
||||
{
|
||||
eina_list_free(src->proxy.src_event_in);
|
||||
src->proxy.src_event_in = ins;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
eina_list_free(proxy_write->src_event_in);
|
||||
proxy_write->src_event_in = ins;
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_write);
|
||||
}
|
||||
else
|
||||
eina_list_free(ins);
|
||||
|
@ -772,6 +809,11 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||
Evas_Coord_Point canvas = ev->canvas;
|
||||
Evas_Object *eo_child;
|
||||
Eina_List *ins = NULL;
|
||||
Eina_List *l;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
Evas_Coord_Point point;
|
||||
|
||||
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
||||
|
||||
|
@ -779,7 +821,6 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
|
||||
ev->event_src = eo_obj;
|
||||
|
||||
Eina_List *ins = NULL;
|
||||
if (src->is_smart)
|
||||
{
|
||||
int no_rep = 0;
|
||||
|
@ -789,14 +830,12 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
else
|
||||
ins = eina_list_append(ins, eo_src);
|
||||
|
||||
Evas_Coord_Point point = ev->canvas;
|
||||
Eina_List *l;
|
||||
Evas_Object *eo_child;
|
||||
point = ev->canvas;
|
||||
EINA_LIST_FOREACH(ins, l, eo_child)
|
||||
{
|
||||
Evas_Object_Protected_Data *child = eo_data_get(eo_child,
|
||||
EVAS_OBJ_CLASS);
|
||||
if (!eina_list_data_find(src->proxy.src_event_in, eo_child))
|
||||
if (!eina_list_data_find(src->proxy->src_event_in, eo_child))
|
||||
{
|
||||
if(child->mouse_in) continue;
|
||||
|
||||
|
@ -814,8 +853,16 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
}
|
||||
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
||||
src->proxy.src_event_in = ins;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
eina_list_free(proxy_write->src_event_in);
|
||||
proxy_write->src_event_in = ins;
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_write);
|
||||
|
||||
ev->canvas = canvas;
|
||||
}
|
||||
|
@ -828,6 +875,11 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||
Evas_Coord_Point canvas = ev->canvas;
|
||||
Evas_Object *eo_child;
|
||||
Eina_List *l;
|
||||
Eina_List *copy;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
Evas_Coord_Point point;
|
||||
|
||||
if (obj->delete_me || src->delete_me || e->is_frozen) return;
|
||||
|
||||
|
@ -835,10 +887,8 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
|
||||
ev->event_src = eo_obj;
|
||||
|
||||
Eina_List *l;
|
||||
Evas_Object *eo_child;
|
||||
Eina_List *copy = evas_event_list_copy(src->proxy.src_event_in);
|
||||
Evas_Coord_Point point = ev->canvas;
|
||||
copy = evas_event_list_copy(src->proxy->src_event_in);
|
||||
point = ev->canvas;
|
||||
|
||||
EINA_LIST_FOREACH(copy, l, eo_child)
|
||||
{
|
||||
|
@ -860,7 +910,15 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Event_
|
|||
}
|
||||
|
||||
eina_list_free(copy);
|
||||
src->proxy.src_event_in = eina_list_free(src->proxy.src_event_in);
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_write);
|
||||
|
||||
ev->canvas = canvas;
|
||||
}
|
||||
|
@ -1124,7 +1182,7 @@ _canvas_event_feed_mouse_down(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_DOWN, &ev,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_down_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
if (e->is_frozen || e->delete_me) break;
|
||||
|
@ -1188,7 +1246,7 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
&ev, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
if (e->delete_me) break;
|
||||
|
@ -1235,8 +1293,8 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
|
|||
evas_object_event_callback_call(eo_obj_itr, obj_itr,
|
||||
EVAS_CALLBACK_MOUSE_IN,
|
||||
&ev_in, event_id);
|
||||
if ((obj_itr->proxy.is_proxy) &&
|
||||
(obj_itr->proxy.src_events))
|
||||
if ((obj_itr->proxy->is_proxy) &&
|
||||
(obj_itr->proxy->src_events))
|
||||
_evas_event_source_mouse_in_events(eo_obj_itr, eo_e, &ev_in,
|
||||
event_id);
|
||||
if (e->delete_me) break;
|
||||
|
@ -1348,7 +1406,7 @@ _canvas_event_feed_mouse_up(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_UP,
|
||||
&ev, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_up_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
if (e->delete_me) break;
|
||||
|
@ -1473,7 +1531,7 @@ _canvas_event_feed_mouse_wheel(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_WHEEL, &ev,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_wheel_events(eo_obj, eo_e, &ev, event_id);
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
|
@ -1582,8 +1640,8 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
{
|
||||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
||||
if ((obj->proxy.is_proxy) &&
|
||||
(obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) &&
|
||||
(obj->proxy->src_events))
|
||||
_evas_event_source_mouse_move_events(eo_obj, eo_e,
|
||||
&ev,
|
||||
event_id);
|
||||
|
@ -1646,8 +1704,8 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
&ev, event_id);
|
||||
if ((obj->proxy.is_proxy) &&
|
||||
(obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) &&
|
||||
(obj->proxy->src_events))
|
||||
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
}
|
||||
|
@ -1739,7 +1797,7 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
ev.cur.canvas.y = e->pointer.y;
|
||||
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
}
|
||||
|
@ -1761,7 +1819,7 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_OUT,
|
||||
&ev2, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
|
||||
event_id);
|
||||
if (e->delete_me) break;
|
||||
|
@ -1795,8 +1853,8 @@ _canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_IN,
|
||||
&ev3, event_id2);
|
||||
if ((obj->proxy.is_proxy) &&
|
||||
(obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) &&
|
||||
(obj->proxy->src_events))
|
||||
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
|
||||
event_id2);
|
||||
if (e->delete_me) break;
|
||||
|
@ -1934,7 +1992,7 @@ nogrep:
|
|||
_evas_event_framespace_adjust(eo_obj, &ev.cur.canvas.x, &ev.cur.canvas.y);
|
||||
_evas_event_havemap_adjust(eo_obj, obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, &ev, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_move_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
}
|
||||
|
@ -1954,7 +2012,7 @@ nogrep:
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_OUT, &ev2,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev2,
|
||||
event_id);
|
||||
}
|
||||
|
@ -1985,7 +2043,7 @@ nogrep:
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_IN, &ev3,
|
||||
event_id2);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev3,
|
||||
event_id2);
|
||||
if (e->delete_me) break;
|
||||
|
@ -2066,7 +2124,7 @@ _canvas_event_feed_mouse_in(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_IN, &ev,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_in_events(eo_obj, eo_e, &ev, event_id);
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
|
@ -2144,7 +2202,7 @@ _canvas_event_feed_mouse_out(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MOUSE_OUT, &ev,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_mouse_out_events(eo_obj, eo_e, &ev, event_id);
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
|
@ -2260,7 +2318,7 @@ _canvas_event_feed_multi_down(Eo *eo_e, void *_pd, va_list *list)
|
|||
evas_object_event_callback_call(eo_obj, obj,
|
||||
EVAS_CALLBACK_MULTI_DOWN, &ev,
|
||||
event_id);
|
||||
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
|
||||
_evas_event_source_multi_down_events(eo_obj, eo_e, &ev, event_id);
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
|
@ -2365,7 +2423,7 @@ _canvas_event_feed_multi_up(Eo *eo_e, void *_pd, va_list *list)
|
|||
}
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP,
|
||||
&ev, event_id);
|
||||
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
|
||||
_evas_event_source_multi_up_events(eo_obj, eo_e, &ev, event_id);
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
}
|
||||
|
@ -2473,7 +2531,7 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
if (y != ev.cur.canvas.y)
|
||||
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
|
||||
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
|
||||
_evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
|
||||
|
@ -2548,7 +2606,7 @@ _canvas_event_feed_multi_move(Eo *eo_e, void *_pd, va_list *list)
|
|||
if (y != ev.cur.canvas.y)
|
||||
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, &ev, event_id);
|
||||
if ((obj->proxy.is_proxy) || (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) || (obj->proxy->src_events))
|
||||
_evas_event_source_multi_move_events(eo_obj, eo_e, &ev,
|
||||
event_id);
|
||||
}
|
||||
|
@ -2838,7 +2896,7 @@ _canvas_event_feed_hold(Eo *eo_e, void *_pd, va_list *list)
|
|||
{
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD,
|
||||
&ev, event_id);
|
||||
if ((obj->proxy.is_proxy) && (obj->proxy.src_events))
|
||||
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
|
||||
_evas_event_source_hold_events(eo_obj, eo_e, &ev, event_id);
|
||||
}
|
||||
if (e->delete_me || e->is_frozen) break;
|
||||
|
|
|
@ -86,6 +86,9 @@ evas_shutdown(void)
|
|||
if (--_evas_init_count != 0)
|
||||
return _evas_init_count;
|
||||
|
||||
eina_cow_del(evas_object_proxy_cow);
|
||||
evas_object_proxy_cow = NULL;
|
||||
|
||||
evas_thread_shutdown();
|
||||
_evas_preload_thread_shutdown();
|
||||
evas_async_events_shutdown();
|
||||
|
|
|
@ -589,12 +589,20 @@ _image_source_events_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
Evas_Object_Image *o = _pd;
|
||||
Eina_Bool source_events = va_arg(*list, int);
|
||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
source_events = !!source_events;
|
||||
if (obj->proxy.src_events == source_events) return;
|
||||
obj->proxy.src_events = source_events;
|
||||
if (obj->proxy->src_events == source_events) return;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&obj->proxy));
|
||||
proxy_write->src_events = source_events;
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&obj->proxy),
|
||||
proxy_write);
|
||||
|
||||
if (!o->cur.source) return;
|
||||
if ((obj->proxy.src_invisible) || (!source_events)) return;
|
||||
if ((obj->proxy->src_invisible) || (!source_events)) return;
|
||||
//FIXME: Feed mouse events here.
|
||||
}
|
||||
|
||||
|
@ -617,7 +625,7 @@ _image_source_events_get(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
|
|||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
Eina_Bool *source_events = va_arg(*list, Eina_Bool *);
|
||||
if (!source_events) return;
|
||||
*source_events = obj->proxy.src_events;
|
||||
*source_events = obj->proxy->src_events;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -636,18 +644,27 @@ _image_source_visible_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
Evas_Object_Protected_Data *src_obj;
|
||||
Evas_Object_Image *o = _pd;
|
||||
Eina_Bool visible = va_arg(*list, int);
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
if (!o->cur.source) return;
|
||||
|
||||
visible = !!visible;
|
||||
src_obj = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
if (src_obj->proxy.src_invisible == !visible) return;
|
||||
src_obj->proxy.src_invisible = !visible;
|
||||
if (src_obj->proxy->src_invisible == !visible) return;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src_obj->proxy));
|
||||
|
||||
proxy_write->src_invisible = !visible;
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src_obj->proxy), proxy_write);
|
||||
|
||||
src_obj->changed_src_visible = EINA_TRUE;
|
||||
evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE,
|
||||
EINA_FALSE, EINA_TRUE);
|
||||
evas_object_change(o->cur.source, src_obj);
|
||||
if ((!visible) || (!src_obj->proxy.src_events)) return;
|
||||
if ((!visible) || (!src_obj->proxy->src_events)) return;
|
||||
//FIXME: Feed mouse events here.
|
||||
}
|
||||
|
||||
|
@ -674,7 +691,7 @@ _image_source_visible_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
if (!visible) return;
|
||||
if (!o->cur.source) *visible = EINA_FALSE;
|
||||
src_obj = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
if (src_obj) *visible = !src_obj->proxy.src_invisible;
|
||||
if (src_obj) *visible = !src_obj->proxy->src_invisible;
|
||||
else *visible = EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2706,29 +2723,47 @@ static void
|
|||
_proxy_unset(Evas_Object *proxy)
|
||||
{
|
||||
Evas_Object_Image *o = eo_data_get(proxy, MY_CLASS);
|
||||
Evas_Object_Protected_Data *cur_source;
|
||||
Evas_Object_Protected_Data *cur_proxy;
|
||||
Evas_Object_Proxy_Data *proxy_source_write;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
if (!o->cur.source) return;
|
||||
|
||||
Evas_Object_Protected_Data *cur_source = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
Evas_Object_Protected_Data *cur_proxy = eo_data_get(proxy, EVAS_OBJ_CLASS);
|
||||
cur_source = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
cur_proxy = eo_data_get(proxy, EVAS_OBJ_CLASS);
|
||||
|
||||
cur_source->proxy.proxies = eina_list_remove(cur_source->proxy.proxies, proxy);
|
||||
cur_proxy->proxy.is_proxy = EINA_FALSE;
|
||||
proxy_source_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&cur_source->proxy));
|
||||
proxy_source_write->proxies = eina_list_remove(proxy_source_write->proxies,
|
||||
proxy);
|
||||
|
||||
if (cur_source->proxy.src_invisible)
|
||||
if (proxy_source_write->src_invisible)
|
||||
{
|
||||
cur_source->proxy.src_invisible = EINA_FALSE;
|
||||
proxy_source_write->src_invisible = EINA_FALSE;
|
||||
cur_source->changed_src_visible = EINA_TRUE;
|
||||
evas_object_change(o->cur.source, cur_source);
|
||||
evas_object_smart_member_cache_invalidate(o->cur.source, EINA_FALSE,
|
||||
EINA_FALSE, EINA_TRUE);
|
||||
}
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&cur_source->proxy),
|
||||
proxy_source_write);
|
||||
|
||||
o->cur.source = NULL;
|
||||
|
||||
if (o->cur.defmap)
|
||||
{
|
||||
evas_map_free(o->cur.defmap);
|
||||
o->cur.defmap = NULL;
|
||||
}
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&cur_proxy->proxy));
|
||||
proxy_write->is_proxy = EINA_FALSE;
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&cur_proxy->proxy),
|
||||
proxy_write);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2737,15 +2772,31 @@ _proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src)
|
|||
Evas_Object_Protected_Data *src = eo_data_get(eo_src, EVAS_OBJ_CLASS);
|
||||
Evas_Object_Protected_Data *proxy = eo_data_get(eo_proxy, EVAS_OBJ_CLASS);
|
||||
Evas_Object_Image *o = eo_data_get(eo_proxy, MY_CLASS);
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
Evas_Object_Proxy_Data *proxy_src_write;
|
||||
|
||||
evas_object_image_file_set(eo_proxy, NULL, NULL);
|
||||
|
||||
proxy->proxy.is_proxy = EINA_TRUE;
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&proxy->proxy));
|
||||
proxy_write->is_proxy = EINA_TRUE;
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&proxy->proxy),
|
||||
proxy_write);
|
||||
|
||||
o->cur.source = eo_src;
|
||||
o->load_error = EVAS_LOAD_ERROR_NONE;
|
||||
|
||||
src->proxy.proxies = eina_list_append(src->proxy.proxies, eo_proxy);
|
||||
src->proxy.redraw = EINA_TRUE;
|
||||
proxy_src_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy));
|
||||
|
||||
proxy_src_write->proxies = eina_list_append(proxy_src_write->proxies,
|
||||
eo_proxy);
|
||||
proxy_src_write->redraw = EINA_TRUE;
|
||||
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&src->proxy),
|
||||
proxy_src_write);
|
||||
}
|
||||
|
||||
/* Some moron just set a proxy on a proxy.
|
||||
|
@ -2821,48 +2872,53 @@ static void
|
|||
_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
|
||||
{
|
||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||
Evas_Object_Protected_Data *source;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
void *ctx;
|
||||
/* Evas_Object *eo_obj2, *clip;*/
|
||||
int w, h;
|
||||
|
||||
if (!eo_source) return;
|
||||
Evas_Object_Protected_Data *source = eo_data_get(eo_source, EVAS_OBJ_CLASS);
|
||||
source = eo_data_get(eo_source, EVAS_OBJ_CLASS);
|
||||
|
||||
w = source->cur.geometry.w;
|
||||
h = source->cur.geometry.h;
|
||||
|
||||
source->proxy.redraw = EINA_FALSE;
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
(const Eina_Cow_Data**)&source->proxy);
|
||||
|
||||
proxy_write->redraw = EINA_FALSE;
|
||||
|
||||
/* We need to redraw surface then */
|
||||
if ((source->proxy.surface) &&
|
||||
((source->proxy.w != w) || (source->proxy.h != h)))
|
||||
if ((proxy_write->surface) &&
|
||||
((proxy_write->w != w) || (proxy_write->h != h)))
|
||||
{
|
||||
e->engine.func->image_map_surface_free(e->engine.data.output,
|
||||
source->proxy.surface);
|
||||
source->proxy.surface = NULL;
|
||||
proxy_write->surface);
|
||||
proxy_write->surface = NULL;
|
||||
}
|
||||
|
||||
/* FIXME: Hardcoded alpha 'on' */
|
||||
/* FIXME (cont): Should see if the object has alpha */
|
||||
if (!source->proxy.surface)
|
||||
if (!proxy_write->surface)
|
||||
{
|
||||
source->proxy.surface = e->engine.func->image_map_surface_new
|
||||
proxy_write->surface = e->engine.func->image_map_surface_new
|
||||
(e->engine.data.output, w, h, 1);
|
||||
if (!source->proxy.surface) return;
|
||||
source->proxy.w = w;
|
||||
source->proxy.h = h;
|
||||
if (!proxy_write->surface) goto end;
|
||||
proxy_write->w = w;
|
||||
proxy_write->h = h;
|
||||
}
|
||||
|
||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||
e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0);
|
||||
e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
||||
e->engine.func->rectangle_draw(e->engine.data.output, ctx,
|
||||
source->proxy.surface, 0, 0, w, h,
|
||||
proxy_write->surface, 0, 0, w, h,
|
||||
do_async);
|
||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||
|
||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||
evas_render_mapped(e, eo_source, source, ctx, source->proxy.surface,
|
||||
evas_render_mapped(e, eo_source, source, ctx, proxy_write->surface,
|
||||
-source->cur.geometry.x,
|
||||
-source->cur.geometry.y,
|
||||
1, 0, 0, e->output.w, e->output.h, EINA_TRUE
|
||||
|
@ -2872,8 +2928,8 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
|
|||
, do_async);
|
||||
|
||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||
source->proxy.surface = e->engine.func->image_dirty_region
|
||||
(e->engine.data.output, source->proxy.surface, 0, 0, w, h);
|
||||
proxy_write->surface = e->engine.func->image_dirty_region
|
||||
(e->engine.data.output, proxy_write->surface, 0, 0, w, h);
|
||||
/*
|
||||
ctx = e->engine.func->context_new(e->engine.data.output);
|
||||
if (eo_isa(source, EVAS_OBJ_SMART_CLASS))
|
||||
|
@ -2882,7 +2938,7 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
|
|||
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(source), obj2)
|
||||
{
|
||||
_proxy_subrender_recurse(obj2, clip, e->engine.data.output,
|
||||
source->proxy.surface,
|
||||
proxy_write->surface,
|
||||
ctx,
|
||||
-source->cur.geometry.x,
|
||||
-source->cur.geometry.y);
|
||||
|
@ -2893,15 +2949,19 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
|
|||
if (!source->pre_render_done)
|
||||
source->func->render_pre(source);
|
||||
source->func->render(source, e->engine.data.output, ctx,
|
||||
source->proxy.surface,
|
||||
proxy_write->surface,
|
||||
-source->cur.geometry.x,
|
||||
-source->cur.geometry.y);
|
||||
}
|
||||
|
||||
e->engine.func->context_free(e->engine.data.output, ctx);
|
||||
source->proxy.surface = e->engine.func->image_dirty_region
|
||||
(e->engine.data.output, source->proxy.surface, 0, 0, w, h);
|
||||
proxy_write->surface = e->engine.func->image_dirty_region
|
||||
(e->engine.data.output, proxy_write->surface, 0, 0, w, h);
|
||||
*/
|
||||
end:
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
(const Eina_Cow_Data**)&source->proxy,
|
||||
proxy_write);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3268,11 +3328,11 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
|
|||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
}
|
||||
else if (source->proxy.surface && !source->proxy.redraw)
|
||||
else if (source->proxy->surface && !source->proxy->redraw)
|
||||
{
|
||||
pixels = source->proxy.surface;
|
||||
imagew = source->proxy.w;
|
||||
imageh = source->proxy.h;
|
||||
pixels = source->proxy->surface;
|
||||
imagew = source->proxy->w;
|
||||
imageh = source->proxy->h;
|
||||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
}
|
||||
|
@ -3291,9 +3351,9 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
|
|||
{
|
||||
o->proxyrendering = EINA_TRUE;
|
||||
_proxy_subrender(obj->layer->evas->evas, o->cur.source, EINA_FALSE);
|
||||
pixels = source->proxy.surface;
|
||||
imagew = source->proxy.w;
|
||||
imageh = source->proxy.h;
|
||||
pixels = source->proxy->surface;
|
||||
imagew = source->proxy->w;
|
||||
imageh = source->proxy->h;
|
||||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
o->proxyrendering = EINA_FALSE;
|
||||
|
@ -3617,7 +3677,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
|
|||
if (o->cur.source)
|
||||
{
|
||||
Evas_Object_Protected_Data *source = eo_data_get(o->cur.source, EVAS_OBJ_CLASS);
|
||||
if (source->proxy.redraw || source->changed)
|
||||
if (source->proxy->redraw || source->changed)
|
||||
{
|
||||
/* XXX: Do I need to sort out the map here? */
|
||||
evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, obj);
|
||||
|
@ -4149,11 +4209,11 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
|
|||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
}
|
||||
else if (source->proxy.surface && !source->proxy.redraw)
|
||||
else if (source->proxy->surface && !source->proxy->redraw)
|
||||
{
|
||||
pixels = source->proxy.surface;
|
||||
imagew = source->proxy.w;
|
||||
imageh = source->proxy.h;
|
||||
pixels = source->proxy->surface;
|
||||
imagew = source->proxy->w;
|
||||
imageh = source->proxy->h;
|
||||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
}
|
||||
|
@ -4172,9 +4232,9 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
|
|||
{
|
||||
o->proxyrendering = EINA_TRUE;
|
||||
_proxy_subrender(obj->layer->evas->evas, o->cur.source, EINA_FALSE);
|
||||
pixels = source->proxy.surface;
|
||||
imagew = source->proxy.w;
|
||||
imageh = source->proxy.h;
|
||||
pixels = source->proxy->surface;
|
||||
imagew = source->proxy->w;
|
||||
imageh = source->proxy->h;
|
||||
uvw = imagew;
|
||||
uvh = imageh;
|
||||
o->proxyrendering = EINA_FALSE;
|
||||
|
|
|
@ -24,24 +24,41 @@ get_layer_objects(Evas_Layer *l)
|
|||
}
|
||||
|
||||
/* evas internal stuff */
|
||||
static const Evas_Object_Proxy_Data default_proxy = {
|
||||
NULL, NULL, 0, 0, NULL, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
Eina_Cow *evas_object_proxy_cow = NULL;
|
||||
|
||||
static void
|
||||
_constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj;
|
||||
|
||||
eo_do_super(eo_obj, eo_constructor());
|
||||
eo_do(eo_obj, evas_obj_type_set(MY_CLASS_NAME));
|
||||
eo_manual_free_set(eo_obj, EINA_TRUE);
|
||||
|
||||
Evas_Object_Protected_Data *obj = _pd;
|
||||
obj = _pd;
|
||||
if (!obj)
|
||||
{
|
||||
eo_error_set(eo_obj);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!evas_object_proxy_cow)
|
||||
evas_object_proxy_cow = eina_cow_add("Evas Proxy", sizeof (Evas_Object_Proxy_Data), 8, &default_proxy);
|
||||
if (!evas_object_proxy_cow)
|
||||
{
|
||||
eo_error_set(eo_obj);
|
||||
return;
|
||||
}
|
||||
|
||||
obj->cur.scale = 1.0;
|
||||
obj->prev.scale = 1.0;
|
||||
obj->is_frame = EINA_FALSE;
|
||||
obj->object = eo_obj;
|
||||
obj->proxy = eina_cow_alloc(evas_object_proxy_cow);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -133,6 +150,7 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
|||
{
|
||||
EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints);
|
||||
}
|
||||
eina_cow_free(evas_object_proxy_cow, obj->proxy);
|
||||
eo_manual_free(eo_obj);
|
||||
}
|
||||
|
||||
|
@ -166,7 +184,7 @@ evas_object_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
evas_object_change(eo_obj2, obj2);
|
||||
}
|
||||
}
|
||||
EINA_LIST_FOREACH(obj->proxy.proxies, l, eo_obj2)
|
||||
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_obj2)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj2 = eo_data_get(eo_obj2, MY_CLASS);
|
||||
if (!obj2) continue;
|
||||
|
@ -557,8 +575,8 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
|
|||
evas_object_grabs_cleanup(eo_obj, obj);
|
||||
while (obj->clip.clipees)
|
||||
evas_object_clip_unset(obj->clip.clipees->data);
|
||||
while (obj->proxy.proxies)
|
||||
evas_object_image_source_unset(obj->proxy.proxies->data);
|
||||
while (obj->proxy->proxies)
|
||||
evas_object_image_source_unset(obj->proxy->proxies->data);
|
||||
if (obj->cur.clipper) evas_object_clip_unset(eo_obj);
|
||||
evas_object_map_set(eo_obj, NULL);
|
||||
if (obj->is_smart) evas_object_smart_del(eo_obj);
|
||||
|
|
|
@ -217,10 +217,19 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
|
|||
{
|
||||
/* Flag need redraw on proxy too */
|
||||
evas_object_clip_recalc(eo_obj, obj);
|
||||
EINA_LIST_FOREACH(obj->proxy.proxies, l, eo_proxy)
|
||||
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_proxy)
|
||||
{
|
||||
Evas_Object_Protected_Data *proxy = eo_data_get(eo_proxy, EVAS_OBJ_CLASS);
|
||||
proxy->proxy.redraw = EINA_TRUE;
|
||||
Evas_Object_Protected_Data *proxy;
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
proxy = eo_data_get(eo_proxy, EVAS_OBJ_CLASS);
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&proxy->proxy));
|
||||
proxy_write->redraw = EINA_TRUE;
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&proxy->proxy),
|
||||
proxy_write);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,12 +245,20 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
|
|||
/* Flag need redraw on proxy too */
|
||||
evas_object_clip_recalc(eo_obj, obj);
|
||||
obj->func->render_pre(eo_obj, obj);
|
||||
if (obj->proxy.redraw)
|
||||
if (obj->proxy->redraw)
|
||||
_evas_render_prev_cur_clip_cache_add(e, obj);
|
||||
if (obj->proxy.proxies)
|
||||
if (obj->proxy->proxies)
|
||||
{
|
||||
obj->proxy.redraw = EINA_TRUE;
|
||||
EINA_LIST_FOREACH(obj->proxy.proxies, l, eo_proxy)
|
||||
Evas_Object_Proxy_Data *proxy_write;
|
||||
|
||||
proxy_write = eina_cow_write(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&obj->proxy));
|
||||
proxy_write->redraw = EINA_TRUE;
|
||||
eina_cow_done(evas_object_proxy_cow,
|
||||
((const Eina_Cow_Data**)&obj->proxy),
|
||||
proxy_write);
|
||||
|
||||
EINA_LIST_FOREACH(obj->proxy->proxies, l, eo_proxy)
|
||||
{
|
||||
Evas_Object_Protected_Data *proxy = eo_data_get(eo_proxy, EVAS_OBJ_CLASS);
|
||||
proxy->func->render_pre(eo_proxy, proxy);
|
||||
|
|
|
@ -110,7 +110,7 @@ evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro
|
|||
{
|
||||
if (obj->parent_cache.src_invisible_valid)
|
||||
return obj->parent_cache.src_invisible;
|
||||
if (obj->proxy.proxies && obj->proxy.src_invisible) return 1;
|
||||
if (obj->proxy->proxies && obj->proxy->src_invisible) return 1;
|
||||
if (!obj->smart.parent) return 0;
|
||||
Evas_Object_Protected_Data *smart_parent_pd =
|
||||
eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS);
|
||||
|
@ -190,7 +190,7 @@ evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
}
|
||||
/* FIXME: forcing object with proxies to stay active,
|
||||
need to be smarter and only do that when really needed. */
|
||||
if (obj->proxy.proxies && obj->changed)
|
||||
if (obj->proxy->proxies && obj->changed)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
|
|||
typedef struct _Evas_Smart_Interfaces_Array Evas_Smart_Interfaces_Array;
|
||||
typedef struct _Evas_Post_Callback Evas_Post_Callback;
|
||||
typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
|
||||
typedef struct _Evas_Object_Proxy_Data Evas_Object_Proxy_Data;
|
||||
|
||||
enum _Evas_Font_Style
|
||||
{
|
||||
|
@ -497,6 +498,18 @@ struct _Evas_Map
|
|||
Evas_Map_Point points[]; // actual points
|
||||
};
|
||||
|
||||
struct _Evas_Object_Proxy_Data
|
||||
{
|
||||
Eina_List *proxies;
|
||||
void *surface;
|
||||
int w,h;
|
||||
Eina_List *src_event_in;
|
||||
Eina_Bool redraw : 1;
|
||||
Eina_Bool is_proxy : 1;
|
||||
Eina_Bool src_invisible : 1;
|
||||
Eina_Bool src_events: 1;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Protected_Data
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -568,16 +581,7 @@ struct _Evas_Object_Protected_Data
|
|||
Evas_Object *parent;
|
||||
} smart;
|
||||
|
||||
struct {
|
||||
Eina_List *proxies;
|
||||
void *surface;
|
||||
int w,h;
|
||||
Eina_List *src_event_in;
|
||||
Eina_Bool redraw : 1;
|
||||
Eina_Bool is_proxy : 1;
|
||||
Eina_Bool src_invisible : 1;
|
||||
Eina_Bool src_events: 1;
|
||||
} proxy;
|
||||
const Evas_Object_Proxy_Data *proxy;
|
||||
|
||||
// Pointer to the Evas_Object itself
|
||||
Evas_Object *object;
|
||||
|
@ -1244,6 +1248,8 @@ Evas_Device *_evas_device_top_get(const Evas *e);
|
|||
void _evas_device_ref(Evas_Device *dev);
|
||||
void _evas_device_unref(Evas_Device *dev);
|
||||
|
||||
extern Eina_Cow *evas_object_proxy_cow;
|
||||
|
||||
/****************************************************************************/
|
||||
/*****************************************/
|
||||
/********************/
|
||||
|
|
Loading…
Reference in New Issue