Hey dh,

On Wed, Sep 11, 2013 at 10:11 AM, Chris Michael - Enlightenment Git
<no-re...@enlightenment.org> wrote:
> devilhorns pushed a commit to branch master.
>
> commit d673cbc3982399a11be74a42f909e68b0f380dea
> Author: Chris Michael <cp.mich...@samsung.com>
> Date:   Wed Sep 11 13:00:23 2013 +0100
>
>     Readd the master clip for rendering of wayland engines.
>
>     NB: Master clip is needed so that things don't draw outside the client
>     area.
>
>     NB: This is a partial fix. Still a work in progress. Some remaining
>     issues with some various elm_tests that use evas_map.
>
>     Signed-off-by: Chris Michael <cp.mich...@samsung.com>
> ---
>  src/lib/evas/canvas/evas_render.c | 67 
> +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>
> diff --git a/src/lib/evas/canvas/evas_render.c 
> b/src/lib/evas/canvas/evas_render.c
> index 3f8d942..bdf147a 100644
> --- a/src/lib/evas/canvas/evas_render.c
> +++ b/src/lib/evas/canvas/evas_render.c
> @@ -1538,6 +1538,7 @@ evas_render_updates_internal(Evas *eo_e,
>  #ifdef EVAS_RENDER_DEBUG_TIMING
>     double start_time = _time_get();
>  #endif
> +   Eina_Rectangle clip_rect;
>
>     MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
>     return EINA_FALSE;
> @@ -1582,6 +1583,51 @@ evas_render_updates_internal(Evas *eo_e,
>                                                &e->render_objects,
>                                                &redraw_all);
>
> +   if (!strncmp(e->engine.module->definition->name, "wayland", 7))
> +     {
> +        /* check for master clip */
> +        if (!e->framespace.clip)
> +          {
> +             e->framespace.clip = evas_object_rectangle_add(eo_e);
> +             evas_object_color_set(e->framespace.clip, 255, 255, 255, 255);
> +             evas_object_move(e->framespace.clip, 0, 0);
> +             evas_object_resize(e->framespace.clip,
> +                                e->viewport.w - e->framespace.w,
> +                                e->viewport.h - e->framespace.h);
> +             evas_object_show(e->framespace.clip);
> +          }
> +
> +        /* setup master clip rectangle for comparison to objects */
> +        EINA_RECTANGLE_SET(&clip_rect, e->framespace.x, e->framespace.y,
> +                           e->viewport.w - e->framespace.w,
> +                           e->viewport.h - e->framespace.h);
> +
> +        for (i = 0; i < e->render_objects.count; ++i)
> +          {
> +             Eina_Rectangle obj_rect;
> +
> +             obj = eina_array_data_get(&e->render_objects, i);
> +             if (obj->delete_me) continue;
> +             if (obj->is_frame) continue;
> +             if (obj->object == e->framespace.clip) continue;
> +
> +             /* setup object rectangle for comparison to clip rectangle */
> +             EINA_RECTANGLE_SET(&obj_rect,
> +                                obj->cur->geometry.x, obj->cur->geometry.y,
> +                                obj->cur->geometry.w, obj->cur->geometry.h);
> +
> +             /* check if this object intersects with the master clip */
> +             if (!eina_rectangles_intersect(&clip_rect, &obj_rect))
> +               continue;
> +
> +             if (!evas_object_clip_get(obj->object))
> +               {
> +                  /* clip this object to the master clip */
> +                  evas_object_clip_set(obj->object, e->framespace.clip);
> +               }
> +          }
> +     }
> +
>     /* phase 1.5. check if the video should be inlined or stay in their 
> overlay */
>     alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
>                                              e->engine.data.context);
> @@ -1914,6 +1960,27 @@ evas_render_updates_internal(Evas *eo_e,
>            }
>       }
>
> +   if (!strncmp(e->engine.module->definition->name, "wayland", 7))
> +     {
> +        /* unclip objects from master clip */
> +        for (i = 0; i < e->render_objects.count; ++i)
> +          {
> +             obj = eina_array_data_get(&e->render_objects, i);
> +             if (obj->is_frame) continue;
> +             if (obj->object == e->framespace.clip) continue;
> +
> +             if (evas_object_clip_get(obj->object) == e->framespace.clip)
> +               {
> +                  /* unclip this object from the master clip */
> +                  evas_object_clip_unset(obj->object);
> +               }
> +          }
> +
> +        /* delete master clip */
> +        evas_object_del(e->framespace.clip);
> +        e->framespace.clip = NULL;
> +     }
> +
>     e->changed = EINA_FALSE;
>     e->viewport.changed = EINA_FALSE;
>     e->output.changed = EINA_FALSE;

I see what you tried here, and I did something similar but it seems
that you added the unclip stuff to the right place, so at least the
canvas doesn't get maked as changed after you unclip these objects.

But what about the clipped/unclipped objects? When you change their
clipper, these objects are going to be marked as "changed", and even
if they don't change any other property on the next mainloop, they
might have to be repainted again because the clip cache will be
invalidated... well, I didn't test it, but it's what I'm assuming now.

/me thinks about a new object flag/list for clipping objects to a
special clipper, not a normal evas object clipper... any thoughts on
that?

Regards,
-- 
Rafael Antognolli

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to