From: cedric Date: Tue, 7 Aug 2012 09:43:22 +0000 (+0000) Subject: evas: properly warn when linking object from different canvas. X-Git-Tag: accepted/2.0/20130306.225542~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3638c00bc160460ca1342cf091aaeb8cf4e9c023;p=profile%2Fivi%2Fevas.git evas: properly warn when linking object from different canvas. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@74968 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_clip.c b/src/lib/canvas/evas_clip.c index 6baa28c..1597bfc 100644 --- a/src/lib/canvas/evas_clip.c +++ b/src/lib/canvas/evas_clip.c @@ -176,14 +176,44 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) return; MAGIC_CHECK_END(); if (obj->cur.clipper == clip) return; - if (obj == clip) return; + if (obj == clip) + { + CRIT("Setting clip %p on itself", obj) + return; + } + if (clip->delete_me) + { + CRIT("Setting deleted object %p as clip obj %p", clip, obj); + abort(); + return; + } + if (obj->delete_me) + { + CRIT("Setting object %p as clip to deleted obj %p", clip, obj); + abort(); + return; + } + if (!obj->layer) + { + CRIT("No evas surface associated with object (%p)", obj); + abort(); + return; + } + if ((obj->layer && clip->layer) && + (obj->layer->evas != clip->layer->evas)) + { + CRIT("Setting object %p from Evas (%p) to another Evas (%p)", obj, obj->layer->evas, clip->layer->evas); + abort(); + return; + } + if (evas_object_intercept_call_clip_set(obj, clip)) return; // illegal to set anything but a rect as a clip - /* if (clip->type != o_rect_type) */ - /* { */ - /* ERR("For now a clip on other object than a rectangle is disabled"); */ - /* return; */ - /* } */ + if (clip->type != o_rect_type) + { + ERR("For now a clip on other object than a rectangle is disabled"); + return; + } if (obj->smart.smart) { if (obj->smart.smart->smart_class->clip_set) diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index 84b1c4c..c55e1e8 100755 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -447,7 +447,37 @@ evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) return EINA_FALSE; MAGIC_CHECK_END(); - if (src == obj) return EINA_FALSE; + if (obj->delete_me) + { + CRIT("Setting deleted object %p as image source %p", src, obj); + abort(); + return EINA_FALSE; + } + if (src->delete_me) + { + CRIT("Setting object %p to deleted image source %p", src, obj); + abort(); + return EINA_FALSE; + } + if (!src->layer) + { + CRIT("No evas surface associated with source object (%p)", obj); + abort(); + return EINA_FALSE; + } + if ((obj->layer && src->layer) && + (obj->layer->evas != src->layer->evas)) + { + CRIT("Setting object %p from Evas (%p) from another Evas (%p)", src, src->layer->evas, obj->layer->evas); + abort(); + return EINA_FALSE; + } + if (src == obj) + { + CRIT("Setting object %p as a source for itself", obj); + abort(); + return EINA_FALSE; + } if (o->cur.source == src) return EINA_TRUE; _evas_object_image_cleanup(obj, o);