Evas render: Fix no-render with smart objects

Setting the no-render flag on an elm widget had no effect,
as it was not properly propagated to its children. This should
fix that, but I'm not a fan of the solution.

Fixes T3371
This commit is contained in:
Jean-Philippe Andre 2016-03-28 17:47:02 +09:00
parent b6a81b6e7b
commit 8fb8e6d257
9 changed files with 53 additions and 6 deletions

View File

@ -2234,6 +2234,7 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Evas.Object_Smart.resize;
Evas.Object_Smart.smart_no_render.set;
Efl.File.file.set;
Efl.File.file.get;
Efl.File.mmap.set;

View File

@ -331,6 +331,19 @@ _edje_object_evas_object_smart_hide(Eo *obj, Edje *ed)
_edje_emit(ed, "hide", NULL);
}
EOLIAN static void
_edje_object_evas_object_smart_smart_no_render_set(Eo *obj, Edje *ed, Eina_Bool hide)
{
Eina_List *l;
Edje *edg;
evas_obj_smart_no_render_set(eo_super(obj, MY_CLASS), hide);
if (evas_obj_no_render_get(obj) == hide) return;
EINA_LIST_FOREACH(ed->groups, l, edg)
if (edg != ed) evas_obj_smart_no_render_set(edg->obj, hide);
}
EOLIAN static void
_edje_object_evas_object_smart_calculate(Eo *obj EINA_UNUSED, Edje *ed)
{

View File

@ -555,6 +555,21 @@ _elm_widget_evas_object_smart_color_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA
eina_iterator_free(it);
}
EOLIAN static void
_elm_widget_evas_object_smart_smart_no_render_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Eina_Bool hide)
{
Eina_Iterator *it;
Evas_Object *o;
it = evas_object_smart_iterator_new(obj);
EINA_ITERATOR_FOREACH(it, o)
{
if (evas_object_data_get(o, "_elm_leaveme")) continue;
evas_obj_no_render_set(o, hide);
}
eina_iterator_free(it);
}
EOLIAN static void
_elm_widget_evas_object_smart_clip_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *clip)
{
@ -602,6 +617,7 @@ _elm_widget_evas_object_smart_member_add(Eo *obj, Elm_Widget_Smart_Data *_pd EIN
evas_object_color_get(obj, &r, &g, &b, &a);
evas_object_color_set(child, r, g, b, a);
evas_obj_no_render_set(child, evas_obj_no_render_get(obj));
evas_object_clip_set(child, evas_object_clip_get(obj));
if (evas_object_visible_get(obj))

View File

@ -851,6 +851,7 @@ abstract Elm.Widget (Evas.Object_Smart, Elm.Interface_Atspi_Accessible, Elm.Inte
Evas.Object_Smart.clip.set;
Evas.Object_Smart.member_add;
Evas.Object_Smart.resize;
Evas.Object_Smart.smart_no_render.set;
@virtual .focus_direction;
@virtual .focus_next;
@virtual .parent_widget.get;

View File

@ -537,9 +537,11 @@ _evas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj
}
EOLIAN void
_evas_object_no_render_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool enable)
_evas_object_no_render_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool enable)
{
obj->no_render = enable;
if (obj->is_smart)
evas_obj_smart_no_render_set(eo_obj, enable);
}
EOLIAN Eina_Bool

View File

@ -678,6 +678,15 @@ _evas_object_smart_clip_unset(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED)
if (s && s->smart_class->clip_unset) s->smart_class->clip_unset(eo_obj);
}
EOLIAN static void
_evas_object_smart_smart_no_render_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSED, Eina_Bool hide)
{
Evas_Object_Protected_Data *obj2;
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
evas_obj_no_render_set(obj2->object, hide);
}
EOLIAN static void
_evas_object_smart_attach(Eo *eo_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Smart *s)
{

View File

@ -113,6 +113,11 @@ class Evas.Object_Smart (Evas.Object, Evas.Signal_Interface)
@in y: Evas.Coord;
}
}
@property smart_no_render {
[[Propagates the value of no-render to the smart children.]]
set { legacy: null; }
values { hide: bool; }
}
callbacks_descriptions_set {
[[Set an smart object instance's smart callbacks descriptions.

View File

@ -534,12 +534,12 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
obj->is_active = is_active;
#ifdef REND_DBG
RD(level, "[--- PROCESS [%p (eo: %p)", obj, obj->object);
RD(level, "[--- PROCESS [%p", obj->object);
IFRD(obj->name, 0, " '%s'", obj->name);
RD(0, "] '%s' active = %i, del = %i | %i %i %ix%i\n", obj->type, is_active, obj->delete_me, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
#endif
if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0)))
if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0)) && !obj->no_render)
OBJ_ARRAY_PUSH(active_objects, obj);
if (is_active && obj->cur->snapshot && !obj->delete_me &&
evas_object_is_visible(eo_obj, obj))
@ -2292,7 +2292,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
if (obj == top) break;
/* if it's in our outpout rect and it doesn't clip anything */
RD(level, " OBJ: [%p", obj);
RD(level, " OBJ: [%p", eo_obj);
IFRD(obj->name, 0, " '%s'", obj->name);
RD(level, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||

View File

@ -137,8 +137,8 @@ evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro
static inline int
evas_object_is_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{ /* post 1.0 -> enable? */
if ((obj->cur->visible)/* && (obj->cur->color.a > 0)*/ &&
{
if ((obj->cur->visible) && (!obj->no_render) &&
((obj->cur->cache.clip.visible) || (obj->is_smart)) &&
((obj->cur->cache.clip.a > 0 && obj->cur->render_op == EVAS_RENDER_BLEND)
|| obj->cur->render_op != EVAS_RENDER_BLEND))