On Thu, Feb 27, 2014 at 11:46 PM, Gustavo Sverzut Barbieri <
[email protected]> wrote:

> On Wed, Feb 26, 2014 at 10:36 PM, WooHyun Jung <[email protected]>
> wrote:
> > woohyun pushed a commit to branch master.
> >
> >
> http://git.enlightenment.org/core/efl.git/commit/?id=6093e68cb01cf915057b9e330f7586039d092990
> >
> > commit 6093e68cb01cf915057b9e330f7586039d092990
> > Author: WooHyun Jung <[email protected]>
> > Date:   Thu Feb 27 10:31:42 2014 +0900
> >
> >     evas: replace EINA_LIST_FREE to EINA_LIST_FOREACH_SAFE.
> >
> >     EINA_LIST_FREE does eina_list_remove_list, and clip_unset does
> >     the same thing to the same list pointer. So, EINA_LIST_FOREACH_SAFE
> >     is proper for this case.
> > ---
> >  src/lib/evas/canvas/evas_object_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/lib/evas/canvas/evas_object_main.c
> b/src/lib/evas/canvas/evas_object_main.c
> > index 9db95d4..d8d3850 100644
> > --- a/src/lib/evas/canvas/evas_object_main.c
> > +++ b/src/lib/evas/canvas/evas_object_main.c
> > @@ -654,7 +654,7 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list
> EINA_UNUSED)
> >          goto end;
> >       }
> >     evas_object_grabs_cleanup(eo_obj, obj);
> > -   EINA_LIST_FREE(obj->clip.clipees, tmp)
> > +   EINA_LIST_FOREACH_SAFE(obj->clip.clipees, l, l2, tmp)
> >       evas_object_clip_unset(tmp->object);
>
> if that's the case then a saner approach is to NULL obj->clip.clipees
> and then iterate the list:
>
> l = obj->clip.clipees;
> obj->clip.clipees = NULL;
> EINA_LIST_FREE(l, tmp)
>    evas_object_clip_unset(tmp->obj)
>
> of course you may have to clear tmp and whatever is needed to do here as
> well.
>
>
> the solution above is simpler and should be faster than your solution
> using the foreach-safe version.
>
>
Dear Barbieri,
thanks for the suggestion.

But when I look at the evas_object_clip_unset(), it looks like your
approach has no benefit.
https://git.enlightenment.org/core/efl.git/tree/src/lib/evas/canvas/evas_clip.c#n400
In line number 401, if "obj->cur->clipper->clip.clipees" is NULL, it will
trigger the following codes.

if (!obj->cur->clipper->clip.clipees)
  {
     EINA_COW_STATE_WRITE_BEGIN(obj->cur->clipper, state_write, cur)
       {
          state_write->have_clipees = 0;
       }
     EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);

     if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
       {
          if (obj->cur->clipper->layer)
            {
               Evas_Public_Data *e = obj->cur->clipper->layer->evas;
               evas_damage_rectangle_add(e->evas,
                                         obj->cur->clipper->cur->geometry.x
+ e->framespace.x,
                                         obj->cur->clipper->cur->geometry.y
+ e->framespace.y,
                                         obj->cur->clipper->cur->geometry.w,

obj->cur->clipper->cur->geometry.h);
            }
       }
  }

So Woohyun's approach looks ok to me.

evas_object_image_source_unset() does the same thing.
So the current code looks like:
EINA_LIST_FOREACH_SAFE(obj->clip.clipees, l, l2, tmp)
  evas_object_clip_unset(tmp->object);
EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
  evas_object_image_source_unset(proxy);

https://git.enlightenment.org/core/efl.git/tree/src/lib/evas/canvas/evas_object_main.c#n659

How do you think?

Daniel Juyung Seo (SeoZ)


> --
> Gustavo Sverzut Barbieri
> --------------------------------------
> Mobile: +55 (19) 9225-2202
> Contact: http://www.gustavobarbieri.com.br/contact
>
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to