Evas smart: Mark all smart clippers as no_render
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 5 Apr 2016 08:19:55 +0000 (17:19 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 5 Apr 2016 09:20:36 +0000 (18:20 +0900)
This allows doing ugly things such as setting a clipper/mask
on any smart object, without having to worry about seeing a
white rectangle cover the whole screen.

While the above scenario is not a great idea (bypass elementary in
its handling of the clipper), having a big white rect covering the
entire UI seems even worse.

I wonder if elm objects shouldn't simply allow user clippers, and
somehow manage them along with the smart object internal clipper.

src/lib/evas/canvas/evas_object_smart.c
src/lib/evas/canvas/evas_object_smart_clipped.c

index 57c8801..461338d 100644 (file)
@@ -682,9 +682,20 @@ 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;
+   Evas_Object_Smart_Clipped_Data *cso;
+   Evas_Object *cso_clipper;
+
+   if (eo_isa(eo_obj, EVAS_SMART_CLIPPED_CLASS))
+     cso = eo_data_scope_get(eo_obj, EVAS_SMART_CLIPPED_CLASS);
+   else
+     cso = evas_object_smart_data_get(eo_obj);
+   cso_clipper = cso ? cso->clipper : NULL;
 
    EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2)
-     evas_obj_no_render_set(obj2->object, hide);
+     {
+        if (cso_clipper != obj2->object)
+          evas_obj_no_render_set(obj2->object, hide);
+     }
 }
 
 EOLIAN static void
index c066e03..8584223 100644 (file)
@@ -63,6 +63,7 @@ evas_object_smart_clipped_smart_add(Evas_Object *eo_obj)
    evas_object_resize(cso->clipper, 200000, 200000);
    evas_object_pass_events_set(cso->clipper, 1);
    evas_object_hide(cso->clipper); /* show when have something clipped to it */
+   evas_obj_no_render_set(cso->clipper, 1);
 
    evas_object_smart_data_set(eo_obj, cso);
 }