forked from enlightenment/efl
evas/clip: If the clipper is image or has color, clipped area should be redrawn.
Summary: If the clipper is image or has color, it affects to its clipees. Even if we unset the clipper or change the clipper to another object, it seems the clipper is not changed. Test Plan: Make two clipper objects and one clipee object. And make clip the clipee according to following example ex) Clipee object -> inner_clipper -> clipper evas_object_clip_set(clipee, inner_clipper); evas_object_clip_set(inner_clipper, clipper); After checking the result and hide inner_clipper. evas_object_clip_set(clipee, clipper); evas_object_hide(inner_clipper); See the result. Reviewers: raster, cedric, Hermet, jpeg Subscribers: woohyun, cedric Differential Revision: https://phab.enlightenment.org/D2112 Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com> Note: Technically we should not check the color of the fact that the clipper is a mask and not a simple rect. But because of real-life performance issues, damage_add was disabled so we're trying to keep the perf in most cases while being correct in cases where the clipper is visually important.
This commit is contained in:
parent
57a4cae33b
commit
84634ea51f
|
@ -294,8 +294,13 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
|
|||
EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
|
||||
/* i know this was to handle a case where a clip stops having children and
|
||||
* becomes a solid colored box - no one ever does that... they hide the clip
|
||||
* so dont add damages
|
||||
if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
|
||||
* so dont add damages.
|
||||
* But, if the clipper could affect color to its clipees,
|
||||
* the clipped area should be redrawn. */
|
||||
if (((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible)) &&
|
||||
(((obj->cur->clipper->cur->color.r != 255) || (obj->cur->clipper->cur->color.g != 255) ||
|
||||
(obj->cur->clipper->cur->color.b != 255) || (obj->cur->clipper->cur->color.a != 255)) ||
|
||||
(obj->cur->clipper->mask->is_mask)))
|
||||
{
|
||||
if (obj->cur->clipper->layer)
|
||||
{
|
||||
|
@ -307,7 +312,7 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
|
|||
obj->cur->clipper->cur->geometry.h);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
_evas_object_clip_mask_unset(obj->cur->clipper);
|
||||
}
|
||||
evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
|
||||
|
@ -417,8 +422,13 @@ _evas_object_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
|
||||
/* i know this was to handle a case where a clip stops having children and
|
||||
* becomes a solid colored box - no one ever does that... they hide the clip
|
||||
* so dont add damages
|
||||
if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
|
||||
* so dont add damages.
|
||||
* But, if the clipper could affect color to its clipees,
|
||||
* the clipped area should be redrawn. */
|
||||
if (((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible)) &&
|
||||
(((obj->cur->clipper->cur->color.r != 255) || (obj->cur->clipper->cur->color.g != 255) ||
|
||||
(obj->cur->clipper->cur->color.b != 255) || (obj->cur->clipper->cur->color.a != 255)) ||
|
||||
(obj->cur->clipper->mask->is_mask)))
|
||||
{
|
||||
if (obj->cur->clipper->layer)
|
||||
{
|
||||
|
@ -430,7 +440,7 @@ _evas_object_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
obj->cur->clipper->cur->geometry.h);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
_evas_object_clip_mask_unset(obj->cur->clipper);
|
||||
}
|
||||
evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
|
||||
|
|
Loading…
Reference in New Issue