aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-05-12 17:37:01 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-15 16:59:41 +0900
commit111e51a6ff35c3bf4dc835775b44b630e0191ba1 (patch)
tree92eb947706f0b9a6d3fafc05b98faebb690e7d0b /src/lib
parentEdje: Add clip as a property of a part description (diff)
downloadefl-111e51a6ff35c3bf4dc835775b44b630e0191ba1.tar.gz
Evas: Add "no-render" flag for proxy sources & clippers
Those objects should never be rendered on the canvas, even if they are visible. On the other hand, they need to be rendered in mask or proxy surfaces. note: this patch includes some extra whitespaces changes :( @feature
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/edje_data.c1
-rw-r--r--src/lib/edje/edje_load.c3
-rw-r--r--src/lib/edje/edje_private.h1
-rw-r--r--src/lib/evas/canvas/evas_clip.c11
-rw-r--r--src/lib/evas/canvas/evas_object.eo35
-rw-r--r--src/lib/evas/canvas/evas_render.c21
-rw-r--r--src/lib/evas/include/evas_inline.x2
-rw-r--r--src/lib/evas/include/evas_private.h1
8 files changed, 65 insertions, 10 deletions
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index d81ad241ff..2352e8541f 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -1197,6 +1197,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source6", source6, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "id", id, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "clip_to_id", clip_to_id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "no_render", no_render, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.x", dragable.x, EET_T_CHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.step_x", dragable.step_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_x", dragable.count_x, EET_T_INT);
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 5839e6dc03..e9c4f20441 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -774,6 +774,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
nested_smart = NULL;
}
+ if (ep->no_render)
+ eo_do(rp->object, evas_obj_no_render_set(1));
+
if (st_nested && st_nested->nested_children_count) /* Add this to list of children */
{
evas_object_smart_member_add(rp->object,
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index ee28bba0c8..d3507cb581 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1140,6 +1140,7 @@ struct _Edje_Part
unsigned char access; /* it will be used accessibility feature */
Edje_Part_Api api;
unsigned char nested_children_count;
+ unsigned char no_render; /* for proxy sources and masks, since 1.15 */
};
struct _Edje_Part_Image_Id
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index a6f1e6f124..cf5b1cc6a9 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -491,3 +491,14 @@ _evas_object_clipees_has(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj
return (obj->clip.clipees ? EINA_TRUE : EINA_FALSE);
}
+EOLIAN void
+_evas_object_no_render_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool enable)
+{
+ obj->no_render = enable;
+}
+
+EOLIAN Eina_Bool
+_evas_object_no_render_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
+{
+ return obj->no_render;
+}
diff --git a/src/lib/evas/canvas/evas_object.eo b/src/lib/evas/canvas/evas_object.eo
index 809a45099a..060b0692ea 100644
--- a/src/lib/evas/canvas/evas_object.eo
+++ b/src/lib/evas/canvas/evas_object.eo
@@ -1280,6 +1280,41 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx.Base, Efl.Gfx.Stac
@in type: const(char)* @nonull; /*@ The type (name string) to check for. Must be the name */
}
}
+ @property no_render {
+ get {
+ /*@
+ Returns the state of the "no-render" flag, which means, when true,
+ that an object should never be rendered on the canvas.
+
+ This flag can be used to avoid rendering visible clippers on the
+ canvas, even if they currently don't clip any object.
+
+ @since 1.15 */
+ legacy: null;
+ }
+ set {
+ /*@
+ Disable all rendering on the canvas.
+
+ This flag will be used to indicate to Evas that this object should
+ never be rendered on the canvas under any circurmstances. In
+ particular, this is useful to avoid drawing clipper objects (or masks)
+ even when they don't clip any object. This can also be used to replace
+ the old source_visible flag with proxy objects.
+
+ This is different to the visible property, as even visible objects
+ marked as "no-render" will never appear on screen. But those objects
+ can still be used as proxy sources or clippers. When hidden, all
+ "no-render" objects will completely disappear from the canvas, and
+ hide their clippees or be invisible when used as proxy sources.
+
+ @since 1.15 */
+ legacy: null;
+ }
+ values {
+ enable: bool; /*@ Enable "no-render" mode. */
+ }
+ }
}
implements {
Eo.Base.constructor;
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index b97552cd11..ed75d0a56f 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -227,7 +227,8 @@ _evas_render_is_relevant(Evas_Object *eo_obj)
static Eina_Bool
_evas_render_can_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
- return (evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees));
+ return (evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees) &&
+ !obj->no_render);
}
static void
@@ -1232,7 +1233,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
else RD(0, "\n");
if (obj->cur->clipper)
{
- RD(level, " clipper: '%s'%s%s %p (mask %p) %d,%d %dx%d\n",
+ RD(level, " clipper: '%s'%s%s %p (mask: %p) %d,%d %dx%d\n",
obj->cur->clipper->type,
obj->cur->clipper->name ? ":" : "",
obj->cur->clipper->name ? obj->cur->clipper->name : "",
@@ -1263,14 +1264,16 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
return clean_them;
}
}
- else
- {
- if (!evas_object_is_proxy_visible(eo_obj, obj) ||
+ else if (!evas_object_is_proxy_visible(eo_obj, obj) ||
(obj->clip.clipees) || (obj->cur->have_clipees))
- {
- RD(level, "}\n");
- return clean_them;
- }
+ {
+ RD(level, "}\n");
+ return clean_them;
+ }
+ else if (obj->no_render)
+ {
+ RD(level, " no render\n}\n");
+ return clean_them;
}
}
else if (!(((evas_object_is_active(eo_obj, obj) && (!obj->clip.clipees) &&
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 3426d15fec..83fa4b41c8 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -66,7 +66,7 @@ evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
static inline int
evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
{
- if (obj->is_smart) return 0;
+ if (obj->is_smart || obj->no_render) return 0;
/* If clipped: Assume alpha */
if (obj->cur->cache.clip.a == 255)
{
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index b2678df042..967a02aeef 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1105,6 +1105,7 @@ struct _Evas_Object_Protected_Data
Eina_Bool child_has_map : 1;
Eina_Bool eo_del_called : 1;
Eina_Bool is_smart : 1;
+ Eina_Bool no_render : 1; // since 1.15
};
struct _Evas_Data_Node