canvas render: don't apply mask if the objects in the map.
Current mask is shared across the objects hierarchy, children would try to apply this mask on the rendering when it's enabled by the parent. but if the map is enabled from one of parents, children should not apply the parents mask but leaves it to the parent's job. @fix
This commit is contained in:
parent
ddcc7ab825
commit
eaafb9e4c5
|
@ -438,6 +438,18 @@ _evas_render_object_is_mask(Evas_Object_Protected_Data *obj)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static inline Evas_Object_Protected_Data *
|
||||
_evas_mask_owner_get(Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
Evas_Object_Protected_Data *parent = NULL;
|
||||
|
||||
if (!obj->smart.parent) return obj;
|
||||
parent = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
|
||||
if (parent->clip.mask != obj->clip.mask) return obj;
|
||||
|
||||
return _evas_mask_owner_get(parent);
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_render_phase1_direct(Evas_Public_Data *e,
|
||||
Eina_Inarray *active_objects,
|
||||
|
@ -2145,9 +2157,13 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
|
|||
if (obj->is_smart)
|
||||
{
|
||||
/* Clipper masks */
|
||||
if (obj->cur->clipper && (mapped > 1) &&
|
||||
_evas_render_object_is_mask(obj->cur->clipper))
|
||||
if (obj->cur->clipper && (mapped > 1) && _evas_render_object_is_mask(obj->cur->clipper))
|
||||
{
|
||||
//Apply only owner mask in the map
|
||||
Evas_Object_Protected_Data *owner = _evas_mask_owner_get(obj);
|
||||
if (owner == obj || (_evas_render_has_map(owner) && !_evas_render_can_map(owner)))
|
||||
_evas_render_mapped_mask(evas, obj, obj->cur->clipper, proxy_render_data, output, ctx, off_x, off_y, level, do_async);
|
||||
}
|
||||
else if (!proxy_src_clip && proxy_render_data)
|
||||
{
|
||||
if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y))
|
||||
|
@ -2193,6 +2209,10 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
|
|||
ENFN->context_clip_clip(ENC, ctx, clip->x + off_x, clip->y + off_y, clip->w, clip->h);
|
||||
|
||||
if (obj->cur->clipper && (mapped > 1))
|
||||
{
|
||||
//Apply only owner mask in the map
|
||||
Evas_Object_Protected_Data *owner = _evas_mask_owner_get(obj);
|
||||
if (owner == obj || (_evas_render_has_map(owner) && !_evas_render_can_map(owner)))
|
||||
{
|
||||
Evas_Object_Protected_Data *mask = obj->clip.mask;
|
||||
|
||||
|
@ -2224,6 +2244,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
|
|||
/* Clipper masks */
|
||||
_evas_render_mapped_mask(evas, obj, mask, proxy_render_data, output, ctx, off_x, off_y, level, do_async);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef REND_DBG
|
||||
int _c, _cx, _cy, _cw, _ch;
|
||||
|
|
Loading…
Reference in New Issue