evas: Fix masks of masks and clippers of clippers in general

The root cause was simple: smart object clipped was not
calling efl_super() on clip_set.

Fixes T4813 (and probably a whole lot of other bugs)
This commit is contained in:
Jean-Philippe Andre 2016-11-08 14:47:50 +09:00
parent 98fe627ca4
commit f909a6d6ea
6 changed files with 21 additions and 27 deletions

View File

@ -2016,6 +2016,8 @@ _efl_canvas_video_efl_canvas_object_clip_set(Evas_Object *obj, Efl_Canvas_Video_
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip))
return;
efl_canvas_object_clip_set(efl_super(obj, MY_CLASS), clip);
if (sd->crop.clipper) evas_object_clip_set(sd->crop.clipper, clip);
else evas_object_clip_set(sd->obj, clip);
evas_object_clip_set(sd->bg, clip);

View File

@ -2514,7 +2514,6 @@ enum _Evas_Object_Intercept_Cb_Type
EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET,
EVAS_OBJECT_INTERCEPT_CB_COLOR_SET,
EVAS_OBJECT_INTERCEPT_CB_CLIP_SET,
EVAS_OBJECT_INTERCEPT_CB_CLIP_UNSET,
};
typedef enum _Evas_Object_Intercept_Cb_Type Evas_Object_Intercept_Cb_Type;

View File

@ -433,7 +433,7 @@ static void
_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
if (_efl_canvas_object_clip_unset_block(eo_obj, obj)) return;
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_UNSET, 1)) return;
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 1, NULL)) return;
if (obj->is_smart && obj->smart.smart && obj->smart.smart->smart_class &&
obj->smart.smart->smart_class->clip_unset)
{

View File

@ -195,18 +195,17 @@ _evas_object_intercept_call(Evas_Object *eo_obj, Evas_Object_Intercept_Cb_Type c
}
if (!obj->interceptors) goto end_noblock;
blocked = evas_object_intercept_call_clip_set(eo_obj, obj, eo_other);
break;
}
// else: fallthrough to unset
case EVAS_OBJECT_INTERCEPT_CB_CLIP_UNSET:
if (!internal)
else
{
if (_efl_canvas_object_clip_unset_block(eo_obj, obj))
goto end_block;
if (!internal)
{
if (_efl_canvas_object_clip_unset_block(eo_obj, obj))
goto end_block;
}
if (!obj->interceptors) goto end_noblock;
blocked = evas_object_intercept_call_clip_unset(eo_obj, obj);
}
if (!obj->interceptors) goto end_noblock;
blocked = evas_object_intercept_call_clip_unset(eo_obj, obj);
break;
}

View File

@ -166,18 +166,12 @@ evas_object_smart_clipped_smart_clip_unset(Evas_Object *eo_obj)
EOLIAN static void
_efl_canvas_group_clipped_efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Smart_Clipped_Data *obj EINA_UNUSED, Evas_Object *clip)
{
if (clip)
{
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip))
return;
evas_object_smart_clipped_smart_clip_set(eo_obj, clip);
}
else
{
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_UNSET, 0))
return;
evas_object_smart_clipped_smart_clip_unset(eo_obj);
}
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_CLIP_SET, 0, clip))
return;
efl_canvas_object_clip_set(efl_super(eo_obj, MY_CLASS), clip);
if (clip) evas_object_smart_clipped_smart_clip_set(eo_obj, clip);
else evas_object_smart_clipped_smart_clip_unset(eo_obj);
}
static void

View File

@ -37,7 +37,7 @@
static int
_bgra_compare(unsigned int *data, unsigned int *ref, int w, int h)
{
int i,j;
int i, j, ret = 0;
for (j = 0; j < h; j++)
{
#if 0
@ -50,12 +50,12 @@ _bgra_compare(unsigned int *data, unsigned int *ref, int w, int h)
for (i = 0; i < w; i++)
if (data[i+j*w] != ref[i+j*w])
{
printf("Pixel %d differ: %#x vs. %#x\n", i+j*w, data[i+j*w], ref[i+j*w]);
printf("Pixel %2dx%-2d differ: %#x vs. %#x\n", i, j, data[i+j*w], ref[i+j*w]);
fflush(stdout);
return 1;
ret = 1;
}
}
return 0;
return ret;
}
// The usual useless unit test