Hi,
This patch adds context clip from the intersection between the non-frame objects
and the framespace area so that those objects won't potentially be rendered over
frame ones.
Instead of clipping the objects to a general framespace clipper (and keep track
of it), add context clip with the intersection between the non-frame objects and
the framespace area when rendering the non-frame ones inside the rendering code.
Besides, I was discussing with devilhorns about the checks that have been done
in evas_object_geometry_get() and evas_object_move() functions that do not take
non-smart objects into account, so those objects could be placed at 0,0 (which
is the wrong place when there is a frame in the application) without adding or
subtracting the framespace offset. My fix would simly be to remove the condition
"obj->smart.smart" from those checks done in both evas_object_geometry_get() and
evas_object_move() functions so that non-smart objects would be placed at your
correct positions. I know we have every object/widget (maybe not all) as being a
smart one in Elementary, so we cannot simply ignoring the non-smart objects,
IMO.
Paulo
>From 687e5503b2469c9cdd0c3514e09170b37b626d83 Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <pca...@profusion.mobi>
Date: Tue, 4 Sep 2012 17:46:50 -0300
Subject: [PATCH] evas/render: Add context clip for Wayland framespace
Instead of clipping the objects to a general framespace clipper (and
keep track of it), add a context clip with the intersection between the
non-frame objects and the framespace area when rendering the non-frame
ones inside the rendering code.
---
src/lib/canvas/evas_object_main.c | 4 +-
src/lib/canvas/evas_render.c | 93 ++++++-------------------------------
src/lib/include/evas_private.h | 1 -
3 files changed, 16 insertions(+), 82 deletions(-)
diff --git a/src/lib/canvas/evas_object_main.c b/src/lib/canvas/evas_object_main.c
index 80f4d9d..049ac33 100644
--- a/src/lib/canvas/evas_object_main.c
+++ b/src/lib/canvas/evas_object_main.c
@@ -604,7 +604,7 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
evas = obj->layer->evas;
- if ((!obj->is_frame) && (obj != evas->framespace.clip))
+ if ((!obj->is_frame))
{
if ((!obj->smart.parent) && (obj->smart.smart))
{
@@ -766,7 +766,7 @@ evas_object_geometry_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E
evas = obj->layer->evas;
- if ((!obj->is_frame) && (obj != evas->framespace.clip))
+ if ((!obj->is_frame))
{
if ((!obj->smart.parent) && (obj->smart.smart))
{
diff --git a/src/lib/canvas/evas_render.c b/src/lib/canvas/evas_render.c
index 89de64e..7d2046c 100644
--- a/src/lib/canvas/evas_render.c
+++ b/src/lib/canvas/evas_render.c
@@ -1330,85 +1330,6 @@ evas_render_updates_internal(Evas *e,
e->engine.func->output_redraws_rect_add(e->engine.data.output,
fx, fy, fw, fh);
}
-
- /* phase 4.5: check if object is not in framespace. if not, we need to clip
- * it to the 'master' clip.
- *
- * NB: This is for the wayland engine(s). If we do not do this, then
- * objects will draw outside the viewport and potentially onto the frame
- * itself */
- if (!strncmp(e->engine.module->definition->name, "wayland", 7))
- {
- Eina_Rectangle clip_rect;
-
- /* see if the master clip has been added yet, if not, then create */
- if (!e->framespace.clip)
- {
- e->framespace.clip = evas_object_rectangle_add(e);
- evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
- evas_object_move(e->framespace.clip,
- e->framespace.x, e->framespace.y);
- evas_object_resize(e->framespace.clip,
- e->viewport.w - e->framespace.w,
- e->viewport.h - e->framespace.h);
- evas_object_show(e->framespace.clip);
- }
- else
- {
- /* master clip is already present. check for size changes in the
- * viewport, and update master clip size if needed */
- if ((e->viewport.changed) || (e->output.changed) ||
- (e->framespace.changed))
- {
- evas_object_move(e->framespace.clip,
- e->framespace.x, e->framespace.y);
- evas_object_resize(e->framespace.clip,
- e->viewport.w - e->framespace.w,
- e->viewport.h - e->framespace.h);
- }
- }
-
- EINA_RECTANGLE_SET(&clip_rect,
- e->framespace.clip->cur.geometry.x,
- e->framespace.clip->cur.geometry.y,
- e->framespace.clip->cur.geometry.w,
- e->framespace.clip->cur.geometry.h)
-
- /* With the master clip all setup, we need to loop the objects on this
- * canvas and determine if the object is in the viewport space. If it
- * is in the viewport space (and not in framespace), then we need to
- * clip the object to the master clip so that it does not draw on top
- * of the frame (eg: elm 3d test) */
- for (i = 0; i < e->render_objects.count; ++i)
- {
- Eina_Rectangle obj_rect;
- Evas_Object *pclip;
-
- obj = eina_array_data_get(&e->render_objects, i);
- if (obj->is_frame) continue;
-
- if (obj->delete_me) continue;
-
- EINA_RECTANGLE_SET(&obj_rect,
- obj->cur.geometry.x, obj->cur.geometry.y,
- obj->cur.geometry.w, obj->cur.geometry.h);
-
- /* if the object does not intersect our clip rect, ignore it */
- if (!eina_rectangles_intersect(&clip_rect, &obj_rect))
- continue;
-
- if (!(pclip = evas_object_clip_get(obj)))
- {
- /* skip clipping if the object is itself the
- * framespace clip */
- if (obj == e->framespace.clip) continue;
-
- /* clip this object so it does not draw on the window frame */
- evas_object_clip_set(obj, e->framespace.clip);
- }
- }
- }
-
if (redraw_all)
{
e->engine.func->output_redraws_rect_add(e->engine.data.output, 0, 0,
@@ -1528,6 +1449,20 @@ evas_render_updates_internal(Evas *e,
if ((e->temporary_objects.count > offset) &&
(eina_array_data_get(&e->temporary_objects, offset) == obj))
offset++;
+
+ if ((!obj->is_frame) && (!obj->smart.parent))
+ {
+ Evas_Coord x, y, w, h;
+
+ x = e->framespace.x;
+ y = e->framespace.y;
+ w = e->viewport.w - e->framespace.w;
+ h = e->viewport.h - e->framespace.h;
+
+ RECTS_CLIP_TO_RECT(ux, uy, uw, uh, x, y, w, h);
+ RECTS_CLIP_TO_RECT(cx, cy, cw, ch, x, y, w, h);
+ }
+
x = cx; y = cy; w = cw; h = ch;
if (((w > 0) && (h > 0)) || (obj->smart.smart))
{
diff --git a/src/lib/include/evas_private.h b/src/lib/include/evas_private.h
index fc3033f..2959021 100644
--- a/src/lib/include/evas_private.h
+++ b/src/lib/include/evas_private.h
@@ -334,7 +334,6 @@ struct _Evas
{
Evas_Coord x, y, w, h;
Eina_Bool changed : 1;
- Evas_Object *clip;
} framespace;
Eina_List *damages;
--
1.7.9.5
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel