From: Enlightenment S. <no-...@en...> - 2008-11-15 10:39:56
|
Log: make scale set apply immediately on objects that do scaling... Author: raster Date: 2008-11-15 02:39:46 -0800 (Sat, 15 Nov 2008) New Revision: 37656 Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_line.c trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/canvas/evas_object_polygon.c trunk/evas/src/lib/canvas/evas_object_rectangle.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/canvas/evas_object_text.c trunk/evas/src/lib/canvas/evas_object_textblock.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -60,6 +60,7 @@ evas_object_gradient2_linear_was_opaque, NULL, NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -60,6 +60,7 @@ evas_object_gradient2_radial_was_opaque, NULL, NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -86,22 +86,23 @@ { /* methods (compulsory) */ evas_object_image_free, - evas_object_image_render, - evas_object_image_render_pre, - evas_object_image_render_post, - evas_object_image_id_get, - evas_object_image_visual_id_get, - evas_object_image_engine_data_get, - /* these are optional. NULL = nothing */ - NULL, - NULL, - NULL, - NULL, - evas_object_image_is_opaque, - evas_object_image_was_opaque, - evas_object_image_is_inside, - NULL, - NULL + evas_object_image_render, + evas_object_image_render_pre, + evas_object_image_render_post, + evas_object_image_id_get, + evas_object_image_visual_id_get, + evas_object_image_engine_data_get, + /* these are optional. NULL = nothing */ + NULL, + NULL, + NULL, + NULL, + evas_object_image_is_opaque, + evas_object_image_was_opaque, + evas_object_image_is_inside, + NULL, + NULL, + NULL }; /** Modified: trunk/evas/src/lib/canvas/evas_object_line.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_line.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_line.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -62,7 +62,8 @@ evas_object_line_was_opaque, evas_object_line_is_inside, evas_object_line_was_inside, - evas_object_line_coords_recalc + evas_object_line_coords_recalc, + NULL }; /* the actual api call to add a rect */ Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -1263,6 +1263,7 @@ return; obj->cur.scale = scale; evas_object_change(obj); + if (obj->func->scale_update) obj->func->scale_update(obj); } Modified: trunk/evas/src/lib/canvas/evas_object_polygon.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_polygon.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_polygon.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -59,6 +59,7 @@ evas_object_polygon_was_opaque, evas_object_polygon_is_inside, evas_object_polygon_was_inside, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_rectangle.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_rectangle.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -56,6 +56,7 @@ evas_object_rectangle_was_opaque, NULL, NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -56,6 +56,7 @@ NULL, NULL, NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_text.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_text.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_text.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -50,6 +50,8 @@ static int evas_object_text_is_opaque(Evas_Object *obj); static int evas_object_text_was_opaque(Evas_Object *obj); +static void evas_object_text_scale_update(Evas_Object *obj); + static const Evas_Object_Func object_func = { /* methods (compulsory) */ @@ -69,7 +71,8 @@ evas_object_text_was_opaque, NULL, NULL, - NULL + NULL, + evas_object_text_scale_update }; /* the actual api call to add a rect */ @@ -1730,6 +1733,24 @@ return 0; } +static void +evas_object_text_scale_update(Evas_Object *obj) +{ + Evas_Object_Text *o; + int size; + const char *font; + + o = (Evas_Object_Text *)(obj->object_data); + font = eina_stringshare_add(o->cur.font); + size = o->cur.size; + if (o->cur.font) eina_stringshare_del(o->cur.font); + o->cur.font = NULL; + o->prev.font = NULL; + o->cur.size = 0; + o->prev.size = 0; + evas_object_text_font_set(obj, font, size); +} + void _evas_object_text_rehint(Evas_Object *obj) { Modified: trunk/evas/src/lib/canvas/evas_object_textblock.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_textblock.c 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/canvas/evas_object_textblock.c 2008-11-15 10:39:46 UTC (rev 37656) @@ -153,6 +153,8 @@ static void evas_object_textblock_coords_recalc(Evas_Object *obj); +static void evas_object_textblock_scale_update(Evas_Object *obj); + static const Evas_Object_Func object_func = { /* methods (compulsory) */ @@ -172,7 +174,8 @@ evas_object_textblock_was_opaque, NULL, NULL, - evas_object_textblock_coords_recalc + evas_object_textblock_coords_recalc, + evas_object_textblock_scale_update }; /* the actual api call to add a textblock */ @@ -5609,6 +5612,15 @@ } } +static void +evas_object_textblock_scale_update(Evas_Object *obj) +{ + Evas_Object_Textblock *o; + + o = (Evas_Object_Textblock *)(obj->object_data); + _relayout(obj); +} + void _evas_object_textblock_rehint(Evas_Object *obj) { Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2008-11-15 09:51:57 UTC (rev 37655) +++ trunk/evas/src/lib/include/evas_private.h 2008-11-15 10:39:46 UTC (rev 37656) @@ -529,6 +529,8 @@ int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void (*coords_recalc) (Evas_Object *obj); + + void (*scale_update) (Evas_Object *obj); }; struct _Evas_Func |
From: Enlightenment S. <no-...@en...> - 2009-02-17 04:53:06
|
Log: and support obscured rects for clip-out if middle of bordered image set to solid. speedup. Author: raster Date: 2009-02-16 20:53:03 -0800 (Mon, 16 Feb 2009) New Revision: 39051 Modified: trunk/evas/src/lib/canvas/evas_object_gradient.c trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_line.c trunk/evas/src/lib/canvas/evas_object_polygon.c trunk/evas/src/lib/canvas/evas_object_rectangle.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/canvas/evas_object_text.c trunk/evas/src/lib/canvas/evas_object_textblock.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_gradient.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_gradient.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -75,6 +75,8 @@ evas_object_gradient_was_opaque, NULL, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -61,6 +61,8 @@ NULL, NULL, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -61,6 +61,8 @@ NULL, NULL, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -80,6 +80,8 @@ static int evas_object_image_is_opaque(Evas_Object *obj); static int evas_object_image_was_opaque(Evas_Object *obj); static int evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static int evas_object_image_has_opaque_rect(Evas_Object *obj); +static int evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); static void *evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace); static void evas_object_image_filled_resize_listener(void *data, Evas *e, Evas_Object *obj, void *einfo); @@ -104,7 +106,9 @@ evas_object_image_is_inside, NULL, NULL, - NULL + NULL, + evas_object_image_has_opaque_rect, + evas_object_image_get_opaque_rect }; /** @@ -2687,6 +2691,38 @@ return (a != 0); } +static int +evas_object_image_has_opaque_rect(Evas_Object *obj) +{ + Evas_Object_Image *o; + + o = (Evas_Object_Image *)(obj->object_data); + if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.border.b) != 0) && + (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) && + (obj->cur.render_op == EVAS_RENDER_BLEND) && + (obj->cur.cache.clip.a == 255) && + (o->cur.fill.x == 0) && + (o->cur.fill.y == 0) && + (o->cur.fill.w == obj->cur.geometry.w) && + (o->cur.fill.h == obj->cur.geometry.h) + ) return 1; + return 0; +} + +static int +evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +{ + Evas_Object_Image *o; + + o = (Evas_Object_Image *)(obj->object_data); + *x = obj->cur.geometry.x + o->cur.border.l; + *y = obj->cur.geometry.y + o->cur.border.t; + *w = obj->cur.geometry.w - (o->cur.border.l + o->cur.border.r); + if (*w < 0) *w = 0; + *h = obj->cur.geometry.h - (o->cur.border.t + o->cur.border.b); + if (*h < 0) *h = 0; +} + static void * evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace) { Modified: trunk/evas/src/lib/canvas/evas_object_line.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_line.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_line.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -63,6 +63,8 @@ evas_object_line_is_inside, evas_object_line_was_inside, evas_object_line_coords_recalc, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_polygon.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_polygon.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_polygon.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -60,6 +60,8 @@ evas_object_polygon_is_inside, evas_object_polygon_was_inside, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_rectangle.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_rectangle.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -57,6 +57,8 @@ NULL, NULL, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -57,6 +57,8 @@ NULL, NULL, NULL, + NULL, + NULL, NULL }; Modified: trunk/evas/src/lib/canvas/evas_object_text.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_text.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_text.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -72,7 +72,9 @@ NULL, NULL, NULL, - evas_object_text_scale_update + evas_object_text_scale_update, + NULL, + NULL }; /* the actual api call to add a rect */ Modified: trunk/evas/src/lib/canvas/evas_object_textblock.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_textblock.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_object_textblock.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -175,7 +175,9 @@ NULL, NULL, evas_object_textblock_coords_recalc, - evas_object_textblock_scale_update + evas_object_textblock_scale_update, + NULL, + NULL }; /* the actual api call to add a textblock */ Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/canvas/evas_render.c 2009-02-17 04:53:03 UTC (rev 39051) @@ -400,7 +400,9 @@ Evas_Object *obj; obj = eina_array_data_get(&e->active_objects, i); - if (UNLIKELY(evas_object_is_opaque(obj) && + if (UNLIKELY((evas_object_is_opaque(obj) || + ((obj->func->has_opaque_rect) && + (obj->func->has_opaque_rect(obj)))) && evas_object_is_visible(obj) && (!obj->clip.clipees) && (obj->cur.visible) && @@ -476,21 +478,6 @@ obj->cur.cache.clip.h); if ((w > 0) && (h > 0)) { -/// printf("CLIP: %p | %i %i, %ix%i | %p %i %i %ix%i\n", -/// obj, -/// x, y, w, h, -/// obj->cur.clipper, -/// obj->cur.cache.clip.x + off_x, -/// obj->cur.cache.clip.y + off_y, -/// obj->cur.cache.clip.w, -/// obj->cur.cache.clip.h -/// ); -/// if (((obj->cur.cache.clip.x + off_x) == 0) && -/// ((obj->cur.cache.clip.w) == 960)) -/// { -/// abort(); -/// } - e->engine.func->context_clip_set(e->engine.data.output, e->engine.data.context, x, y, w, h); @@ -500,12 +487,37 @@ Evas_Object *obj2; obj2 = (Evas_Object *) eina_array_data_get(&e->temporary_objects, j); - e->engine.func->context_cutout_add(e->engine.data.output, - e->engine.data.context, - obj2->cur.cache.clip.x + off_x, - obj2->cur.cache.clip.y + off_y, - obj2->cur.cache.clip.w, - obj2->cur.cache.clip.h); + if (evas_object_is_opaque(obj2)) + e->engine.func->context_cutout_add(e->engine.data.output, + e->engine.data.context, + obj2->cur.cache.clip.x + off_x, + obj2->cur.cache.clip.y + off_y, + obj2->cur.cache.clip.w, + obj2->cur.cache.clip.h); + else + { + if (obj2->func->get_opaque_rect) + { + Evas_Coord obx, oby, obw, obh; + + obj2->func->get_opaque_rect + (obj2, &obx, &oby, &obw, &obh); + if ((obw > 0) && (obh > 0)) + { + obx += off_x; + oby += off_y; + RECTS_CLIP_TO_RECT(obx, oby, obw, obh, + obj2->cur.cache.clip.x + off_x, + obj2->cur.cache.clip.y + off_y, + obj2->cur.cache.clip.w, + obj2->cur.cache.clip.h); + e->engine.func->context_cutout_add(e->engine.data.output, + e->engine.data.context, + obx, oby, + obw, obh); + } + } + } } #endif obj->func->render(obj, Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2009-02-16 22:32:34 UTC (rev 39050) +++ trunk/evas/src/lib/include/evas_private.h 2009-02-17 04:53:03 UTC (rev 39051) @@ -531,6 +531,9 @@ void (*coords_recalc) (Evas_Object *obj); void (*scale_update) (Evas_Object *obj); + + int (*has_opaque_rect) (Evas_Object *obj); + int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); }; struct _Evas_Func |
From: Enlightenment S. <no-...@en...> - 2009-04-11 07:10:35
|
Log: revert - spotted clip bug in titlebar in e17. Author: raster Date: 2009-04-11 00:10:26 -0700 (Sat, 11 Apr 2009) New Revision: 39966 Modified: trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2009-04-11 07:10:12 UTC (rev 39965) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2009-04-11 07:10:26 UTC (rev 39966) @@ -1202,7 +1202,6 @@ obj->cur.color.r = r; obj->cur.color.g = g; obj->cur.color.b = b; - evas_object_clip_dirty(obj); if ((obj->cur.color.a == 0) && (a == 0)) return; obj->cur.color.a = a; evas_object_change(obj); Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2009-04-11 07:10:12 UTC (rev 39965) +++ trunk/evas/src/lib/include/evas_inline.x 2009-04-11 07:10:26 UTC (rev 39966) @@ -172,8 +172,7 @@ int nx, ny, nw, nh, nvis, nr, ng, nb, na; if (obj->layer->evas->events_frozen > 0) return; - if (!(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty) - && !obj->cur.cache.clip.dirty) return; +// if (!obj->cur.clipper->cur.cache.clip.dirty) return; evas_object_coords_recalc(obj); cx = obj->cur.geometry.x; cy = obj->cur.geometry.y; cw = obj->cur.geometry.w; ch = obj->cur.geometry.h; @@ -186,7 +185,7 @@ if (obj->cur.clipper) { // this causes problems... hmmm - if (obj->cur.clipper->cur.cache.clip.dirty) +// if (obj->cur.clipper->cur.cache.clip.dirty) evas_object_clip_recalc(obj->cur.clipper); nx = obj->cur.clipper->cur.cache.clip.x; ny = obj->cur.clipper->cur.cache.clip.y; |
From: Enlightenment S. <no-...@en...> - 2009-10-30 10:11:25
|
Log: finally! smart objects work with map! Author: raster Date: 2009-10-30 03:11:15 -0700 (Fri, 30 Oct 2009) New Revision: 43343 Modified: trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2009-10-30 10:00:26 UTC (rev 43342) +++ trunk/evas/src/lib/canvas/evas_render.c 2009-10-30 10:11:15 UTC (rev 43343) @@ -80,7 +80,9 @@ return; MAGIC_CHECK_END(); EINA_LIST_FREE(e->obscures, r) - eina_rectangle_free(r); + { + eina_rectangle_free(r); + } } static void @@ -111,6 +113,38 @@ } } +static int +_evas_child_changed_propagate(Evas_Object *obj) +{ + Evas_Object *obj2; + + EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) + { + if ((evas_object_is_visible(obj2) || + evas_object_was_visible(obj2)) + ) + { + if (((obj2->restack) && (!obj->clip.clipees)) || + (obj2->changed)) + { + obj->changed = 1; + return 1; + } + else if (obj2->smart.smart) + { + if (obj2->changed) + { + obj->changed = 1; + return 1; + } + if (_evas_child_changed_propagate(obj2)) + return 1; + } + } + } + return 0; +} + static Eina_Bool _evas_render_phase1_object_process(Evas *e, Evas_Object *obj, Eina_Array *active_objects, Eina_Array *restack_objects, Eina_Array *delete_objects, Eina_Array *render_objects, int restack) { @@ -148,20 +182,31 @@ if (!((obj->func->can_map) && (obj->func->can_map(obj))) && ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) { + if (obj->smart.smart) + { + _evas_child_changed_propagate(obj); +// printf("%p changed\n", obj); + } if (obj->changed) { if ((is_active) && (obj->restack) && (!obj->clip.clipees) && ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) - eina_array_push(restack_objects, obj); + { +// printf("a\n"); + eina_array_push(restack_objects, obj); + } else if ((is_active) && (!obj->clip.clipees) && ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) { - eina_array_push(render_objects, obj); +// printf("b\n"); + eina_array_push(restack_objects, obj); +// eina_array_push(render_objects, obj); obj->render_pre = 1; } } +// printf("---\n"); /* for now all mapped objects are no logner opaque else { @@ -173,6 +218,7 @@ } } */ + return; } /* handle normal rendering. this object knows how to handle maps */ @@ -183,6 +229,7 @@ { Evas_Object *obj2; +// printf("_evas_render_phase1_object_process smart1 %p\n", obj); eina_array_push(render_objects, obj); obj->render_pre = 1; EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) @@ -220,6 +267,7 @@ { Evas_Object *obj2; +// printf("_evas_render_phase1_object_process smart2 %p\n", obj); eina_array_push(render_objects, obj); obj->render_pre = 1; EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) @@ -259,10 +307,9 @@ EINA_INLIST_FOREACH(lay->objects, obj) { - clean_them |= _evas_render_phase1_object_process(e, obj, - active_objects, restack_objects, - delete_objects, render_objects, - 0); + clean_them |= _evas_render_phase1_object_process + (e, obj, active_objects, restack_objects, delete_objects, + render_objects, 0); } } @@ -272,13 +319,12 @@ static void _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *e) { - unsigned int i; + int i; for (i = 0; i < pending_objects->count; ++i) { Evas_Object *obj; - int ok = 0; - int is_active; + int is_active, ok = 0; obj = eina_array_data_get(pending_objects, i); @@ -287,10 +333,8 @@ evas_object_clip_recalc(obj); is_active = evas_object_is_active(obj); - if (!is_active && - !obj->is_active && - !obj->render_pre && - !obj->rect_del) + if ((!is_active) && (!obj->is_active) && (!obj->render_pre) && + (!obj->rect_del)) { ok = 1; goto clean_stuff; @@ -302,27 +346,21 @@ { if (obj->smart.smart) { - if (obj->render_pre - || obj->rect_del) - ok = 1; + if (obj->render_pre || obj->rect_del) ok = 1; } else if ((is_active) && (obj->restack) && (!obj->clip.clipees) && ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) { - if (!(obj->render_pre - || obj->rect_del)) - ok = 1; + if (!(obj->render_pre || obj->rect_del)) ok = 1; } else if (is_active && (!obj->clip.clipees) && ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) { - if (obj->render_pre - || obj->rect_del) - ok = 1; + if (obj->render_pre || obj->rect_del) ok = 1; } } else @@ -330,10 +368,9 @@ if ((!obj->clip.clipees) && (obj->delete_me == 0) && (!obj->cur.have_clipees || (evas_object_was_visible(obj) && (!obj->prev.have_clipees))) && evas_object_is_opaque(obj) && evas_object_is_visible(obj)) - if (obj->rect_del || obj->smart.smart) - { - ok = 1; - } + { + if (obj->rect_del || obj->smart.smart) ok = 1; + } } } @@ -342,12 +379,9 @@ { eina_array_clean(&e->active_objects); eina_array_clean(&e->render_objects); - eina_array_clean(&e->restack_objects); eina_array_clean(&e->delete_objects); - e->invalidate = 1; - return ; } } @@ -364,9 +398,99 @@ return obj->changed ? EINA_TRUE : EINA_FALSE; } +static void +evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, int off_x, int off_y) +{ + if (!((obj->func->can_map) && (obj->func->can_map(obj))) && + ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) + { + const Evas_Map_Point *p, *p_end; + RGBA_Map_Point pts[4], *pt; + void *ctx; + + if ((obj->cur.map->normal_geometry.w <= 0) || + (obj->cur.map->normal_geometry.h <= 0)) + return; + + static int level = 0; + + level++; +// printf("+-- mapped draw lv %i\n", level); + p = obj->cur.map->points; + p_end = p + 4; + pt = pts; + for (; p < p_end; p++, pt++) + { + pt->x = (p->x + off_x) << FP; + pt->y = (p->y + off_y) << FP; + pt->z = (p->z) << FP; + pt->u = p->u * FP1; + pt->v = p->v * FP1; + } + + + ctx = e->engine.func->context_new(e->engine.data.output); + if (!obj->cur.map->surface) + obj->cur.map->surface = + obj->layer->evas->engine.func->image_map_surface_new + (e->engine.data.output, obj->cur.map->normal_geometry.w, + obj->cur.map->normal_geometry.h, 1); + + // FIXME: only re-render if obj changed or smart children or size changed etc. + if (obj->smart.smart) + { + Evas_Object *obj2; + + off_x = -obj->cur.map->normal_geometry.x; + off_y = -obj->cur.map->normal_geometry.y; +/* + printf("draw mapped smart obj %p, %ix%i, off %i %i [%i %i]\n", + obj, + obj->cur.map->normal_geometry.w, + obj->cur.map->normal_geometry.h, + off_x, off_y, + obj->cur.map->normal_geometry.x, + obj->cur.map->normal_geometry.y); + */ + EINA_INLIST_FOREACH + (evas_object_smart_members_get_direct(obj), obj2) + { + if (evas_object_is_active(obj2) && + (!obj2->clip.clipees) && + ((evas_object_is_visible(obj2) && + (!obj2->cur.have_clipees)))) + evas_render_mapped(e, obj2, ctx, obj->cur.map->surface, + off_x, off_y); + } + } + else + { + off_x = -obj->cur.cache.clip.x; + off_y = -obj->cur.cache.clip.y; + obj->func->render(obj, e->engine.data.output, ctx, + obj->cur.map->surface, off_x, off_y); + } + e->engine.func->context_free(e->engine.data.output, ctx); + + obj->layer->evas->engine.func->image_map4_draw + (e->engine.data.output, e->engine.data.context, surface, + obj->cur.map->surface, pts, 1, /*smooth? (on for now)*/ 0); + // FIXME: needs to cache these maps and + // keep them only rendering updates + obj->layer->evas->engine.func->image_map_surface_free + (e->engine.data.output, obj->cur.map->surface); + obj->cur.map->surface = NULL; + level--; +// printf("+-- done\n"); + } + else + obj->func->render(obj, e->engine.data.output, context, surface, + off_x, off_y); +} + static Eina_List * evas_render_updates_internal(Evas *e, - Evas_Object *smart, + Evas_Object *smart, // is this a good idea? unsigned char make_updates, unsigned char do_draw) { @@ -571,7 +695,7 @@ (obj->cur.visible) && (!obj->delete_me) && (obj->cur.cache.clip.visible) && - (!obj->smart.smart) && +// (!obj->smart.smart) && (obj->cur.color.a > 0)) { int x, y, w, h; @@ -629,83 +753,8 @@ } } #endif - if (!((obj->func->can_map) && (obj->func->can_map(obj))) && - ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) - { - if ((obj->cur.map->normal_geometry.w > 0) && - (obj->cur.map->normal_geometry.h > 0)) - { - const Evas_Map_Point *p, *p_end; - RGBA_Map_Point pts[4], *pt; - void *ctx; - - ctx = e->engine.func->context_new(e->engine.data.output); - if (!obj->cur.map->surface) - { - obj->cur.map->surface = - obj->layer->evas->engine.func->image_map_surface_new - (e->engine.data.output, - obj->cur.map->normal_geometry.w, - obj->cur.map->normal_geometry.h, - 1); - } - - if (obj->smart.smart) - { - // FIXME: doesnt work yet - // smart object. draw all children to - // surface (and if they are mapped... - // recurse) - evas_render_updates_internal(e, obj, 0, 1); - } - else - { - obj->func->render(obj, - e->engine.data.output, - ctx, - obj->cur.map->surface, - -obj->cur.cache.clip.x, - -obj->cur.cache.clip.y - ); - } - e->engine.func->context_free(e->engine.data.output, ctx); - - p = obj->cur.map->points; - p_end = p + 4; - pt = pts; - - for (; p < p_end; p++, pt++) - { - pt->x = (p->x + off_x) << FP; - pt->y = (p->y + off_y) << FP; - pt->z = (p->z) << FP; - pt->u = p->u * FP1; - pt->v = p->v * FP1; - } - obj->layer->evas->engine.func->image_map4_draw - (e->engine.data.output, - e->engine.data.context, - surface, - obj->cur.map->surface, - pts, - 1, // smooth? (on for now) - 0); - // FIXME: needs to cache these maps and - // keep them only rendering updates - obj->layer->evas->engine.func->image_map_surface_free - (e->engine.data.output, - obj->cur.map->surface); - obj->cur.map->surface = NULL; - } - } - else - { - obj->func->render(obj, - e->engine.data.output, - e->engine.data.context, - surface, - off_x, off_y); - } + evas_render_mapped(e, obj, e->engine.data.context, + surface, off_x, off_y); e->engine.func->context_cutout_clear(e->engine.data.output, e->engine.data.context); } Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2009-10-30 10:00:26 UTC (rev 43342) +++ trunk/evas/src/lib/include/evas_inline.x 2009-10-30 10:11:15 UTC (rev 43343) @@ -4,7 +4,6 @@ static inline int evas_object_was_visible(Evas_Object *obj) { - if (obj->smart.smart) return 0; if ((obj->prev.visible) && (obj->prev.cache.clip.visible) && (obj->prev.cache.clip.a > 0)) @@ -81,7 +80,6 @@ static inline int evas_object_is_visible(Evas_Object *obj) { - if (obj->smart.smart) return 0; if ((obj->cur.visible) && (obj->cur.cache.clip.visible) && (obj->cur.cache.clip.a > 0)) @@ -108,7 +106,6 @@ static inline int evas_object_is_in_output_rect(Evas_Object *obj, int x, int y, int w, int h) { - if (obj->smart.smart) return 0; /* assumes coords have been recalced */ if ((RECTS_INTERSECT(x, y, w, h, obj->cur.cache.clip.x, @@ -122,7 +119,6 @@ static inline int evas_object_is_active(Evas_Object *obj) { - if (obj->smart.smart) return 0; if ((evas_object_is_visible(obj) || evas_object_was_visible(obj)) && (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w, obj->layer->evas->output.h) || @@ -135,7 +131,6 @@ static inline void evas_object_coords_recalc(Evas_Object *obj) { - if (obj->smart.smart) return; //// if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity) //// return; //// obj->cur.cache.geometry.x = |
From: Enlightenment S. <no-...@en...> - 2009-11-03 15:41:53
|
Log: and fix the dual geometry thing - use the clip cache for uv geometry. perfect! Author: raster Date: 2009-11-03 07:41:36 -0800 (Tue, 03 Nov 2009) New Revision: 43432 Modified: trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2009-11-03 13:48:38 UTC (rev 43431) +++ trunk/evas/src/lib/canvas/evas_map.c 2009-11-03 15:41:36 UTC (rev 43432) @@ -40,7 +40,7 @@ if (!obj->cur.map) return; p = obj->cur.map->points; - p_end = p + 4; + p_end = p + obj->cur.map->count; x1 = p->x; x2 = p->x; y1 = p->y; @@ -53,10 +53,10 @@ if (p->y < y1) y1 = p->y; if (p->y > y2) y2 = p->y; } - obj->cur.geometry.x = x1; - obj->cur.geometry.y = y1; - obj->cur.geometry.w = (x2 - x1) + 1; - obj->cur.geometry.h = (y2 - y1) + 1; + obj->cur.map->normal_geometry.x = x1; + obj->cur.map->normal_geometry.y = y1; + obj->cur.map->normal_geometry.w = (x2 - x1); + obj->cur.map->normal_geometry.h = (y2 - y1); _evas_map_calc_geom_change(obj); } @@ -137,13 +137,13 @@ { if (!obj->cur.map) obj->cur.map = _evas_map_new(4); - obj->cur.map->normal_geometry = obj->cur.geometry; +// obj->cur.map->normal_geometry = obj->cur.geometry; } else { if (obj->cur.map) { - obj->cur.geometry = obj->cur.map->normal_geometry; + obj->prev.geometry = obj->cur.map->normal_geometry; _evas_map_calc_geom_change(obj); } } @@ -225,7 +225,7 @@ obj->cur.map->surface); obj->cur.map->surface = NULL; } - obj->cur.geometry = obj->cur.map->normal_geometry; + obj->prev.geometry = obj->cur.map->normal_geometry; if (!obj->prev.map) { _evas_map_free(obj->cur.map); Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-03 13:48:38 UTC (rev 43431) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-03 15:41:36 UTC (rev 43432) @@ -2557,6 +2557,11 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); if (!o->pixel_updates) goto done; } + if (obj->cur.map != obj->prev.map) + { + evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); + goto done; + } /* it's not visible - we accounted for it appearing or not so just abort */ if (!is_v) goto done; /* clipper changed this is in addition to anything else for obj */ Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2009-11-03 13:48:38 UTC (rev 43431) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2009-11-03 15:41:36 UTC (rev 43432) @@ -172,23 +172,35 @@ evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj) { evas_add_rect(rects, - obj->cur.geometry.x, - obj->cur.geometry.y, - obj->cur.geometry.w, - obj->cur.geometry.h); + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); + evas_add_rect(rects, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); +/* + evas_add_rect(rects, + obj->cur.geometry.x, + obj->cur.geometry.y, + obj->cur.geometry.w, + obj->cur.geometry.h); //// obj->cur.cache.geometry.x, //// obj->cur.cache.geometry.y, //// obj->cur.cache.geometry.w, //// obj->cur.cache.geometry.h); - evas_add_rect(rects, - obj->prev.geometry.x, - obj->prev.geometry.y, - obj->prev.geometry.w, - obj->prev.geometry.h); + evas_add_rect(rects, + obj->prev.geometry.x, + obj->prev.geometry.y, + obj->prev.geometry.w, + obj->prev.geometry.h); //// obj->prev.cache.geometry.x, //// obj->prev.cache.geometry.y, //// obj->prev.cache.geometry.w, //// obj->prev.cache.geometry.h); +*/ } void Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2009-11-03 13:48:38 UTC (rev 43431) +++ trunk/evas/src/lib/canvas/evas_render.c 2009-11-03 15:41:36 UTC (rev 43432) @@ -387,8 +387,8 @@ int sw, sh; int changed = 0; - sw = obj->cur.map->normal_geometry.w; - sh = obj->cur.map->normal_geometry.h; + sw = obj->cur.geometry.w; + sh = obj->cur.geometry.h; if ((sw <= 0) || (sh <= 0)) return; p = obj->cur.map->points; @@ -470,8 +470,8 @@ { Evas_Object *obj2; - off_x = -obj->cur.map->normal_geometry.x; - off_y = -obj->cur.map->normal_geometry.y; + off_x = -obj->cur.geometry.x; + off_y = -obj->cur.geometry.y; EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(obj), obj2) { Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2009-11-03 13:48:38 UTC (rev 43431) +++ trunk/evas/src/lib/include/evas_inline.x 2009-11-03 15:41:36 UTC (rev 43432) @@ -157,8 +157,20 @@ if (!(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty) && !obj->cur.cache.clip.dirty) return; evas_object_coords_recalc(obj); - cx = obj->cur.geometry.x; cy = obj->cur.geometry.y; - cw = obj->cur.geometry.w; ch = obj->cur.geometry.h; + if (obj->cur.map) + { + cx = obj->cur.map->normal_geometry.x; + cy = obj->cur.map->normal_geometry.y; + cw = obj->cur.map->normal_geometry.w; + ch = obj->cur.map->normal_geometry.h; + } + else + { + cx = obj->cur.geometry.x; + cy = obj->cur.geometry.y; + cw = obj->cur.geometry.w; + ch = obj->cur.geometry.h; + } //// cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y; //// cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h; if (obj->cur.color.a == 0) cvis = 0; |
From: Enlightenment S. <no-...@en...> - 2009-11-05 15:25:00
|
Log: map coords in mapped objects. Author: raster Date: 2009-11-05 07:24:48 -0800 (Thu, 05 Nov 2009) New Revision: 43463 Modified: trunk/evas/src/lib/canvas/evas_events.c trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_events.c =================================================================== --- trunk/evas/src/lib/canvas/evas_events.c 2009-11-05 15:09:44 UTC (rev 43462) +++ trunk/evas/src/lib/canvas/evas_events.c 2009-11-05 15:24:48 UTC (rev 43463) @@ -1,54 +1,123 @@ #include "evas_common.h" #include "evas_private.h" +static void +_evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) +{ + Evas_Object *pmap; + + if (!obj->havemap_parent) return; + pmap = obj->smart.parent; + if (!pmap) return; + while (pmap) + { + if ((pmap->cur.map) && (pmap->cur.map->count == 4) && (pmap->cur.usemap)) + break; + pmap = obj->smart.parent; + } + if (!pmap) return; + evas_map_coords_get(pmap->cur.map, *x, *y, x, y, obj->mouse_grabbed); +} + static Eina_List * -_evas_event_object_list_in_get(Evas *e, Eina_List *in, const Eina_Inlist *list, Evas_Object *stop, int x, int y, int *no_rep) +_evas_event_object_list_in_get(Evas *e, Eina_List *in, + const Eina_Inlist *list, Evas_Object *stop, + int x, int y, int *no_rep, int parmap) { Evas_Object *obj; - if (!list) return in; EINA_INLIST_REVERSE_FOREACH(list, obj) { + if (parmap) obj->havemap_parent = 1; + else obj->havemap_parent = 0; + if (obj == stop) { *no_rep = 1; return in; } - if (!evas_event_passes_through(obj)) - { - if ((obj->cur.visible) && (obj->delete_me == 0) && - (!obj->clip.clipees) && - (evas_object_clippers_is_visible(obj))) - { - if (obj->smart.smart) - { - int norep; - - norep = 0; - in = _evas_event_object_list_in_get(e, in, - evas_object_smart_members_get_direct(obj), - stop, x, y, &norep); - if (norep) - { - *no_rep = 1; - return in; - } - } - else - { - if (evas_object_is_in_output_rect(obj, x, y, 1, 1) && - ((!obj->precise_is_inside) || - (evas_object_is_inside(obj, x, y)))) - { - in = eina_list_append(in, obj); - if (!obj->repeat_events) - { - *no_rep = 1; - return in; - } - } - } - } + if (evas_event_passes_through(obj)) continue; + if ((obj->cur.visible) && (obj->delete_me == 0) && + (!obj->clip.clipees) && + (evas_object_clippers_is_visible(obj))) + { + if (obj->smart.smart) + { + int norep; + int inside; + + norep = 0; + if (((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) + { + inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); + if (inside) + { + if (!evas_map_coords_get(obj->cur.map, x, y, + &(obj->cur.map->mx), + &(obj->cur.map->my), 0)) + { + inside = 0; + } + else + { + parmap = 1; + } + } + else + inside = 0; + if (inside) + { + in = _evas_event_object_list_in_get + (e, in, + evas_object_smart_members_get_direct(obj), + stop, + obj->cur.geometry.x + obj->cur.map->mx, + obj->cur.geometry.y + obj->cur.map->my, + &norep, parmap); + } + } + else + { + in = _evas_event_object_list_in_get + (e, in, evas_object_smart_members_get_direct(obj), + stop, x, y, &norep, parmap); + } + if (norep) + { + *no_rep = 1; + return in; + } + } + else + { + int inside = 1; + + if (((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) + { + inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); + if (inside) + { + if (!evas_map_coords_get(obj->cur.map, x, y, + &(obj->cur.map->mx), + &(obj->cur.map->my), 0)) + inside = 0; + } + else + inside = 0; + } + else + inside = evas_object_is_in_output_rect(obj, x, y, 1, 1); + if (inside && ((!obj->precise_is_inside) || + (evas_object_is_inside(obj, x, y)))) + { + in = eina_list_append(in, obj); + if (!obj->repeat_events) + { + *no_rep = 1; + return in; + } + } + } } } *no_rep = 0; @@ -67,8 +136,9 @@ int norep; norep = 0; - in = _evas_event_object_list_in_get(e, in, EINA_INLIST_GET(lay->objects), stop, - x, y, &norep); + in = _evas_event_object_list_in_get(e, in, + EINA_INLIST_GET(lay->objects), + stop, x, y, &norep, 0); if (norep) return in; } return in; @@ -240,6 +310,9 @@ copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) { obj->mouse_grabbed++; @@ -305,6 +378,9 @@ copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) && (obj->mouse_in) && (obj->mouse_grabbed > 0)) { @@ -344,6 +420,9 @@ copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if ((!eina_list_data_find(ins, obj)) || (!e->pointer.inside)) { @@ -374,6 +453,9 @@ EINA_LIST_FOREACH(ins, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if (!eina_list_data_find(e->pointer.object.in, obj)) { @@ -487,6 +569,9 @@ EINA_LIST_FOREACH(copy, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if (e->events_frozen <= 0) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_WHEEL, &ev); if (e->delete_me) break; @@ -564,6 +649,11 @@ copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, obj) { + ev.cur.canvas.x = e->pointer.x; + ev.cur.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y); + e->pointer.x = ev.cur.canvas.x; + e->pointer.y = ev.cur.canvas.y; if ((obj->cur.visible) && (evas_object_clippers_is_visible(obj)) && (!evas_event_passes_through(obj)) && @@ -603,12 +693,13 @@ outs = eina_list_remove(outs, obj); if ((obj->mouse_grabbed == 0) && (!e->delete_me)) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); e->pointer.object.in = eina_list_remove(e->pointer.object.in, obj); - { - obj->mouse_in = 0; - if (e->events_frozen <= 0) - evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); - } + obj->mouse_in = 0; + if (e->events_frozen <= 0) + evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); } } } @@ -680,6 +771,9 @@ { if ((px != x) || (py != y)) { + ev.cur.canvas.x = e->pointer.x; + ev.cur.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y); if (e->events_frozen <= 0) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev); } @@ -688,6 +782,9 @@ else { obj->mouse_in = 0; + ev2.canvas.x = e->pointer.x; + ev2.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y); if (e->events_frozen <= 0) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2); } @@ -697,6 +794,9 @@ /* go thru our current list of ins */ EINA_LIST_FOREACH(ins, l, obj) { + ev3.canvas.x = e->pointer.x; + ev3.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev3.canvas.x, &ev3.canvas.y); /* if its not in the old list of ins send an enter event */ if (!eina_list_data_find(e->pointer.object.in, obj)) { @@ -761,6 +861,9 @@ ins = evas_event_objects_event_list(e, NULL, e->pointer.x, e->pointer.y); EINA_LIST_FOREACH(ins, l, obj) { + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); if (!eina_list_data_find(e->pointer.object.in, obj)) { @@ -825,7 +928,10 @@ copy = evas_event_list_copy(e->pointer.object.in); EINA_LIST_FOREACH(copy, l, obj) { - obj->mouse_in = 0; + ev.canvas.x = e->pointer.x; + ev.canvas.y = e->pointer.y; + _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y); + obj->mouse_in = 0; if (e->events_frozen <= 0) evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev); Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2009-11-05 15:09:44 UTC (rev 43462) +++ trunk/evas/src/lib/canvas/evas_map.c 2009-11-05 15:24:48 UTC (rev 43463) @@ -64,7 +64,6 @@ _evas_map_new(int count) { int i; - Evas_Map *m = calloc(1, sizeof(Evas_Map) + count * sizeof(Evas_Map_Point)); if (!m) return NULL; m->count = count; @@ -111,6 +110,151 @@ free(m); } +Eina_Bool +evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, + Evas_Coord *mx, Evas_Coord *my, int grab) +{ + int order[4], i, j, edges, edge[4][2], douv; + Evas_Coord xe[2]; + double u[2], v[2]; + + if (m->count != 4) return 0; + // FIXME need to handle grab mode and extrapolte coords outside + // map + if (grab) + { + Evas_Coord ymin, ymax; + + ymin = m->points[0].y; + ymax = m->points[0].y; + for (i = 1; i < m->count; i++) + { + if (m->points[i].y < ymin) ymin = m->points[i].y; + else if (m->points[i].y > ymax) ymax = m->points[i].y; + } + if (y <= ymin) y = ymin + 1; + if (y >= ymax) y = ymax - 1; + } + edges = 0; + for (i = 0; i < m->count; i++) + { + j = (i + 1) % m->count; + if ((m->points[i].y <= y) && (m->points[j].y > y)) + { + edge[edges][0] = i; + edge[edges][1] = j; + edges++; + } + else if ((m->points[j].y <= y) && (m->points[i].y > y)) + { + edge[edges][0] = j; + edge[edges][1] = i; + edges++; + } + } + douv = 0; + if ((mx) || (my)) douv = 1; + for (i = 0; i < (edges - 1); i+= 2) + { + Evas_Coord yp, yd, x0, x1; + + j = i + 1; + yd = m->points[edge[i][1]].y - m->points[edge[i][0]].y; + if (yd > 0) + { + yp = y - m->points[edge[i][0]].y; + xe[0] = m->points[edge[i][1]].x - m->points[edge[i][0]].x; + xe[0] = m->points[edge[i][0]].x + ((xe[0] * yp) / yd); + if (douv) + { + u[0] = m->points[edge[i][1]].u - m->points[edge[i][0]].u; + u[0] = m->points[edge[i][0]].u + ((u[0] * yp) / yd); + v[0] = m->points[edge[i][1]].v - m->points[edge[i][0]].v; + v[0] = m->points[edge[i][0]].v + ((v[0] * yp) / yd); + } + } + else + { + xe[0] = m->points[edge[i][0]].x; + if (douv) + { + u[0] = m->points[edge[i][0]].u; + v[0] = m->points[edge[i][0]].v; + } + } + yd = m->points[edge[j][1]].y - m->points[edge[j][0]].y; + if (yd > 0) + { + yp = y - m->points[edge[j][0]].y; + xe[1] = m->points[edge[j][1]].x - m->points[edge[j][0]].x; + xe[1] = m->points[edge[j][0]].x + ((xe[1] * yp) / yd); + if (douv) + { + u[1] = m->points[edge[j][1]].u - m->points[edge[j][0]].u; + u[1] = m->points[edge[j][0]].u + ((u[1] * yp) / yd); + v[1] = m->points[edge[j][1]].v - m->points[edge[j][0]].v; + v[1] = m->points[edge[j][0]].v + ((v[1] * yp) / yd); + } + } + else + { + xe[1] = m->points[edge[j][0]].x; + if (douv) + { + u[1] = m->points[edge[j][0]].u; + v[1] = m->points[edge[j][0]].v; + } + } + if (xe[0] > xe[1]) + { + int ti; + + ti = xe[0]; xe[0] = xe[1]; xe[1] = ti; + if (douv) + { + double td; + + td = u[0]; u[0] = u[1]; u[1] = td; + td = v[0]; v[0] = v[1]; v[1] = td; + } + } + if ((x >= xe[0]) && (x < xe[1])) + { + if (douv) + { + if (mx) + *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) / + (xe[1] - xe[0])); + if (my) + *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) / + (xe[1] - xe[0])); + } + return 1; + } + if (grab) + { + if (douv) + { + if (mx) + *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) / + (xe[1] - xe[0])); + if (my) + *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) / + (xe[1] - xe[0])); + } + return 1; + } + } + return 0; +} + +Eina_Bool +evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y) +{ + return evas_map_coords_get(m, x, y, NULL, NULL, 0); +} + + /** * Enable or disable the map that is set * Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-05 15:09:44 UTC (rev 43462) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-05 15:24:48 UTC (rev 43463) @@ -2855,99 +2855,107 @@ x -= obj->cur.cache.clip.x; y -= obj->cur.cache.clip.y; - w = obj->cur.geometry.w; - h = obj->cur.geometry.h; + w = obj->cur.cache.clip.w; + h = obj->cur.cache.clip.h; iw = o->cur.image.w; ih = o->cur.image.h; if ((x < 0) || (y < 0) || (x >= w) || (y >= h)) return 0; if (!o->cur.has_alpha) return 1; - w = o->cur.fill.w; - h = o->cur.fill.h; - x -= o->cur.fill.x; - y -= o->cur.fill.y; - x %= w; - y %= h; - - if (x < 0) x += w; - if (y < 0) y += h; - - if (o->cur.border.fill != EVAS_BORDER_FILL_DEFAULT) + if (obj->cur.map) { - if ((x > o->cur.border.l) && (x < (w - o->cur.border.r)) && - (y > o->cur.border.t) && (y < (h - o->cur.border.b))) - { - if (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) return 1; - return 0; - } + x = obj->cur.map->mx; + y = obj->cur.map->my; } - if (x < o->cur.border.l) + else { - if (y < o->cur.border.t) + w = o->cur.fill.w; + h = o->cur.fill.h; + x -= o->cur.fill.x; + y -= o->cur.fill.y; + x %= w; + y %= h; + + if (x < 0) x += w; + if (y < 0) y += h; + + if (o->cur.border.fill != EVAS_BORDER_FILL_DEFAULT) { - // nothing. x & y stay as-is + if ((x > o->cur.border.l) && (x < (w - o->cur.border.r)) && + (y > o->cur.border.t) && (y < (h - o->cur.border.b))) + { + if (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) return 1; + return 0; + } } - else if (y > (h - o->cur.border.b)) + if (x < o->cur.border.l) { - y = ih - (h - y); + if (y < o->cur.border.t) + { + // nothing. x & y stay as-is + } + else if (y > (h - o->cur.border.b)) + { + y = ih - (h - y); + } + else if ((o->cur.border.t + o->cur.border.b) < ih) + { + y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); + } + else + return 1; } - else if ((o->cur.border.t + o->cur.border.b) < ih) + else if (x > (w - o->cur.border.r)) { - y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); + x = iw - (w - x); + if (y < o->cur.border.t) + { + // nothing. x & y stay as-is + } + else if (y > (h - o->cur.border.b)) + { + y = ih - (h - y); + } + else if ((o->cur.border.t + o->cur.border.b) < ih) + { + y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); + } + else + return 1; } else - return 1; - } - else if (x > (w - o->cur.border.r)) - { - x = iw - (w - x); - if (y < o->cur.border.t) { - // nothing. x & y stay as-is + if ((o->cur.border.l + o->cur.border.r) < iw) + { + x = ((x - o->cur.border.l) * iw) / (iw - o->cur.border.l - o->cur.border.r); + } + else + x = o->cur.border.l; + if (y < o->cur.border.t) + { + // nothing. x & y stay as-is + } + else if (y > (h - o->cur.border.b)) + { + y = ih - (h - y); + } + else if ((o->cur.border.t + o->cur.border.b) < ih) + { + y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); + } + else + return 1; } - else if (y > (h - o->cur.border.b)) - { - y = ih - (h - y); - } - else if ((o->cur.border.t + o->cur.border.b) < ih) - { - y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); - } - else - return 1; } - else - { - if ((o->cur.border.l + o->cur.border.r) < iw) - { - x = ((x - o->cur.border.l) * iw) / (iw - o->cur.border.l - o->cur.border.r); - } - else - x = o->cur.border.l; - if (y < o->cur.border.t) - { - // nothing. x & y stay as-is - } - else if (y > (h - o->cur.border.b)) - { - y = ih - (h - y); - } - else if ((o->cur.border.t + o->cur.border.b) < ih) - { - y = ((y - o->cur.border.t) * ih) / (ih - o->cur.border.t - o->cur.border.b); - } - else - return 1; - } - + if (x < 0) x = 0; if (y < 0) y = 0; if (x >= iw) x = iw - 1; if (y >= ih) y = ih - 1; - + stride = o->cur.image.stride; - + o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, 0, Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2009-11-05 15:09:44 UTC (rev 43462) +++ trunk/evas/src/lib/canvas/evas_render.c 2009-11-05 15:24:48 UTC (rev 43463) @@ -486,8 +486,8 @@ } else { - off_x = -obj->cur.cache.clip.x; - off_y = -obj->cur.cache.clip.y; + off_x = -obj->cur.geometry.x; + off_y = -obj->cur.geometry.y; obj->func->render(obj, e->engine.data.output, ctx, obj->cur.map->surface, off_x, off_y); } Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2009-11-05 15:09:44 UTC (rev 43462) +++ trunk/evas/src/lib/include/evas_private.h 2009-11-05 15:24:48 UTC (rev 43463) @@ -50,22 +50,22 @@ typedef struct _Evas_Format Evas_Format; typedef struct _Evas_Map_Point Evas_Map_Point; -#define MAGIC_EVAS 0x70777770 -#define MAGIC_OBJ 0x71777770 -#define MAGIC_OBJ_RECTANGLE 0x71777771 -#define MAGIC_OBJ_LINE 0x71777772 -#define MAGIC_OBJ_GRADIENT 0x71777773 -#define MAGIC_OBJ_POLYGON 0x71777774 -#define MAGIC_OBJ_IMAGE 0x71777775 -#define MAGIC_OBJ_TEXT 0x71777776 -#define MAGIC_OBJ_SMART 0x71777777 -#define MAGIC_OBJ_TEXTBLOCK 0x71777778 -#define MAGIC_SMART 0x72777770 +#define MAGIC_EVAS 0x70777770 +#define MAGIC_OBJ 0x71777770 +#define MAGIC_OBJ_RECTANGLE 0x71777771 +#define MAGIC_OBJ_LINE 0x71777772 +#define MAGIC_OBJ_GRADIENT 0x71777773 +#define MAGIC_OBJ_POLYGON 0x71777774 +#define MAGIC_OBJ_IMAGE 0x71777775 +#define MAGIC_OBJ_TEXT 0x71777776 +#define MAGIC_OBJ_SMART 0x71777777 +#define MAGIC_OBJ_TEXTBLOCK 0x71777778 +#define MAGIC_SMART 0x72777770 #define MAGIC_OBJ_GRADIENT_LINEAR 0x72777771 #define MAGIC_OBJ_GRADIENT_RADIAL 0x72777772 -#define MAGIC_OBJ_SHAPE 0x72777773 -#define MAGIC_OBJ_CONTAINER 0x72777774 -#define MAGIC_OBJ_CUSTOM 0x72777775 +#define MAGIC_OBJ_SHAPE 0x72777773 +#define MAGIC_OBJ_CONTAINER 0x72777774 +#define MAGIC_OBJ_CUSTOM 0x72777775 #ifdef MAGIC_DEBUG # define MAGIC_CHECK_FAILED(o, t, m) \ @@ -367,13 +367,14 @@ struct _Evas_Map { - int count; - Evas_Coord_Rectangle normal_geometry; - void *surface; - int surface_w, surface_h; + int count; // num of points + Evas_Coord_Rectangle normal_geometry; // bounding box of map geom actually + void *surface; // surface holding map if needed + int surface_w, surface_h; // current surface w & h alloc + Evas_Coord mx, my; // mouse x, y after conversion to map space Eina_Bool alpha : 1; Eina_Bool smooth : 1; - Evas_Map_Point points[]; + Evas_Map_Point points[]; // actual points }; struct _Evas_Object @@ -458,6 +459,7 @@ Eina_Bool restack : 1; Eina_Bool changed : 1; Eina_Bool is_active : 1; + Eina_Bool render_pre : 1; Eina_Bool rect_del : 1; Eina_Bool mouse_in : 1; @@ -466,7 +468,9 @@ Eina_Bool focused : 1; Eina_Bool in_layer : 1; Eina_Bool no_propagate : 1; + Eina_Bool precise_is_inside : 1; + Eina_Bool havemap_parent : 1; unsigned char delete_me; }; @@ -827,6 +831,9 @@ void evas_render_invalidate(Evas *e); void evas_render_object_recalc(Evas_Object *obj); +Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); +Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); + #define EVAS_API_OVERRIDE(func, api, prefix) \ (api)->func = prefix##func |
From: Enlightenment S. <no-...@en...> - 2009-11-09 15:18:53
|
Log: god damnt that took some time! fixed some bugs with map + smart objcs + repainting etc. etc. - seems to be working now in complex smart obj tests and simple ones. Author: raster Date: 2009-11-09 07:18:37 -0800 (Mon, 09 Nov 2009) New Revision: 43584 Modified: trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_line.c trunk/evas/src/lib/canvas/evas_object_polygon.c trunk/evas/src/lib/canvas/evas_object_rectangle.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/canvas/evas_object_text.c trunk/evas/src/lib/canvas/evas_object_textblock.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_map.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -30,7 +30,6 @@ } evas_object_inform_call_move(obj); evas_object_inform_call_resize(obj); - obj->changed = 1; } static void @@ -288,7 +287,6 @@ { if (obj->cur.map) { - obj->prev.geometry = obj->cur.map->normal_geometry; _evas_map_calc_geom_change(obj); } } Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_linear.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -352,7 +352,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_gradient2_radial.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -349,7 +349,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -2557,7 +2557,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); if (!o->pixel_updates) goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_line.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_line.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_line.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -343,7 +343,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_polygon.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_polygon.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_polygon.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -358,7 +358,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_rectangle.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_rectangle.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -207,7 +207,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -819,7 +819,8 @@ evas_object_smart_render_pre(Evas_Object *obj) { if (obj->pre_render_done) return; - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_text.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_text.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_text.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -1637,7 +1637,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_object_textblock.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_textblock.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_object_textblock.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -5630,7 +5630,8 @@ evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); goto done; } - if (obj->cur.map != obj->prev.map) + if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj); goto done; Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/canvas/evas_render.c 2009-11-09 15:18:37 UTC (rev 43584) @@ -85,54 +85,19 @@ } } -static int -_evas_child_changed_propagate(Evas_Object *obj) -{ - Evas_Object *obj2; - - EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) - { - if ((evas_object_is_visible(obj2) || - evas_object_was_visible(obj2))) - { - if (((obj2->restack) && (!obj->clip.clipees)) || - (obj2->changed)) - { - obj->changed = 1; -// return 1; - } - else if (obj2->smart.smart) - { - if (obj2->restack) obj->changed = 1; - obj->changed |= _evas_child_changed_propagate(obj2); -/* - if (obj2->changed) - { - obj->changed = 1; - return obj->changed; - } - else if (_evas_child_changed_propagate(obj2)) - return obj->changed; - */ - } - } - } - return obj->changed; -} - static void _evas_render_phase1_direct(Evas *e, Eina_Array *active_objects, Eina_Array *restack_objects, Eina_Array *delete_objects, Eina_Array *render_objects) { unsigned int i; - for (i = 0; i < render_objects->count; ++i) + for (i = 0; i < render_objects->count; i++) { Evas_Object *obj; obj = eina_array_data_get(render_objects, i); - if (obj->smart.smart) _evas_child_changed_propagate(obj); if (obj->changed) { + evas_object_clip_recalc(obj); obj->func->render_pre(obj); if (obj->pre_render_done) { @@ -140,15 +105,37 @@ (!((obj->func->can_map) && (obj->func->can_map(obj)))) && ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) { - eina_array_push(restack_objects, obj); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); } } + else if ((!obj->cur.map) && (obj->prev.usemap)) + { + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); + } } else { if (obj->smart.smart) { - obj->func->render_pre(obj); +// obj->func->render_pre(obj); } else if (obj->rect_del) { @@ -171,8 +158,6 @@ obj->rect_del = 0; obj->render_pre = 0; -/* if (obj->cur.cache.clip.dirty) */ - evas_object_clip_recalc(obj); /* because of clip objects - delete 2 cycles later */ if (obj->delete_me == 2) eina_array_push(delete_objects, obj); @@ -192,25 +177,35 @@ if (restack) { if (!obj->changed) - eina_array_push(&e->pending_objects, obj); + { + eina_array_push(&e->pending_objects, obj); + obj->changed = 1; + } obj->restack = 1; - obj->changed = 1; clean_them = EINA_TRUE; } - if (obj->smart.smart) _evas_child_changed_propagate(obj); - if (!((obj->func->can_map) && (obj->func->can_map(obj))) && ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) { if (obj->changed) { + evas_object_clip_recalc(obj); if ((is_active) && (obj->restack) && (!obj->clip.clipees) && ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) { eina_array_push(render_objects, obj); - eina_array_push(restack_objects, obj); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); obj->render_pre = 1; } else if ((is_active) && (!obj->clip.clipees) && @@ -218,17 +213,42 @@ (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))) { eina_array_push(render_objects, obj); - eina_array_push(restack_objects, obj); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); obj->render_pre = 1; } } return clean_them; } + else if ((!obj->cur.usemap) && (obj->prev.usemap)) + { + evas_object_clip_recalc(obj); + eina_array_push(restack_objects, obj); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->prev.cache.clip.x, + obj->prev.cache.clip.y, + obj->prev.cache.clip.w, + obj->prev.cache.clip.h); + e->engine.func->output_redraws_rect_add(e->engine.data.output, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); + } /* handle normal rendering. this object knows how to handle maps */ if (obj->changed) { + evas_object_clip_recalc(obj); if (obj->smart.smart) { Evas_Object *obj2; @@ -397,7 +417,8 @@ obj = data; if (obj->delete_me) return EINA_FALSE; obj->pre_render_done = 0; - if (!obj->layer) obj->changed = 0; +// if (!obj->layer) + obj->changed = 0; return obj->changed ? EINA_TRUE : EINA_FALSE; } @@ -407,6 +428,18 @@ { void *ctx; + evas_object_clip_recalc(obj); + if (mapped) + { + if ((!evas_object_is_visible(obj)) || (obj->clip.clipees) || + (obj->cur.have_clipees)) + return; + } + else if (!(((evas_object_is_active(obj) && (!obj->clip.clipees) && + ((evas_object_is_visible(obj) && (!obj->cur.have_clipees))))) + )) + return; + if (!((obj->func->can_map) && (obj->func->can_map(obj))) && ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) { @@ -462,6 +495,7 @@ { if (obj2->changed) { + obj2->changed = 0; changed = 1; break; } @@ -469,11 +503,16 @@ obj->changed = 0; } else - changed = obj->changed; + { + changed = obj->changed; + obj->changed = 0; + } // clear surface before re-render if ((changed) && (obj->cur.map->surface)) { + // FIXME: calculate "changes" within map surface and only clear + // and re-render those if (obj->cur.map->alpha) { ctx = e->engine.func->context_new(e->engine.data.output); @@ -499,15 +538,9 @@ EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(obj), obj2) { - if (evas_object_is_active(obj2) && - (!obj2->clip.clipees) && - ((evas_object_is_visible(obj2) && - (!obj2->cur.have_clipees)))) - { - evas_render_mapped(e, obj2, ctx, - obj->cur.map->surface, - off_x, off_y, 1); - } + evas_render_mapped(e, obj2, ctx, + obj->cur.map->surface, + off_x, off_y, 1); } } else @@ -539,34 +572,24 @@ { Evas_Object *obj2; -// off_x = -obj->cur.geometry.x; -// off_y = -obj->cur.geometry.y; EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(obj), obj2) { - if (evas_object_is_active(obj2) && - (!obj2->clip.clipees) && - ((evas_object_is_visible(obj2) && - (!obj2->cur.have_clipees)))) - { - evas_render_mapped(e, obj2, ctx, - surface, - off_x, off_y, 1); - } + evas_render_mapped(e, obj2, ctx, + surface, + off_x, off_y, 1); } } else - { -// off_x = -obj->cur.geometry.x; -// off_y = -obj->cur.geometry.y; - obj->func->render(obj, e->engine.data.output, ctx, - surface, off_x, off_y); - } + obj->func->render(obj, e->engine.data.output, ctx, + surface, off_x, off_y); e->engine.func->context_free(e->engine.data.output, ctx); } else - obj->func->render(obj, e->engine.data.output, context, surface, - off_x, off_y); + { + obj->func->render(obj, e->engine.data.output, context, surface, + off_x, off_y); + } } } @@ -591,7 +614,7 @@ if (!e->changed) return NULL; evas_call_smarts_calculate(e); - + /* Check if the modified object mean recalculating every thing */ if (!e->invalidate) _evas_render_check_pending_objects(&e->pending_objects, e); @@ -759,7 +782,6 @@ e->engine.func->context_cutout_clear(e->engine.data.output, e->engine.data.context); } - /* render all object that intersect with rect */ for (i = 0; i < e->active_objects.count; ++i) { @@ -863,7 +885,8 @@ obj->restack = 0; obj->changed = 0; } - else if (obj->cur.map != obj->prev.map) + else if ((obj->cur.map != obj->prev.map) || + (obj->cur.usemap != obj->prev.usemap)) { obj->func->render_post(obj); obj->restack = 0; @@ -907,12 +930,16 @@ obj->pre_render_done = 0; } - /* If their are some object to restack or some object to delete, it's useless to keep the render object list around. */ - if (clean_them) + /* If their are some object to restack or some object to delete, + * it's useless to keep the render object list around. */ +// if (clean_them) + if (1) { eina_array_clean(&e->active_objects); eina_array_clean(&e->render_objects); - + eina_array_clean(&e->restack_objects); + eina_array_clean(&e->delete_objects); + eina_array_clean(&e->obscuring_objects); e->invalidate = 1; } @@ -1062,9 +1089,7 @@ e = obj->layer->evas; if ((!e) || (e->cleanup)) return; - - if (!obj->changed) - eina_array_push(&e->pending_objects, obj); + eina_array_push(&e->pending_objects, obj); obj->changed = 1; } } Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2009-11-09 13:14:05 UTC (rev 43583) +++ trunk/evas/src/lib/include/evas_inline.x 2009-11-09 15:18:37 UTC (rev 43584) @@ -154,8 +154,9 @@ int nx, ny, nw, nh, nvis, nr, ng, nb, na; if (obj->layer->evas->events_frozen > 0) return; - if (!(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty) - && !obj->cur.cache.clip.dirty) return; + if (!obj->cur.cache.clip.dirty && + !(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty)) + return; evas_object_coords_recalc(obj); if (obj->cur.map) { |
From: Enlightenment S. <no-...@en...> - 2010-03-29 02:40:55
|
Log: fix small leak - cannvas callbacks not cleaned. Author: raster Date: 2010-03-28 19:40:49 -0700 (Sun, 28 Mar 2010) New Revision: 47551 Modified: trunk/evas/src/lib/canvas/evas_callbacks.c trunk/evas/src/lib/canvas/evas_main.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_callbacks.c =================================================================== --- trunk/evas/src/lib/canvas/evas_callbacks.c 2010-03-29 02:27:26 UTC (rev 47550) +++ trunk/evas/src/lib/canvas/evas_callbacks.c 2010-03-29 02:40:49 UTC (rev 47551) @@ -74,6 +74,16 @@ } void +evas_event_callback_cleanup(Evas *e) +{ + /* MEM OK */ + if (!e->callbacks) return; + evas_event_callback_list_post_free(&e->callbacks->callbacks); + free(e->callbacks); + e->callbacks = NULL; +} + +void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info) { Eina_Inlist **l_mod = NULL, *l; Modified: trunk/evas/src/lib/canvas/evas_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_main.c 2010-03-29 02:27:26 UTC (rev 47550) +++ trunk/evas/src/lib/canvas/evas_main.c 2010-03-29 02:40:49 UTC (rev 47551) @@ -238,6 +238,8 @@ eina_rectangle_free(r); evas_fonts_zero_free(e); + + evas_event_callback_cleanup(e); if (e->engine.func) { Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-03-29 02:27:26 UTC (rev 47550) +++ trunk/evas/src/lib/include/evas_private.h 2010-03-29 02:40:49 UTC (rev 47551) @@ -792,6 +792,7 @@ void evas_event_callback_list_post_free(Eina_Inlist **list); void evas_object_event_callback_all_del(Evas_Object *obj); void evas_object_event_callback_cleanup(Evas_Object *obj); +void evas_event_callback_cleanup(Evas *e); void evas_object_inform_call_show(Evas_Object *obj); void evas_object_inform_call_hide(Evas_Object *obj); void evas_object_inform_call_move(Evas_Object *obj); |
From: Enlightenment S. <no-...@en...> - 2010-03-29 05:03:33
|
Log: actually fix evas event cb leak for good. work ast smart desc leak. Author: raster Date: 2010-03-28 22:03:25 -0700 (Sun, 28 Mar 2010) New Revision: 47552 Modified: trunk/evas/src/lib/canvas/evas_callbacks.c trunk/evas/src/lib/canvas/evas_main.c trunk/evas/src/lib/canvas/evas_smart.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_callbacks.c =================================================================== --- trunk/evas/src/lib/canvas/evas_callbacks.c 2010-03-29 02:40:49 UTC (rev 47551) +++ trunk/evas/src/lib/canvas/evas_callbacks.c 2010-03-29 05:03:25 UTC (rev 47552) @@ -19,7 +19,7 @@ l = l->next; if (fn->delete_me) { - *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn)); + *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn)); free(fn); } } @@ -74,6 +74,16 @@ } void +evas_event_callback_all_del(Evas *e) +{ + Evas_Func_Node *fn; + + if (!e->callbacks) return; + EINA_INLIST_FOREACH(e->callbacks->callbacks, fn) + fn->delete_me = 1; +} + +void evas_event_callback_cleanup(Evas *e) { /* MEM OK */ Modified: trunk/evas/src/lib/canvas/evas_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_main.c 2010-03-29 02:40:49 UTC (rev 47551) +++ trunk/evas/src/lib/canvas/evas_main.c 2010-03-29 05:03:25 UTC (rev 47552) @@ -239,6 +239,7 @@ evas_fonts_zero_free(e); + evas_event_callback_all_del(e); evas_event_callback_cleanup(e); if (e->engine.func) Modified: trunk/evas/src/lib/canvas/evas_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_smart.c 2010-03-29 02:40:49 UTC (rev 47551) +++ trunk/evas/src/lib/canvas/evas_smart.c 2010-03-29 05:03:25 UTC (rev 47552) @@ -113,6 +113,7 @@ s->delete_me = 1; if (s->usage > 0) return; if (s->class_allocated) free((void *)s->smart_class); + free(s->callbacks.array); free(s); } @@ -340,7 +341,8 @@ static int _evas_smart_cb_description_cmp_sort(const void *p1, const void *p2) { - const Evas_Smart_Cb_Description * const*a = p1, * const*b = p2; + const Evas_Smart_Cb_Description **a = (const Evas_Smart_Cb_Description **)p1; + const Evas_Smart_Cb_Description **b = (const Evas_Smart_Cb_Description **)p2; return strcmp((*a)->name, (*b)->name); } @@ -415,7 +417,7 @@ _evas_smart_cb_description_cmp_search(const void *p1, const void *p2) { const char *name = p1; - const Evas_Smart_Cb_Description * const*v = p2; + const Evas_Smart_Cb_Description **v = (const Evas_Smart_Cb_Description **)p2; /* speed up string shares searches (same pointers) */ if (name == (*v)->name) return 0; return strcmp(name, (*v)->name); Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-03-29 02:40:49 UTC (rev 47551) +++ trunk/evas/src/lib/include/evas_private.h 2010-03-29 05:03:25 UTC (rev 47552) @@ -792,6 +792,7 @@ void evas_event_callback_list_post_free(Eina_Inlist **list); void evas_object_event_callback_all_del(Evas_Object *obj); void evas_object_event_callback_cleanup(Evas_Object *obj); +void evas_event_callback_all_del(Evas *e); void evas_event_callback_cleanup(Evas *e); void evas_object_inform_call_show(Evas_Object *obj); void evas_object_inform_call_hide(Evas_Object *obj); |
From: Enlightenment S. <no-...@en...> - 2010-08-31 22:16:16
|
Log: aaaaaaaaaaaaaaargh! where's me rum! :( Author: raster Date: 2010-08-31 15:16:08 -0700 (Tue, 31 Aug 2010) New Revision: 51788 Modified: trunk/evas/src/lib/canvas/evas_clip.c trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/include/evas_inline.x trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_clip.c =================================================================== --- trunk/evas/src/lib/canvas/evas_clip.c 2010-08-31 21:19:54 UTC (rev 51787) +++ trunk/evas/src/lib/canvas/evas_clip.c 2010-08-31 22:16:08 UTC (rev 51788) @@ -38,6 +38,77 @@ return 0; } +/* aaaaargh (pirate voice) ... notes! + * + * we have a big problem until now that's gone undetected... until yesterday. + * that problem involves clips and maps and smart objects. hooray! 3 of the + * more complex bits of evas - and maps and smart objects being one of the + * nastiest ones. + * + * what is the problem? when a clip crosses a map boundary. that is to say + * that when the clipper and clippee are not within the child tree of the + * mapped object. in this case "bad stuff" happens. basically as clips are + * then used to render objects, but they no longer apply as you'd expect as + * the map transfomr the objects to-be-clipped separately from the objects + * that clip them and this whole relationship is broken by maps. it somehow + * managed to not break with the advent of smart objects. lucky me... but + * maps killed it. now... what do we do? that is a good question. detect + * such a broken link and "turn off clipping" in that event - sure. but this + * isn't going to be cheap as ANY addition or deletion of a map to an object + * or any change in clipper of an object or any change in smart object + * membership needs to walk the obj tree both up and down from the changed + * object and probably walk entire object trees to find these and mark them. + * thats silly-expensive and i was about to fix it that way but it has since + * dawned on me that that is just going to kill performance in some critical + * areas like during object setup and manipulation, as well as teardown. + * + * aaaaagh! best for now is to document this as a "don't do it damnit!" thing + * and have the apps avoid it. but even then - how to do this? this is not + * easy. everywhere i turn so far i come up to either expensive operations, + * breaks in logic, or nasty re-work of apps or4 the whole concept of clipping, + * smart objects and maps... and that will have to wait for evas 2.0 + * + */ + +static void +evas_object_child_map_across_mark(Evas_Object *obj, Eina_List *clippers, + Eina_Bool map) +{ +#if 0 + if (map) + { + // if obj->cur.clipper is in clippers list, then set + // obj->cur.clip_across_map to 1 + } + else + { + } +#endif +} + +void +evas_object_mapped_clip_across_mark(Evas_Object *obj) +{ + return; +#if 0 + Eina_Bool map = 0; + + if ((obj->cur.map) && (obj->cur.usemap)) map = 1; + if (map) + { + Eina_List *list = NULL; + + // FIXME: list = build list of all clippers that are children of obj + // up until any obj that has map applied to it. if map is applied + // tghen we must assume this has been run before o9n that obj and + // its children etc. + evas_object_child_map_across_mark(obj, list, map); + } + else + evas_object_child_map_across_mark(obj, NULL, map); +#endif +} + /* public functions */ /** Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2010-08-31 21:19:54 UTC (rev 51787) +++ trunk/evas/src/lib/canvas/evas_map.c 2010-08-31 22:16:08 UTC (rev 51788) @@ -295,6 +295,7 @@ { if (!obj->cur.map) obj->cur.map = _evas_map_new(4); + evas_object_mapped_clip_across_mark(obj); // obj->cur.map->normal_geometry = obj->cur.geometry; } else @@ -302,6 +303,7 @@ if (obj->cur.map) { _evas_map_calc_geom_change(obj); + evas_object_mapped_clip_across_mark(obj); } } _evas_map_calc_map_geometry(obj); @@ -433,6 +435,8 @@ obj->cur.map = NULL; if (!obj->cur.usemap) _evas_map_calc_geom_change(obj); else _evas_map_calc_map_geometry(obj); + if (obj->cur.usemap) + evas_object_mapped_clip_across_mark(obj); } return; } @@ -440,6 +444,8 @@ { obj->cur.map = _evas_map_dup(map); obj->prev.map = NULL; + if (obj->cur.usemap) + evas_object_mapped_clip_across_mark(obj); } else { Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2010-08-31 21:19:54 UTC (rev 51787) +++ trunk/evas/src/lib/include/evas_inline.x 2010-08-31 22:16:08 UTC (rev 51788) @@ -175,8 +175,9 @@ int cx, cy, cw, ch, cvis, cr, cg, cb, ca; int nx, ny, nw, nh, nvis, nr, ng, nb, na; - if (!obj->cur.cache.clip.dirty && - !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) + if ((!obj->cur.cache.clip.dirty && + !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) || + (obj->cur.clip_across_map)) return; if (obj->layer->evas->events_frozen > 0) return; evas_object_coords_recalc(obj); @@ -200,7 +201,7 @@ else cvis = obj->cur.visible; cr = obj->cur.color.r; cg = obj->cur.color.g; cb = obj->cur.color.b; ca = obj->cur.color.a; - if (obj->cur.clipper) + if ((obj->cur.clipper) && (!obj->cur.clip_across_map)) { // this causes problems... hmmm if (obj->cur.clipper->cur.cache.clip.dirty) Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-08-31 21:19:54 UTC (rev 51787) +++ trunk/evas/src/lib/include/evas_private.h 2010-08-31 22:16:08 UTC (rev 51788) @@ -435,6 +435,7 @@ Eina_Bool visible : 1; Eina_Bool have_clipees : 1; Eina_Bool anti_alias : 1; + Eina_Bool clip_across_map : 1; Evas_Render_Op render_op : 4; } cur, prev; @@ -733,6 +734,7 @@ int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); int evas_object_clippers_was_visible(Evas_Object *obj); +void evas_object_mapped_clip_across_mark(Evas_Object *obj); void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info); void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info); Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y); |
From: Enlightenment S. <no-...@en...> - 2010-09-01 21:37:17
|
Log: now that mostly fixes this map clip issue... ugh. took a while to come up with an elegant solution. also it does add overhead to fix. i might be able to improve the overhead. Author: raster Date: 2010-09-01 14:37:10 -0700 (Wed, 01 Sep 2010) New Revision: 51823 Modified: trunk/evas/src/lib/canvas/evas_clip.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/include/evas_inline.x trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_clip.c =================================================================== --- trunk/evas/src/lib/canvas/evas_clip.c 2010-09-01 17:33:11 UTC (rev 51822) +++ trunk/evas/src/lib/canvas/evas_clip.c 2010-09-01 21:37:10 UTC (rev 51823) @@ -70,42 +70,64 @@ * */ +#define MAP_ACROSS 1 static void -evas_object_child_map_across_mark(Evas_Object *obj, Eina_List *clippers, - Eina_Bool map) +evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_Bool force) { -#if 0 - if (map) +#ifdef MAP_ACROSS + if ((obj->cur.map_parent != map_obj) || force) { - // if obj->cur.clipper is in clippers list, then set - // obj->cur.clip_across_map to 1 + obj->cur.map_parent = map_obj; + obj->cur.cache.clip.dirty = 1; + evas_object_clip_recalc(obj); + if (obj->smart.smart) + { + Evas_Object *obj2; + + EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2) + { + // if obj has its own map - skip it. already done + if ((obj2->cur.map) && (obj2->cur.usemap)) continue; + evas_object_child_map_across_mark(obj2, map_obj, force); + } + } } - else - { - } #endif } +static void +evas_object_clip_across_check(Evas_Object *obj) +{ + if (!obj->cur.clipper) return; + if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent) + evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1); +} + +// this function is called on an object when map is enabled or disabled on it +// thus creating a "map boundary" at that point. +// +// FIXME: smart member add/del and clip set/unset needs to check the new +// smart parent (if any) void evas_object_mapped_clip_across_mark(Evas_Object *obj) { - return; -#if 0 +#ifdef MAP_ACROSS Eina_Bool map = 0; if ((obj->cur.map) && (obj->cur.usemap)) map = 1; + if (map) { - Eina_List *list = NULL; - - // FIXME: list = build list of all clippers that are children of obj - // up until any obj that has map applied to it. if map is applied - // tghen we must assume this has been run before o9n that obj and - // its children etc. - evas_object_child_map_across_mark(obj, list, map); + evas_object_child_map_across_mark(obj, obj, 0); } else - evas_object_child_map_across_mark(obj, NULL, map); + { + if (obj->smart.parent) + evas_object_child_map_across_mark + (obj, obj->smart.parent->cur.map_parent, 0); + else + evas_object_child_map_across_mark(obj, NULL, 0); + } #endif } @@ -231,6 +253,7 @@ obj->layer->evas->last_timestamp, NULL); } + evas_object_clip_across_check(obj); } /** @@ -332,6 +355,7 @@ obj->layer->evas->last_timestamp, NULL); } + evas_object_clip_across_check(obj); } /** Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2010-09-01 17:33:11 UTC (rev 51822) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2010-09-01 21:37:10 UTC (rev 51823) @@ -201,6 +201,7 @@ evas_object_smart_member_cache_invalidate(obj); obj->restack = 1; evas_object_change(obj); + evas_object_mapped_clip_across_mark(obj); if (smart_obj->smart.smart->smart_class->member_add) smart_obj->smart.smart->smart_class->member_add(smart_obj, obj); } @@ -241,6 +242,7 @@ evas_object_inject(obj, obj->layer->evas); obj->restack = 1; evas_object_change(obj); + evas_object_mapped_clip_across_mark(obj); } /** Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2010-09-01 17:33:11 UTC (rev 51822) +++ trunk/evas/src/lib/include/evas_inline.x 2010-09-01 21:37:10 UTC (rev 51823) @@ -175,9 +175,8 @@ int cx, cy, cw, ch, cvis, cr, cg, cb, ca; int nx, ny, nw, nh, nvis, nr, ng, nb, na; - if ((!obj->cur.cache.clip.dirty && - !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) || - (obj->cur.clip_across_map)) + if ((!obj->cur.cache.clip.dirty) && + !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) return; if (obj->layer->evas->events_frozen > 0) return; evas_object_coords_recalc(obj); @@ -201,7 +200,8 @@ else cvis = obj->cur.visible; cr = obj->cur.color.r; cg = obj->cur.color.g; cb = obj->cur.color.b; ca = obj->cur.color.a; - if ((obj->cur.clipper) && (!obj->cur.clip_across_map)) + if ((obj->cur.clipper) && + (obj->cur.clipper->cur.map_parent == obj->cur.map_parent)) { // this causes problems... hmmm if (obj->cur.clipper->cur.cache.clip.dirty) Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-09-01 17:33:11 UTC (rev 51822) +++ trunk/evas/src/lib/include/evas_private.h 2010-09-01 21:37:10 UTC (rev 51823) @@ -430,12 +430,12 @@ unsigned char r, g, b, a; } color; Evas_Object *clipper; + Evas_Object *map_parent; short layer; Eina_Bool usemap : 1; Eina_Bool visible : 1; Eina_Bool have_clipees : 1; Eina_Bool anti_alias : 1; - Eina_Bool clip_across_map : 1; Evas_Render_Op render_op : 4; } cur, prev; |
From: Enlightenment S. <no-...@en...> - 2010-09-02 09:40:31
|
Log: fix more map+clip goop. Author: raster Date: 2010-09-02 02:40:23 -0700 (Thu, 02 Sep 2010) New Revision: 51830 Modified: trunk/evas/src/lib/canvas/evas_clip.c trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_clip.c =================================================================== --- trunk/evas/src/lib/canvas/evas_clip.c 2010-09-02 05:48:23 UTC (rev 51829) +++ trunk/evas/src/lib/canvas/evas_clip.c 2010-09-02 09:40:23 UTC (rev 51830) @@ -93,18 +93,45 @@ evas_object_child_map_across_mark(obj2, map_obj, force); } } + else if (obj->clip.clipees) + { + Eina_List *l; + Evas_Object *obj2; + + EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) + evas_object_child_map_across_mark(obj2, map_obj, force); + } } #endif } -static void +void evas_object_clip_across_check(Evas_Object *obj) { +#ifdef MAP_ACROSS if (!obj->cur.clipper) return; if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent) evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1); +#endif } +void +evas_object_clip_across_clippees_check(Evas_Object *obj) +{ +#ifdef MAP_ACROSS + Eina_List *l; + Evas_Object *obj2; + + if (!obj->clip.clipees) return; + evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1); + if (obj->cur.cache.clip.dirty) + { + EINA_LIST_FOREACH(obj->clip.clipees, l, obj2) + evas_object_clip_across_clippees_check(obj2); + } +#endif +} + // this function is called on an object when map is enabled or disabled on it // thus creating a "map boundary" at that point. // Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2010-09-02 05:48:23 UTC (rev 51829) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2010-09-02 09:40:23 UTC (rev 51830) @@ -1080,6 +1080,7 @@ evas_object_clip_dirty(obj); if (obj->layer->evas->events_frozen <= 0) { + evas_object_clip_across_clippees_check(obj); evas_object_recalc_clippees(obj); if (!evas_event_passes_through(obj)) { @@ -1135,6 +1136,7 @@ evas_object_clip_dirty(obj); if (obj->layer->evas->events_frozen <= 0) { + evas_object_clip_across_clippees_check(obj); evas_object_recalc_clippees(obj); if (!evas_event_passes_through(obj)) { Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-09-02 05:48:23 UTC (rev 51829) +++ trunk/evas/src/lib/include/evas_private.h 2010-09-02 09:40:23 UTC (rev 51830) @@ -734,6 +734,8 @@ int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); int evas_object_clippers_was_visible(Evas_Object *obj); +void evas_object_clip_across_check(Evas_Object *obj); +void evas_object_clip_across_clippees_check(Evas_Object *obj); void evas_object_mapped_clip_across_mark(Evas_Object *obj); void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info); void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info); |
From: Enlightenment S. <no-...@en...> - 2010-10-07 03:54:58
|
Log: shortcut some smart acceses for clipped smart. Author: raster Date: 2010-10-06 20:54:51 -0700 (Wed, 06 Oct 2010) New Revision: 53132 Modified: trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/canvas/evas_object_smart_clipped.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2010-10-07 03:53:53 UTC (rev 53131) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2010-10-07 03:54:51 UTC (rev 53132) @@ -362,6 +362,14 @@ return o->contained; } +void +_evas_object_smart_members_all_del(Evas_Object *obj) +{ + Evas_Object_Smart *o = (Evas_Object_Smart *)(obj->object_data); + while (o->contained) + evas_object_del((Evas_Object *)(o->contained)); +} + /** * Instantiates a new smart object described by @p s. * Modified: trunk/evas/src/lib/canvas/evas_object_smart_clipped.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart_clipped.c 2010-10-07 03:53:53 UTC (rev 53131) +++ trunk/evas/src/lib/canvas/evas_object_smart_clipped.c 2010-10-07 03:54:51 UTC (rev 53132) @@ -20,14 +20,14 @@ EAPI void evas_object_smart_move_children_relative(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy) { - Eina_List *lst, *itr; + const Eina_Inlist *lst; Evas_Object *child; if ((dx == 0) && (dy == 0)) return; - lst = evas_object_smart_members_get(obj); - EINA_LIST_FOREACH(lst, itr, child) + lst = evas_object_smart_members_get_direct(obj); + EINA_INLIST_FOREACH(lst, child) { Evas_Coord orig_x, orig_y; @@ -39,8 +39,6 @@ orig_y = child->cur.geometry.y; evas_object_move(child, orig_x + dx, orig_y + dy); } - - eina_list_free(lst); } /** @@ -89,9 +87,6 @@ static void evas_object_smart_clipped_smart_del(Evas_Object *obj) { - Eina_List *lst, *itr; - Evas_Object *data; - CSO_DATA_GET_OR_RETURN(obj, cso); if (cso->clipper) @@ -101,10 +96,7 @@ evas_object_del(clipper); } - lst = evas_object_smart_members_get(obj); - EINA_LIST_FOREACH(lst, itr, data) - evas_object_del(data); - eina_list_free(lst); + _evas_object_smart_members_all_del(obj); free(cso); evas_object_smart_data_set(obj, NULL); Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-10-07 03:53:53 UTC (rev 53131) +++ trunk/evas/src/lib/include/evas_private.h 2010-10-07 03:54:51 UTC (rev 53132) @@ -739,6 +739,7 @@ void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other); void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other); const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj); +void _evas_object_smart_members_all_del(Evas_Object *obj); void evas_call_smarts_calculate(Evas *e); void *evas_mem_calloc(int size); void _evas_post_event_callback_call(Evas *e); @@ -820,6 +821,7 @@ Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); + #define EVAS_API_OVERRIDE(func, api, prefix) \ (api)->func = prefix##func |
From: Enlightenment S. <no-...@en...> - 2010-10-15 05:40:00
|
Log: you wouldnt believe it if i told you.. but put in a block to disallow move or resize of an obj WHILE in the middle of a move or resize already - some weird case someone has come up with where this happens and things like smart clipped's "move relatvie by dx, dy" totally screw up then. it's a totally unexpected case though. some circular action has been created that logically shouldn't have existed. Author: raster Date: 2010-10-14 22:39:53 -0700 (Thu, 14 Oct 2010) New Revision: 53434 Modified: trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2010-10-14 22:21:43 UTC (rev 53433) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2010-10-15 05:39:53 UTC (rev 53434) @@ -1,30 +1,6 @@ #include "evas_common.h" #include "evas_private.h" -/* FIXME: this broken e17's mouse cursor - need to figure out why */ - -/* uncomment the next line if smart objects should be informed - * if they are moved to the position they are already in - * (e.g. if they are in 0,0 and you call evas_object_move(o, 0, 0) - */ -//#define FORWARD_NOOP_MOVES_TO_SMART_OBJS - -/* likewise, for resizes - */ -//#define FORWARD_NOOP_RESIZES_TO_SMART_OBJS - -/* Similar to FORWARD_NOOP_*, this will allow no-operations (those calls that - * have values exactly like current state) to call EVAS_CALLBACK_*. - * - * For some unknown reason this was the default behavior so it is left as - * a compile-time option, but will be deprecated and removed soon as it can - * potentially lead to execution of unnecessary code. - * by Gustavo, February 5th, 2009. - * XXX: remove-me before e17 release! - */ -//#define CALLBACK_NOOP - - static Eina_Inlist * get_layer_objects(Evas_Layer *l) { @@ -431,28 +407,12 @@ MAGIC_CHECK_END(); if (obj->delete_me) return; if (evas_object_intercept_call_move(obj, x, y)) return; -#ifdef FORWARD_NOOP_MOVES_TO_SMART_OBJS - if (obj->smart.smart) + if (obj->doing.in_move > 0) { - if (obj->smart.smart->smart_class->move) - obj->smart.smart->smart_class->move(obj, x, y); + WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj); + return; } -#endif - if ((obj->cur.geometry.x == x) && - (obj->cur.geometry.y == y)) - { -#ifdef CALLBACK_NOOP - evas_object_inform_call_move(obj); -#endif - return; - } -#ifndef FORWARD_NOOP_MOVES_TO_SMART_OBJS - if (obj->smart.smart) - { - if (obj->smart.smart->smart_class->move) - obj->smart.smart->smart_class->move(obj, x, y); - } -#endif + if ((obj->cur.geometry.x == x) && (obj->cur.geometry.y == y)) return; if (obj->layer->evas->events_frozen <= 0) { pass = evas_event_passes_through(obj); @@ -461,11 +421,18 @@ obj->layer->evas->pointer.x, obj->layer->evas->pointer.y, 1, 1); } + obj->doing.in_move++; + if (obj->smart.smart) + { + if (obj->smart.smart->smart_class->move) + obj->smart.smart->smart_class->move(obj, x, y); + } obj->cur.geometry.x = x; obj->cur.geometry.y = y; //// obj->cur.cache.geometry.validity = 0; evas_object_change(obj); evas_object_clip_dirty(obj); + obj->doing.in_move--; if (obj->layer->evas->events_frozen <= 0) { evas_object_recalc_clippees(obj); @@ -523,28 +490,12 @@ if (obj->delete_me) return; if (w < 0) w = 0; if (h < 0) h = 0; if (evas_object_intercept_call_resize(obj, w, h)) return; -#ifdef FORWARD_NOOP_RESIZES_TO_SMART_OBJS - if (obj->smart.smart) + if (obj->doing.in_resize > 0) { - if (obj->smart.smart->smart_class->resize) - obj->smart.smart->smart_class->resize(obj, w, h); + WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); + return; } -#endif - if ((obj->cur.geometry.w == w) && - (obj->cur.geometry.h == h)) - { -#ifdef CALLBACK_NOOP - evas_object_inform_call_resize(obj); -#endif - return; - } -#ifndef FORWARD_NOOP_RESIZES_TO_SMART_OBJS - if (obj->smart.smart) - { - if (obj->smart.smart->smart_class->resize) - obj->smart.smart->smart_class->resize(obj, w, h); - } -#endif + if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return; if (obj->layer->evas->events_frozen <= 0) { pass = evas_event_passes_through(obj); @@ -553,12 +504,18 @@ obj->layer->evas->pointer.x, obj->layer->evas->pointer.y, 1, 1); } - + obj->doing.in_resize++; + if (obj->smart.smart) + { + if (obj->smart.smart->smart_class->resize) + obj->smart.smart->smart_class->resize(obj, w, h); + } obj->cur.geometry.w = w; obj->cur.geometry.h = h; //// obj->cur.cache.geometry.validity = 0; evas_object_change(obj); evas_object_clip_dirty(obj); + obj->doing.in_resize--; /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */ if (obj->layer->evas->events_frozen <= 0) { @@ -1077,9 +1034,6 @@ } if (obj->cur.visible) { -#ifdef CALLBACK_NOOP - evas_object_inform_call_show(obj); -#endif return; } obj->cur.visible = 1; @@ -1133,9 +1087,6 @@ } if (!obj->cur.visible) { -#ifdef CALLBACK_NOOP - evas_object_inform_call_hide(obj); -#endif return; } obj->cur.visible = 0; Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-10-14 22:21:43 UTC (rev 53433) +++ trunk/evas/src/lib/include/evas_private.h 2010-10-15 05:39:53 UTC (rev 53434) @@ -445,6 +445,10 @@ int mouse_grabbed; int last_event; + + struct { + int in_move, in_resize; + } doing; unsigned char delete_me; |
From: Enlightenment S. <no-...@en...> - 2010-11-26 10:01:26
|
Log: evas -> use mempool for many objects and things. but.. disable it for now. use old calloc+free thing for 1.0 and enable mpool for 1.1. this is just done in advance but disabled for some testing purposes looking for some bugs. Author: raster Date: 2010-11-26 02:01:18 -0800 (Fri, 26 Nov 2010) New Revision: 55006 Modified: trunk/evas/src/lib/canvas/evas_callbacks.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_line.c trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/canvas/evas_object_polygon.c trunk/evas/src/lib/canvas/evas_object_rectangle.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/canvas/evas_object_smart_clipped.c trunk/evas/src/lib/canvas/evas_object_text.c trunk/evas/src/lib/canvas/evas_object_textblock.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_callbacks.c =================================================================== --- trunk/evas/src/lib/canvas/evas_callbacks.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_callbacks.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -5,6 +5,10 @@ static void evas_event_callback_clear(Evas *e); int _evas_event_counter = 0; +EVAS_MEMPOOL(_mp_fn); +EVAS_MEMPOOL(_mp_cb); +EVAS_MEMPOOL(_mp_pc); + void _evas_post_event_callback_call(Evas *e) { @@ -19,7 +23,7 @@ { if (!pc->func((void*)pc->data, e)) skip = 1; } - free(pc); + EVAS_MEMPOOL_FREE(_mp_pc, pc); } _evas_unwalk(e); } @@ -31,7 +35,7 @@ EINA_LIST_FREE(e->post_events, pc) { - free(pc); + EVAS_MEMPOOL_FREE(_mp_pc, pc); } _evas_unwalk(e); } @@ -51,7 +55,7 @@ if (fn->delete_me) { *list = eina_inlist_remove(*list, EINA_INLIST_GET(fn)); - free(fn); + EVAS_MEMPOOL_FREE(_mp_fn, fn); } } } @@ -65,7 +69,7 @@ evas_event_callback_list_post_free(&obj->callbacks->callbacks); if (!obj->callbacks->callbacks) { - free(obj->callbacks); + EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks); obj->callbacks = NULL; } } @@ -79,7 +83,7 @@ evas_event_callback_list_post_free(&e->callbacks->callbacks); if (!e->callbacks->callbacks) { - free(e->callbacks); + EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks); e->callbacks = NULL; } } @@ -100,7 +104,7 @@ /* MEM OK */ if (!obj->callbacks) return; evas_event_callback_list_post_free(&obj->callbacks->callbacks); - free(obj->callbacks); + EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks); obj->callbacks = NULL; } @@ -120,7 +124,7 @@ /* MEM OK */ if (!e->callbacks) return; evas_event_callback_list_post_free(&e->callbacks->callbacks); - free(e->callbacks); + EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks); e->callbacks = NULL; } @@ -440,19 +444,22 @@ if (!func) return; - fn = evas_mem_calloc(sizeof(Evas_Func_Node)); + if (!obj->callbacks) + { + EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, ); + obj->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); + if (!obj->callbacks) return; + EVAS_MEMPOOL_PREP(_mp_cb, obj->callbacks, Evas_Callbacks); + } + + EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); + fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); if (!fn) return; + EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); fn->func = func; fn->data = (void *)data; fn->type = type; - if (!obj->callbacks) - obj->callbacks = evas_mem_calloc(sizeof(Evas_Callbacks)); - if (!obj->callbacks) - { - free(fn); - return; - } obj->callbacks->callbacks = eina_inlist_prepend(obj->callbacks->callbacks, EINA_INLIST_GET(fn)); } @@ -648,19 +655,22 @@ if (!func) return; - fn = evas_mem_calloc(sizeof(Evas_Func_Node)); + if (!e->callbacks) + { + EVAS_MEMPOOL_INIT(_mp_cb, "evas_callbacks", Evas_Callbacks, 512, ); + e->callbacks = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Callbacks); + if (!e->callbacks) return; + EVAS_MEMPOOL_PREP(_mp_cb, e->callbacks, Evas_Callbacks); + } + + EVAS_MEMPOOL_INIT(_mp_fn, "evas_func_node", Evas_Func_Node, 2048, ); + fn = EVAS_MEMPOOL_ALLOC(_mp_fn, Evas_Func_Node); if (!fn) return; + EVAS_MEMPOOL_PREP(_mp_fn, fn, Evas_Func_Node); fn->func = func; fn->data = (void *)data; fn->type = type; - if (!e->callbacks) - e->callbacks = evas_mem_calloc(sizeof(Evas_Callbacks)); - if (!e->callbacks) - { - free(fn); - return; - } e->callbacks->callbacks = eina_inlist_prepend(e->callbacks->callbacks, EINA_INLIST_GET(fn)); } @@ -809,8 +819,10 @@ return; MAGIC_CHECK_END(); - pc = evas_mem_calloc(sizeof(Evas_Post_Callback)); + EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, ); + pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback); if (!pc) return; + EVAS_MEMPOOL_PREP(_mp_pc, pc, Evas_Post_Callback); if (e->delete_me) return; pc->func = func; Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -123,6 +123,8 @@ * @{ */ +EVAS_MEMPOOL(_mp_obj); + /** * Creates a new image object on the given evas. * @@ -2344,7 +2346,10 @@ Evas_Object_Image *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Image)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_image", Evas_Object_Image, 256, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Image); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Image); o->magic = MAGIC_OBJ_IMAGE; o->cur.fill.w = 0; o->cur.fill.h = 0; @@ -2384,7 +2389,7 @@ o->magic = 0; EINA_LIST_FREE(o->pixel_updates, r) eina_rectangle_free(r); - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } static void Modified: trunk/evas/src/lib/canvas/evas_object_line.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_line.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_line.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -78,6 +78,8 @@ * @{ */ +EVAS_MEMPOOL(_mp_obj); + /** * Adds a new evas line object to the given evas. * @param e The given evas. @@ -253,7 +255,10 @@ Evas_Object_Line *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Line)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_line", Evas_Object_Line, 16, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Line); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Line); o->magic = MAGIC_OBJ_LINE; o->cur.x1 = 0; o->cur.y1 = 0; Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -1,11 +1,13 @@ #include "evas_common.h" #include "evas_private.h" +EVAS_MEMPOOL(_mp_obj); +EVAS_MEMPOOL(_mp_sh); + static Eina_Inlist * get_layer_objects(Evas_Layer *l) { - if( !l || !l->objects ) return NULL; - + if ((!l) || (!l->objects)) return NULL; return (EINA_INLIST_GET(l->objects)); } @@ -15,9 +17,11 @@ { Evas_Object *obj; - obj = calloc(1, sizeof(Evas_Object)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object", Evas_Object, 512, NULL); + obj = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object); if (!obj) return NULL; - + EVAS_MEMPOOL_PREP(_mp_obj, obj, Evas_Object); + obj->magic = MAGIC_OBJ; obj->cur.scale = 1.0; obj->prev.scale = 1.0; @@ -51,8 +55,11 @@ free(node); } obj->magic = 0; - if (obj->size_hints) free(obj->size_hints); - free(obj); + if (obj->size_hints) + { + EVAS_MEMPOOL_FREE(_mp_sh, obj->size_hints); + } + EVAS_MEMPOOL_FREE(_mp_obj, obj); } void @@ -587,7 +594,10 @@ { if (obj->size_hints) return; - obj->size_hints = calloc(1, sizeof(Evas_Size_Hints)); + EVAS_MEMPOOL_INIT(_mp_sh, "evas_size_hints", Evas_Size_Hints, 512, ); + obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints); + if (!obj->size_hints) return; + EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints); obj->size_hints->max.w = -1; obj->size_hints->max.h = -1; obj->size_hints->align.x = 0.5; Modified: trunk/evas/src/lib/canvas/evas_object_polygon.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_polygon.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_polygon.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -80,6 +80,8 @@ * @{ */ +EVAS_MEMPOOL(_mp_obj); + /** * Adds a new evas polygon object to the given evas. * @param e The given evas. @@ -281,7 +283,10 @@ Evas_Object_Polygon *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Polygon)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_polygon", Evas_Object_Polygon, 32, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Polygon); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Polygon); o->magic = MAGIC_OBJ_POLYGON; return o; } @@ -306,7 +311,7 @@ obj->layer->evas->engine.data.context, o->engine_data); o->magic = 0; - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } static void Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_rectangle.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_rectangle.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -72,6 +72,8 @@ * @{ */ +EVAS_MEMPOOL(_mp_obj); + /** * Adds a rectangle to the given evas. * @param e The given evas. @@ -125,7 +127,10 @@ Evas_Object_Rectangle *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Rectangle)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_rectangle", Evas_Object_Rectangle, 256, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Rectangle); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Rectangle); o->magic = MAGIC_OBJ_RECTANGLE; return o; } @@ -142,7 +147,7 @@ MAGIC_CHECK_END(); /* free obj */ o->magic = 0; - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } static void Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -64,6 +64,9 @@ NULL }; +EVAS_MEMPOOL(_mp_obj); +EVAS_MEMPOOL(_mp_cb); + /* public funcs */ /** * Store a pointer to user data for a smart object. @@ -428,7 +431,10 @@ MAGIC_CHECK_END(); if (!event) return; if (!func) return; - cb = calloc(1, sizeof(Evas_Smart_Callback)); + EVAS_MEMPOOL_INIT(_mp_cb, "evas_smart_callback", Evas_Smart_Callback, 512, ); + cb = EVAS_MEMPOOL_ALLOC(_mp_cb, Evas_Smart_Callback); + if (!cb) return; + EVAS_MEMPOOL_PREP(_mp_cb, cb, Evas_Smart_Callback); cb->event = eina_stringshare_add(event); cb->func = func; cb->func_data = (void *)data; @@ -887,7 +893,7 @@ { o->callbacks = eina_list_remove(o->callbacks, cb); if (cb->event) eina_stringshare_del(cb->event); - free(cb); + EVAS_MEMPOOL_FREE(_mp_cb, cb); } } } @@ -925,7 +931,7 @@ cb = o->callbacks->data; o->callbacks = eina_list_remove(o->callbacks, cb); if (cb->event) eina_stringshare_del(cb->event); - free(cb); + EVAS_MEMPOOL_FREE(_mp_cb, cb); } evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0); @@ -1022,7 +1028,10 @@ Evas_Object_Smart *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Smart)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_smart", Evas_Object_Smart, 256, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Smart); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Smart); o->magic = MAGIC_OBJ_SMART; return o; } @@ -1039,7 +1048,7 @@ MAGIC_CHECK_END(); /* free obj */ o->magic = 0; - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } static void Modified: trunk/evas/src/lib/canvas/evas_object_smart_clipped.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart_clipped.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_smart_clipped.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -67,7 +67,7 @@ cso = evas_object_smart_data_get(obj); if (!cso) - cso = malloc(sizeof(*cso)); /* users can provide it or realloc() later */ + cso = calloc(1, sizeof(*cso)); /* users can provide it or realloc() later */ cso->evas = evas_object_evas_get(obj); clipper = evas_object_rectangle_add(cso->evas); Modified: trunk/evas/src/lib/canvas/evas_object_text.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_text.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_text.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -88,6 +88,8 @@ * @{ */ +EVAS_MEMPOOL(_mp_obj); + /** * Creates a new text @c Evas_Object on the provided @c Evas canvas. * @@ -1510,7 +1512,10 @@ Evas_Object_Text *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Text)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_text", Evas_Object_Text, 128, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Text); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Text); o->magic = MAGIC_OBJ_TEXT; o->prev = o->cur; #ifdef BIDI_SUPPORT @@ -1539,7 +1544,7 @@ evas_bidi_props_clean(&o->cur.intl_props); #endif o->magic = 0; - free(o); + EVAS_MEMPOOL_FREE(_mp_obj, o); } static void Modified: trunk/evas/src/lib/canvas/evas_object_textblock.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_textblock.c 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/canvas/evas_object_textblock.c 2010-11-26 10:01:18 UTC (rev 55006) @@ -784,6 +784,7 @@ "•\0" "\xe2\x80\xa2\0" ; +EVAS_MEMPOOL(_mp_obj); /** * @internal @@ -7170,7 +7171,10 @@ Evas_Object_Textblock *o; /* alloc obj private data */ - o = calloc(1, sizeof(Evas_Object_Textblock)); + EVAS_MEMPOOL_INIT(_mp_obj, "evas_object_textblock", Evas_Object_Textblock, 64, NULL); + o = EVAS_MEMPOOL_ALLOC(_mp_obj, Evas_Object_Textblock); + if (!o) return NULL; + EVAS_MEMPOOL_PREP(_mp_obj, o, Evas_Object_Textblock); o->magic = MAGIC_OBJ_TEXTBLOCK; o->cursor = calloc(1, sizeof(Evas_Textblock_Cursor)); _format_command_init(); @@ -7196,8 +7200,8 @@ } if (o->repch) eina_stringshare_del(o->repch); o->magic = 0; - free(o); - _format_command_shutdown(); + EVAS_MEMPOOL_FREE(_mp_obj, o); + _format_command_shutdown(); } Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2010-11-26 09:56:45 UTC (rev 55005) +++ trunk/evas/src/lib/include/evas_private.h 2010-11-26 10:01:18 UTC (rev 55006) @@ -821,7 +821,64 @@ Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); - +/****************************************************************************/ +/*****************************************/ +/********************/ +//#define MPOOL 1 + +#ifdef MPOOL +typedef struct _Evas_Mempool Evas_Mempool; + +struct _Evas_Mempool +{ + int count; + int num_allocs; + int num_frees; + Eina_Mempool *mp; +}; +# define EVAS_MEMPOOL(x) \ + static Evas_Mempool x = {0, 0, 0, NULL} +# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \ + do { \ + if (!x.mp) { \ + x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \ + if (!x.mp) { \ + return ret; \ + } \ + } \ + } while (0) +# define EVAS_MEMPOOL_ALLOC(x, siz) \ + eina_mempool_malloc(x.mp, sizeof(siz)) +# define EVAS_MEMPOOL_PREP(x, p, siz) \ + do { \ + x.count++; \ + x.num_allocs++; \ + memset(p, 0, sizeof(siz)); \ + } while (0) +# define EVAS_MEMPOOL_FREE(x, p) \ + do { \ + eina_mempool_free(x.mp, p); \ + x.count--; \ + x.num_frees++; \ + if (x.count <= 0) { \ + eina_mempool_del(x.mp); \ + x.mp = NULL; \ + x.count = 0; \ + } \ + } while (0) +#else +# define EVAS_MEMPOOL(x) +# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) +# define EVAS_MEMPOOL_PREP(x, p, siz) +# define EVAS_MEMPOOL_ALLOC(x, siz) \ + calloc(1, sizeof(siz)) +# define EVAS_MEMPOOL_FREE(x, p) \ + free(p) +#endif +/********************/ +/*****************************************/ +/****************************************************************************/ + #define EVAS_API_OVERRIDE(func, api, prefix) \ (api)->func = prefix##func |
From: Enlightenment S. <no-...@en...> - 2010-12-14 05:41:39
|
Log: lockdebug - be able to find mutexes that lock for a while... but.. i found what was blocking.. and it wasnt a mutex! well.. put this in for further debugging later. Author: raster Date: 2010-12-13 21:41:32 -0800 (Mon, 13 Dec 2010) New Revision: 55544 Trac: http://trac.enlightenment.org/e/changeset/55544 Modified: trunk/evas/src/lib/canvas/evas_main.c trunk/evas/src/lib/include/evas_common.h Modified: trunk/evas/src/lib/canvas/evas_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_main.c 2010-12-14 03:11:03 UTC (rev 55543) +++ trunk/evas/src/lib/canvas/evas_main.c 2010-12-14 05:41:32 UTC (rev 55544) @@ -2,6 +2,11 @@ #include "evas_private.h" #include "evas_cs.h" +#ifdef LKDEBUG +EAPI Eina_Bool lockdebug = EINA_FALSE; +EAPI int lockmax = 0; +#endif + static int _evas_init_count = 0; int _evas_log_dom_global = -1; /** @@ -22,6 +27,14 @@ if (++_evas_init_count != 1) return _evas_init_count; +#ifdef LKDEBUG + if (getenv("EVAS_LOCK_DEBUG")) + { + lockdebug = EINA_TRUE; + lockmax = atoi(getenv("EVAS_LOCK_DEBUG")); + } +#endif + #ifdef HAVE_EVIL if (!evil_init()) return --_evas_init_count; Modified: trunk/evas/src/lib/include/evas_common.h =================================================================== --- trunk/evas/src/lib/include/evas_common.h 2010-12-14 03:11:03 UTC (rev 55543) +++ trunk/evas/src/lib/include/evas_common.h 2010-12-14 05:41:32 UTC (rev 55544) @@ -135,19 +135,50 @@ # include <errno.h> #endif +//#define LKDEBUG 1 + +#ifdef LKDEBUG +EAPI Eina_Bool lockdebug; +EAPI int lockmax; +#endif + #define LK(x) pthread_mutex_t x #ifndef EVAS_FRAME_QUEUING -# define LKI(x) pthread_mutex_init(&(x), NULL); +# define LKI(x) pthread_mutex_init(&(x), NULL) #else -# define LKI(x) {pthread_mutexattr_t attr;\ - pthread_mutexattr_init(&attr); \ - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); \ - pthread_mutex_init(&(x), &attr);} +# define LKI(x) do {pthread_mutexattr_t __attr;\ + pthread_mutexattr_init(&__attr); \ + pthread_mutexattr_settype(&__attr, PTHREAD_MUTEX_RECURSIVE); \ + pthread_mutex_init(&(x), &__attr);} while (0) #endif -# define LKD(x) pthread_mutex_destroy(&(x)); -# define LKL(x) pthread_mutex_lock(&(x)); -# define LKT(x) pthread_mutex_trylock(&(x)); -# define LKU(x) pthread_mutex_unlock(&(x)); +# define LKD(x) pthread_mutex_destroy(&(x)) +# ifdef LKDEBUG +# define LKL(x) \ + do { \ + if (lockdebug) { \ + struct timeval t0, t1; \ + int dt; \ + gettimeofday(&t0, NULL); \ + pthread_mutex_lock(&(x)); \ + gettimeofday(&t1, NULL); \ + dt = (t1.tv_sec - t0.tv_sec) * 1000000; \ + if (t1.tv_usec > t0.tv_usec) dt += (t1.tv_usec - t0.tv_usec); \ + else dt -= t0.tv_usec - t1.tv_usec; \ + dt /= 1000; \ + if (dt > lockmax) { \ + fprintf(stderr, "HANG %ims - %s:%i - %s()\n", \ + dt, __FILE__, __LINE__, __FUNCTION__); \ + } \ + } \ + else { \ + pthread_mutex_lock(&(x)); \ + } \ + } while (0) +# else +# define LKL(x) pthread_mutex_lock(&(x)) +# endif +# define LKT(x) pthread_mutex_trylock(&(x)) +# define LKU(x) pthread_mutex_unlock(&(x)) # define TH(x) pthread_t x # define THI(x) int x # define TH_MAX 8 |
From: Enlightenment S. <no-...@en...> - 2011-01-16 08:03:34
|
Log: and reduce error more by making coords fp/double. Author: raster Date: 2011-01-16 00:03:28 -0800 (Sun, 16 Jan 2011) New Revision: 56181 Trac: http://trac.enlightenment.org/e/changeset/56181 Modified: trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2011-01-16 07:49:49 UTC (rev 56180) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2011-01-16 08:03:28 UTC (rev 56181) @@ -2469,9 +2469,9 @@ // draw geom +x +y for (; p < p_end; p++, pt++) { - pt->x = (p->x + x) << FP; - pt->y = (p->y + y) << FP; - pt->z = (p->z) << FP; + pt->x = ((int)p->x + x) << FP; + pt->y = ((int)p->y + y) << FP; + pt->z = ((int)p->z) << FP; // pt->x3 = p->px << FP; // pt->y3 = p->py << FP; pt->fx = p->px; Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2011-01-16 07:49:49 UTC (rev 56180) +++ trunk/evas/src/lib/canvas/evas_render.c 2011-01-16 08:03:28 UTC (rev 56181) @@ -678,11 +678,9 @@ pt = pts; for (; p < p_end; p++, pt++) { - pt->x = (p->x + off_x) << FP; - pt->y = (p->y + off_y) << FP; - pt->z = (p->z) << FP; -// pt->x3 = p->px << FP; -// pt->y3 = p->py << FP; + pt->x = (p->x + (double)off_x) * FP1; + pt->y = (p->y + (double)off_y) * FP1; + pt->z = (p->z) * FP1; pt->fx = p->px; pt->fy = p->py; pt->fz = p->z; Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2011-01-16 07:49:49 UTC (rev 56180) +++ trunk/evas/src/lib/include/evas_private.h 2011-01-16 08:03:28 UTC (rev 56181) @@ -358,8 +358,7 @@ struct _Evas_Map_Point { - Evas_Coord x, y, z, px, py; - double fx, fy, fz, fpx, fpy; + double x, y, z, px, py; double u, v; unsigned char r, g, b, a; }; |
From: Enlightenment S. <no-...@en...> - 2011-01-26 09:57:01
|
Log: notes for later. Author: raster Date: 2011-01-26 01:56:54 -0800 (Wed, 26 Jan 2011) New Revision: 56305 Trac: http://trac.enlightenment.org/e/changeset/56305 Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_object_rectangle.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_rectangle.c 2011-01-26 08:45:11 UTC (rev 56304) +++ trunk/evas/src/lib/canvas/evas_object_rectangle.c 2011-01-26 09:56:54 UTC (rev 56305) @@ -201,6 +201,8 @@ /* if it just became visible or invisible */ is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); +/* POST 1.0 -> enable */ +/* if (!(is_v | was_v)) goto done;*/ if (is_v != was_v) { evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v); Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2011-01-26 08:45:11 UTC (rev 56304) +++ trunk/evas/src/lib/include/evas_inline.x 2011-01-26 09:56:54 UTC (rev 56305) @@ -88,8 +88,8 @@ static inline int evas_object_is_visible(Evas_Object *obj) -{ - if ((obj->cur.visible) && +{ /* post 1.0 -> enable? */ + if ((obj->cur.visible)/* && (obj->cur.color.a > 0)*/ && ((obj->cur.cache.clip.visible) || (obj->smart.smart)) && ((obj->cur.cache.clip.a > 0 && obj->cur.render_op == EVAS_RENDER_BLEND) || obj->cur.render_op != EVAS_RENDER_BLEND)) |
From: Enlightenment S. <no-...@en...> - 2011-04-20 08:07:05
|
Log: and fix more filter messups. o->fitler will be leaked on obj deletion as there was no cleanup.. and the method of exposing evas_filter_key_get() was so out of step with any other code i have ever seen.. letalong evas... fix. Author: raster Date: 2011-04-20 01:06:59 -0700 (Wed, 20 Apr 2011) New Revision: 58747 Trac: http://trac.enlightenment.org/e/changeset/58747 Modified: trunk/evas/src/lib/canvas/evas_filter.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_object_main.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_filter.c =================================================================== --- trunk/evas/src/lib/canvas/evas_filter.c 2011-04-20 08:05:23 UTC (rev 58746) +++ trunk/evas/src/lib/canvas/evas_filter.c 2011-04-20 08:06:59 UTC (rev 58747) @@ -143,7 +143,7 @@ return EINA_FALSE; MAGIC_CHECK_END(); - if (mode != EVAS_FILTER_MODE_OBJECT && mode != EVAS_FILTER_MODE_BELOW) + if ((mode != EVAS_FILTER_MODE_OBJECT) && (mode != EVAS_FILTER_MODE_BELOW)) return EINA_FALSE; if (!o->filter) @@ -205,8 +205,12 @@ } info->datalen = finfo->datasize; if (finfo->datasize) - // FIXME: hande calloc fail - info->data = calloc(1,finfo->datasize); + { + info->data = calloc(1, finfo->datasize); + if (!info->data) + { + } + } else info->data = NULL; info->data_free = NULL; @@ -332,10 +336,13 @@ rv = EINA_TRUE; } } - return rv; } + + + + /* * Internal call */ @@ -344,7 +351,7 @@ int *outw, int *outh, Eina_Bool inv) { if (!info) return -1; - if (!outw && !outh) return 0; + if ((!outw) && (!outh)) return 0; if (filterinfo[info->filter].sizefn) return filterinfo[info->filter].sizefn(info, inw, inh, outw, outh, inv); @@ -397,7 +404,44 @@ return key; } +Evas_Software_Filter_Fn +evas_filter_software_get(Evas_Filter_Info *info) +{ + return filterinfo[info->filter].filter; +} +void +evas_filter_free(Evas_Object *o) +{ + if (!o->filter) return; + free(o->filter); + o->filter = NULL; +} + + + + +/* + * Private calls + */ +static Evas_Filter_Info * +filter_alloc(Evas_Object *o) +{ + Evas_Filter_Info *info; + + if (!o) return NULL; + info = calloc(1,sizeof(struct Evas_Filter_Info)); + if (!info) return NULL; + info->dirty = 1; + info->filter = EVAS_FILTER_NONE; + info->mode = EVAS_FILTER_MODE_OBJECT; + info->datalen = 0; + + o->filter = info; + + return info; +} + static int blur_size_get(Evas_Filter_Info *info, int inw, int inh, int *outw, int *outh, Eina_Bool inv) @@ -417,7 +461,7 @@ return 0; } -/** +/* * Generate a key for the Gaussian generator. * * The size is: @@ -449,33 +493,24 @@ return key; } -Evas_Software_Filter_Fn -evas_filter_software_get(Evas_Filter_Info *info) -{ - return filterinfo[info->filter].filter; -} -/* - * Private calls - */ -static Evas_Filter_Info * -filter_alloc(Evas_Object *o) -{ - Evas_Filter_Info *info; - if (!o) return NULL; - // FIXME: handle alloc failure - info = calloc(1,sizeof(struct Evas_Filter_Info)); - info->dirty = 1; - info->filter = EVAS_FILTER_NONE; - info->mode = EVAS_FILTER_MODE_OBJECT; - info->datalen = 0; - o->filter = info; - return info; -} + + + + + + + + + + + + + /** * Software implementations */ Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2011-04-20 08:05:23 UTC (rev 58746) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2011-04-20 08:06:59 UTC (rev 58747) @@ -2450,7 +2450,6 @@ { uint32_t len; uint8_t *key; - uint8_t *evas_filter_key_get(void *, void *); if (obj->filter->key) free(obj->filter->key); key = evas_filter_key_get(obj->filter, &len); Modified: trunk/evas/src/lib/canvas/evas_object_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_main.c 2011-04-20 08:05:23 UTC (rev 58746) +++ trunk/evas/src/lib/canvas/evas_object_main.c 2011-04-20 08:06:59 UTC (rev 58747) @@ -34,6 +34,7 @@ { int was_smart_child = 0; + evas_filter_free(obj); evas_object_map_set(obj, NULL); evas_object_grabs_cleanup(obj); evas_object_intercept_cleanup(obj); Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2011-04-20 08:05:23 UTC (rev 58746) +++ trunk/evas/src/lib/include/evas_private.h 2011-04-20 08:06:59 UTC (rev 58747) @@ -400,10 +400,13 @@ typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *); -EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info); int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh, int *outw, int *outh, Eina_Bool inv); Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info); +uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp); +// expose for use in engines +EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info); +void evas_filter_free(Evas_Object *o); struct _Evas_Object { @@ -876,6 +879,7 @@ void _evas_walk(Evas *e); void _evas_unwalk(Evas *e); +// expose for use in engines EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name); void evas_render_invalidate(Evas *e); @@ -883,7 +887,7 @@ Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); - + /****************************************************************************/ /*****************************************/ /********************/ |
From: Enlightenment S. <no-...@en...> - 2011-08-20 14:40:35
|
Log: fix proxy rendering!!!! ugh. i dont like the way i did it.. but its quick and does the job. Author: raster Date: 2011-08-20 07:40:28 -0700 (Sat, 20 Aug 2011) New Revision: 62631 Trac: http://trac.enlightenment.org/e/changeset/62631 Modified: trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2011-08-20 13:03:01 UTC (rev 62630) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2011-08-20 14:40:28 UTC (rev 62631) @@ -2231,8 +2231,16 @@ source->proxy.w = w; source->proxy.h = h; } - + ctx = e->engine.func->context_new(e->engine.data.output); + evas_render_mapped(e, source, ctx, source->proxy.surface, + -source->cur.geometry.x, + -source->cur.geometry.y, + 1, 0, 0, e->output.w, e->output.h); + e->engine.func->context_free(e->engine.data.output, ctx); + source->proxy.surface = e->engine.func->image_dirty_region + (e->engine.data.output, source->proxy.surface, 0, 0, w, h); +/* e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0); e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY); e->engine.func->rectangle_draw(e->engine.data.output, ctx, @@ -2265,6 +2273,7 @@ e->engine.func->context_free(e->engine.data.output, ctx); source->proxy.surface = e->engine.func->image_dirty_region (e->engine.data.output, source->proxy.surface, 0, 0, w, h); + */ } #if 0 // filtering disabled Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2011-08-20 13:03:01 UTC (rev 62630) +++ trunk/evas/src/lib/canvas/evas_render.c 2011-08-20 14:40:28 UTC (rev 62631) @@ -647,7 +647,7 @@ } */ -static Eina_Bool +Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, int off_x, int off_y, int mapped, int ecx, int ecy, int ecw, int ech Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2011-08-20 13:03:01 UTC (rev 62630) +++ trunk/evas/src/lib/include/evas_private.h 2011-08-20 14:40:28 UTC (rev 62631) @@ -989,6 +989,10 @@ // expose for use in engines EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name); +Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj, + void *context, void *surface, + int off_x, int off_y, int mapped, + int ecx, int ecy, int ecw, int ech); void evas_render_invalidate(Evas *e); void evas_render_object_recalc(Evas_Object *obj); |
From: Enlightenment S. <no-...@en...> - 2011-08-29 12:15:02
|
Log: i've found a subtle issue with how we queue recalcs of smart objs. if an obj is already queued we dont push it FURTHEr down the queue if smart recalc is enabled. now at least we keep order of operation/calc correctly! Author: raster Date: 2011-08-29 05:14:55 -0700 (Mon, 29 Aug 2011) New Revision: 62944 Trac: http://trac.enlightenment.org/e/changeset/62944 Modified: trunk/evas/src/lib/canvas/evas_main.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_main.c 2011-08-29 11:55:25 UTC (rev 62943) +++ trunk/evas/src/lib/canvas/evas_main.c 2011-08-29 12:14:55 UTC (rev 62944) @@ -249,6 +249,8 @@ eina_array_flush(&e->calculate_objects); eina_array_flush(&e->clip_changes); + eina_list_free(e->calc_list); + e->magic = 0; free(e); } Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2011-08-29 11:55:25 UTC (rev 62943) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2011-08-29 12:14:55 UTC (rev 62944) @@ -10,7 +10,8 @@ void *engine_data; void *data; Eina_List *callbacks; - Eina_Inlist *contained; + Eina_Inlist *contained; + Eina_List *calc_node; Evas_Smart_Cb_Description_Array callbacks_descriptions; int walking_list; Eina_Bool deletions_waiting : 1; @@ -548,7 +549,38 @@ return; MAGIC_CHECK_END(); + // XXX: do i need this? + if (obj->delete_me) return; + value = !!value; + if (value) + { + Evas *e = obj->layer->evas; + + if (o->need_recalculate) + { + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_demote_list(e->calc_list, + o->calc_node); + else + e->calc_list = eina_list_append(e->calc_list, obj); + } + else + e->calc_list = eina_list_append(e->calc_list, obj); + o->calc_node = eina_list_last(e->calc_list); + } + else + { + Evas *e = obj->layer->evas; + + if (o->need_recalculate) + { + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_remove_list(e->calc_list, + o->calc_node); + o->calc_node = NULL; + } + } if (o->need_recalculate == value) return; @@ -568,11 +600,14 @@ * XXX: on _evas_render_call_smart_calculate() will check for the flag * XXX: and it will be unset after the first. */ + +/* if (o->need_recalculate) { Evas *e = obj->layer->evas; eina_array_push(&e->calculate_objects, obj); } + */ /* TODO: else, remove from array */ } @@ -638,31 +673,31 @@ { Eina_Array *calculate; Evas_Object *obj; - Eina_Array_Iterator it; - unsigned int i; + Eina_List *l; +// printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n"); evas_event_freeze(e); e->in_smart_calc++; - calculate = &e->calculate_objects; - for (i = 0; i < eina_array_count_get(calculate); ++i) + + EINA_LIST_FOREACH(e->calc_list, l, obj) { - Evas_Object_Smart *o; - - obj = eina_array_data_get(calculate, i); - if (obj->delete_me) - continue; - - o = obj->object_data; + Evas_Object_Smart *o = obj->object_data; + + if (obj->delete_me) continue; + e->calc_list_current = l; if (o->need_recalculate) { o->need_recalculate = 0; obj->smart.smart->smart_class->calculate(obj); } + if (o->calc_node == l) o->calc_node = NULL; + e->calc_list_current = NULL; } - EINA_ARRAY_ITER_NEXT(calculate, i, obj, it) + EINA_LIST_FREE(e->calc_list, obj) { obj->recalculate_cycle = 0; } + e->calc_list_current = NULL; e->in_smart_calc--; if (e->in_smart_calc == 0) { @@ -671,6 +706,7 @@ } evas_event_thaw(e); evas_event_thaw_eval(e); +// printf("-CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------^\n"); } EAPI void @@ -731,13 +767,19 @@ o = (Evas_Object_Smart *)(obj->object_data); if (o->magic == MAGIC_OBJ_SMART) { + Evas *e = obj->layer->evas; + + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_remove_list(e->calc_list, + o->calc_node); + o->calc_node = NULL; while (o->contained) - evas_object_smart_member_del((Evas_Object *)o->contained); + evas_object_smart_member_del((Evas_Object *)o->contained); while (o->callbacks) { Evas_Smart_Callback *cb; - + cb = o->callbacks->data; o->callbacks = eina_list_remove(o->callbacks, cb); if (cb->event) eina_stringshare_del(cb->event); Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2011-08-29 11:55:25 UTC (rev 62943) +++ trunk/evas/src/lib/include/evas_private.h 2011-08-29 12:14:55 UTC (rev 62944) @@ -305,6 +305,9 @@ Eina_Array calculate_objects; Eina_Array clip_changes; + Eina_List *calc_list; + Eina_List *calc_list_current; + Eina_List *post_events; // free me on evas_free Evas_Callbacks *callbacks; |
From: Enlightenment S. <no-...@en...> - 2011-08-29 23:45:32
|
Log: lets do that again. recalc list instead of recalc array. why? fixes nasty ordering issues where recalc items dont get pushed later into the recalc queue after the things they depend on. Author: raster Date: 2011-08-29 16:45:24 -0700 (Mon, 29 Aug 2011) New Revision: 62977 Trac: http://trac.enlightenment.org/e/changeset/62977 Modified: trunk/evas/src/lib/canvas/evas_main.c trunk/evas/src/lib/canvas/evas_object_smart.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_main.c =================================================================== --- trunk/evas/src/lib/canvas/evas_main.c 2011-08-29 21:53:37 UTC (rev 62976) +++ trunk/evas/src/lib/canvas/evas_main.c 2011-08-29 23:45:24 UTC (rev 62977) @@ -249,6 +249,8 @@ eina_array_flush(&e->calculate_objects); eina_array_flush(&e->clip_changes); + eina_list_free(e->calc_list); + e->magic = 0; free(e); } Modified: trunk/evas/src/lib/canvas/evas_object_smart.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_smart.c 2011-08-29 21:53:37 UTC (rev 62976) +++ trunk/evas/src/lib/canvas/evas_object_smart.c 2011-08-29 23:45:24 UTC (rev 62977) @@ -10,7 +10,8 @@ void *engine_data; void *data; Eina_List *callbacks; - Eina_Inlist *contained; + Eina_Inlist *contained; + Eina_List *calc_node; Evas_Smart_Cb_Description_Array callbacks_descriptions; int walking_list; Eina_Bool deletions_waiting : 1; @@ -548,32 +549,51 @@ return; MAGIC_CHECK_END(); + // XXX: do i need this? + if (obj->delete_me) return; + value = !!value; - if (o->need_recalculate == value) - return; + if (value) + { + Evas *e = obj->layer->evas; + + if (o->need_recalculate) + { + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_demote_list(e->calc_list, + o->calc_node); + else + e->calc_list = eina_list_append(e->calc_list, obj); + } + else + e->calc_list = eina_list_append(e->calc_list, obj); + o->calc_node = eina_list_last(e->calc_list); + } + else + { + Evas *e = obj->layer->evas; + + if (o->need_recalculate) + { + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_remove_list(e->calc_list, + o->calc_node); + o->calc_node = NULL; + + } + } + + if (o->need_recalculate == value) return; if (obj->recalculate_cycle > 64) { ERR("Object %p is not stable during recalc loop", obj); - return ; + return; } - if (obj->layer->evas->in_smart_calc) - obj->recalculate_cycle++; + if (obj->layer->evas->in_smart_calc) obj->recalculate_cycle++; o->need_recalculate = value; if (!obj->smart.smart->smart_class->calculate) return; - - /* XXX: objects can be present multiple times in calculate_objects() - * XXX: after a set-unset-set cycle, but it's not a problem since - * XXX: on _evas_render_call_smart_calculate() will check for the flag - * XXX: and it will be unset after the first. - */ - if (o->need_recalculate) - { - Evas *e = obj->layer->evas; - eina_array_push(&e->calculate_objects, obj); - } - /* TODO: else, remove from array */ } EAPI Eina_Bool @@ -636,41 +656,37 @@ void evas_call_smarts_calculate(Evas *e) { - Eina_Array *calculate; Evas_Object *obj; - Eina_Array_Iterator it; - unsigned int i; + Eina_List *l; +// printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n"); evas_event_freeze(e); e->in_smart_calc++; - calculate = &e->calculate_objects; - for (i = 0; i < eina_array_count_get(calculate); ++i) + + EINA_LIST_FOREACH(e->calc_list, l, obj) { - Evas_Object_Smart *o; - - obj = eina_array_data_get(calculate, i); - if (obj->delete_me) - continue; - - o = obj->object_data; + Evas_Object_Smart *o = obj->object_data; + + if (obj->delete_me) continue; + e->calc_list_current = l; if (o->need_recalculate) { o->need_recalculate = 0; obj->smart.smart->smart_class->calculate(obj); } + if (o->calc_node == l) o->calc_node = NULL; + e->calc_list_current = NULL; } - EINA_ARRAY_ITER_NEXT(calculate, i, obj, it) + EINA_LIST_FREE(e->calc_list, obj) { obj->recalculate_cycle = 0; } + e->calc_list_current = NULL; e->in_smart_calc--; - if (e->in_smart_calc == 0) - { - eina_array_clean(calculate); - e->smart_calc_count++; - } + if (e->in_smart_calc == 0) e->smart_calc_count++; evas_event_thaw(e); evas_event_thaw_eval(e); +// printf("-CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------^\n"); } EAPI void @@ -731,13 +747,19 @@ o = (Evas_Object_Smart *)(obj->object_data); if (o->magic == MAGIC_OBJ_SMART) { + Evas *e = obj->layer->evas; + + if ((o->calc_node) && (e->calc_list_current != o->calc_node)) + e->calc_list = eina_list_remove_list(e->calc_list, + o->calc_node); + o->calc_node = NULL; while (o->contained) - evas_object_smart_member_del((Evas_Object *)o->contained); + evas_object_smart_member_del((Evas_Object *)o->contained); while (o->callbacks) { Evas_Smart_Callback *cb; - + cb = o->callbacks->data; o->callbacks = eina_list_remove(o->callbacks, cb); if (cb->event) eina_stringshare_del(cb->event); Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2011-08-29 21:53:37 UTC (rev 62976) +++ trunk/evas/src/lib/include/evas_private.h 2011-08-29 23:45:24 UTC (rev 62977) @@ -305,6 +305,9 @@ Eina_Array calculate_objects; Eina_Array clip_changes; + Eina_List *calc_list; + Eina_List *calc_list_current; + Eina_List *post_events; // free me on evas_free Evas_Callbacks *callbacks; |
From: Enlightenment S. <no-...@en...> - 2011-10-26 13:33:39
|
Log: fix clip-out issue after making mapped objs opque fix was in. Author: raster Date: 2011-10-26 06:33:25 -0700 (Wed, 26 Oct 2011) New Revision: 64413 Trac: http://trac.enlightenment.org/e/changeset/64413 Modified: trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/canvas/evas_object_image.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2011-10-26 09:41:40 UTC (rev 64412) +++ trunk/evas/src/lib/canvas/evas_map.c 2011-10-26 13:33:25 UTC (rev 64413) @@ -93,9 +93,10 @@ if (p->y < y1) y1 = p->y; if (p->y > y2) y2 = p->y; } - // add 1 pixel of fuzz around the map region to ensure updates are correct - x1 -= 1; y1 -= 1; - x2 += 1; y2 += 1; +// this causes clip-out bugs now mapped objs canbe opaque!!! +// // add 1 pixel of fuzz around the map region to ensure updates are correct +// x1 -= 1; y1 -= 1; +// x2 += 1; y2 += 1; if (obj->cur.map->normal_geometry.x != x1) ch = 1; if (obj->cur.map->normal_geometry.y != y1) ch = 1; if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1; Modified: trunk/evas/src/lib/canvas/evas_object_image.c =================================================================== --- trunk/evas/src/lib/canvas/evas_object_image.c 2011-10-26 09:41:40 UTC (rev 64412) +++ trunk/evas/src/lib/canvas/evas_object_image.c 2011-10-26 13:33:25 UTC (rev 64413) @@ -3498,7 +3498,13 @@ (m->points[0].y == m->points[3].y) && (m->points[1].y == m->points[2].y)) ) - return o->cur.opaque; + { + if ((m->points[0].x == obj->cur.geometry.x) && + (m->points[0].y == obj->cur.geometry.y) && + (m->points[2].x == (obj->cur.geometry.x + obj->cur.geometry.w)) && + (m->points[2].y == (obj->cur.geometry.y + obj->cur.geometry.h))) + return o->cur.opaque; + } } o->cur.opaque = 0; return o->cur.opaque; Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2011-10-26 09:41:40 UTC (rev 64412) +++ trunk/evas/src/lib/include/evas_inline.x 2011-10-26 13:33:25 UTC (rev 64413) @@ -207,13 +207,14 @@ cb = obj->cur.color.b; ca = obj->cur.color.a; if (obj->cur.clipper) { -// this causes problems... hmmm +// this causes problems... hmmm ????? if (obj->cur.clipper->cur.cache.clip.dirty) evas_object_clip_recalc(obj->cur.clipper); // I don't know why this test was here in the first place. As I have // no issue showing up due to this, I keep it and move color out of it. - if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent) +// breaks cliping of mapped images!!! +// if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent) { nx = obj->cur.clipper->cur.cache.clip.x; ny = obj->cur.clipper->cur.cache.clip.y; |
From: Enlightenment S. <no-...@en...> - 2011-10-27 09:39:25
|
Log: and fix evas map used as mapbuf with clipping and stuff! ugh! the forever shifting bug! evas_render needs a rewrite Author: raster Date: 2011-10-27 02:39:18 -0700 (Thu, 27 Oct 2011) New Revision: 64429 Trac: http://trac.enlightenment.org/e/changeset/64429 Modified: trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_inline.x Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2011-10-27 08:12:54 UTC (rev 64428) +++ trunk/evas/src/lib/canvas/evas_render.c 2011-10-27 09:39:18 UTC (rev 64429) @@ -1264,6 +1264,64 @@ return clean_them; } +static void +_evas_render_cutout_add(Evas *e, Evas_Object *obj, int off_x, int off_y) +{ + if (evas_object_is_opaque(obj)) + { + Evas_Coord cox, coy, cow, coh; + + cox = obj->cur.cache.clip.x; + coy = obj->cur.cache.clip.y; + cow = obj->cur.cache.clip.w; + coh = obj->cur.cache.clip.h; + if ((obj->cur.map) && (obj->cur.usemap)) + { + Evas_Object *oo; + + oo = obj; + while (oo->cur.clipper) + { + if ((oo->cur.clipper->cur.map_parent + != oo->cur.map_parent) && + (!((oo->cur.map) && (oo->cur.usemap)))) + break; + RECTS_CLIP_TO_RECT(cox, coy, cow, coh, + oo->cur.geometry.x, + oo->cur.geometry.y, + oo->cur.geometry.w, + oo->cur.geometry.h); + oo = oo->cur.clipper; + } + } + e->engine.func->context_cutout_add + (e->engine.data.output, e->engine.data.context, + cox + off_x, coy + off_y, cow, coh); + } + else + { + if (obj->func->get_opaque_rect) + { + Evas_Coord obx, oby, obw, obh; + + obj->func->get_opaque_rect(obj, &obx, &oby, &obw, &obh); + if ((obw > 0) && (obh > 0)) + { + obx += off_x; + oby += off_y; + RECTS_CLIP_TO_RECT(obx, oby, obw, obh, + obj->cur.cache.clip.x + off_x, + obj->cur.cache.clip.y + off_y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h); + e->engine.func->context_cutout_add + (e->engine.data.output, e->engine.data.context, + obx, oby, obw, obh); + } + } + } +} + static Eina_List * evas_render_updates_internal(Evas *e, unsigned char make_updates, @@ -1424,42 +1482,7 @@ /* reset the background of the area if needed (using cutout and engine alpha flag to help) */ if (alpha) - { - if (evas_object_is_opaque(obj)) - e->engine.func->context_cutout_add - (e->engine.data.output, - e->engine.data.context, - obj->cur.cache.clip.x + off_x, - obj->cur.cache.clip.y + off_y, - obj->cur.cache.clip.w, - obj->cur.cache.clip.h); - else - { - if (obj->func->get_opaque_rect) - { - Evas_Coord obx, oby, obw, obh; - - obj->func->get_opaque_rect - (obj, &obx, &oby, &obw, &obh); - if ((obw > 0) && (obh > 0)) - { - obx += off_x; - oby += off_y; - RECTS_CLIP_TO_RECT - (obx, oby, obw, obh, - obj->cur.cache.clip.x + off_x, - obj->cur.cache.clip.y + off_y, - obj->cur.cache.clip.w, - obj->cur.cache.clip.h); - e->engine.func->context_cutout_add - (e->engine.data.output, - e->engine.data.context, - obx, oby, - obw, obh); - } - } - } - } + _evas_render_cutout_add(e, obj, off_x, off_y); } } if (alpha) @@ -1540,38 +1563,9 @@ { Evas_Object *obj2; - obj2 = (Evas_Object *) eina_array_data_get(&e->temporary_objects, j); - if (evas_object_is_opaque(obj2)) - e->engine.func->context_cutout_add(e->engine.data.output, - e->engine.data.context, - obj2->cur.cache.clip.x + off_x, - obj2->cur.cache.clip.y + off_y, - obj2->cur.cache.clip.w, - obj2->cur.cache.clip.h); - else - { - if (obj2->func->get_opaque_rect) - { - Evas_Coord obx, oby, obw, obh; - - obj2->func->get_opaque_rect - (obj2, &obx, &oby, &obw, &obh); - if ((obw > 0) && (obh > 0)) - { - obx += off_x; - oby += off_y; - RECTS_CLIP_TO_RECT(obx, oby, obw, obh, - obj2->cur.cache.clip.x + off_x, - obj2->cur.cache.clip.y + off_y, - obj2->cur.cache.clip.w, - obj2->cur.cache.clip.h); - e->engine.func->context_cutout_add(e->engine.data.output, - e->engine.data.context, - obx, oby, - obw, obh); - } - } - } + obj2 = (Evas_Object *)eina_array_data_get + (&e->temporary_objects, j); + _evas_render_cutout_add(e, obj2, off_x, off_y); } #endif e->engine.func->context_clip_set(e->engine.data.output, Modified: trunk/evas/src/lib/include/evas_inline.x =================================================================== --- trunk/evas/src/lib/include/evas_inline.x 2011-10-27 08:12:54 UTC (rev 64428) +++ trunk/evas/src/lib/include/evas_inline.x 2011-10-27 09:39:18 UTC (rev 64429) @@ -214,7 +214,7 @@ // I don't know why this test was here in the first place. As I have // no issue showing up due to this, I keep it and move color out of it. // breaks cliping of mapped images!!! -// if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent) + if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent) { nx = obj->cur.clipper->cur.cache.clip.x; ny = obj->cur.clipper->cur.cache.clip.y; |
From: Enlightenment S. <no-...@en...> - 2012-03-21 04:04:10
|
Log: fix map overdraw issue that has snuck in during development Author: raster Date: 2012-03-20 21:04:03 -0700 (Tue, 20 Mar 2012) New Revision: 69534 Trac: http://trac.enlightenment.org/e/changeset/69534 Modified: trunk/evas/src/lib/canvas/evas_map.c trunk/evas/src/lib/canvas/evas_render.c trunk/evas/src/lib/include/evas_private.h Modified: trunk/evas/src/lib/canvas/evas_map.c =================================================================== --- trunk/evas/src/lib/canvas/evas_map.c 2012-03-21 02:38:17 UTC (rev 69533) +++ trunk/evas/src/lib/canvas/evas_map.c 2012-03-21 04:04:03 UTC (rev 69534) @@ -374,9 +374,11 @@ MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; MAGIC_CHECK_END(); + Eina_Bool pchange = EINA_FALSE; enabled = !!enabled; if (obj->cur.usemap == enabled) return; + pchange = obj->changed; obj->cur.usemap = enabled; if (enabled) { @@ -405,6 +407,8 @@ /* This is a bit heavy handed, but it fixes the case of same geometry, but * changed colour or UV settings. */ evas_object_change(obj); + if (!obj->changed_pchange) obj->changed_pchange = pchange; + obj->changed_map = EINA_TRUE; } EAPI Eina_Bool Modified: trunk/evas/src/lib/canvas/evas_render.c =================================================================== --- trunk/evas/src/lib/canvas/evas_render.c 2012-03-21 02:38:17 UTC (rev 69533) +++ trunk/evas/src/lib/canvas/evas_render.c 2012-03-21 04:04:03 UTC (rev 69534) @@ -612,6 +612,8 @@ obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } return obj->changed ? EINA_TRUE : EINA_FALSE; } @@ -984,6 +986,8 @@ o2->changed_move_only = 0; o2->changed_nomove = 0; o2->changed_move = 0; + o2->changed_map = 0; + o2->changed_pchange = 0; continue; } if (o2->changed) @@ -994,6 +998,8 @@ o2->changed_move_only = 0; o2->changed_nomove = 0; o2->changed_move = 0; + o2->changed_map = 0; + o2->changed_pchange = 0; break; } } @@ -1002,16 +1008,21 @@ obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } else { if (obj->changed) { - changed = 1; + if ((obj->changed_pchange) && (obj->changed_map)) + changed = 1; obj->changed = 0; obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } } @@ -1144,10 +1155,12 @@ e->engine.data.context, ecx, ecy, ecw, ech); if (obj->cur.cache.clip.visible) - obj->layer->evas->engine.func->image_map_draw - (e->engine.data.output, e->engine.data.context, surface, - obj->cur.map->surface, obj->cur.map->count, pts, - obj->cur.map->smooth, 0); + { + obj->layer->evas->engine.func->image_map_draw + (e->engine.data.output, e->engine.data.context, surface, + obj->cur.map->surface, obj->cur.map->count, pts, + obj->cur.map->smooth, 0); + } // FIXME: needs to cache these maps and // keep them only rendering updates // obj->layer->evas->engine.func->image_map_surface_free @@ -1640,6 +1653,8 @@ obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } else if ((obj->cur.map != obj->prev.map) || (obj->cur.usemap != obj->prev.usemap)) @@ -1651,6 +1666,8 @@ obj->changed_move_only = 0; obj->changed_nomove = 0; obj->changed_move = 0; + obj->changed_map = 0; + obj->changed_pchange = 0; } /* moved to other pre-process phase 1 if (obj->delete_me == 2) Modified: trunk/evas/src/lib/include/evas_private.h =================================================================== --- trunk/evas/src/lib/include/evas_private.h 2012-03-21 02:38:17 UTC (rev 69533) +++ trunk/evas/src/lib/include/evas_private.h 2012-03-21 04:04:03 UTC (rev 69534) @@ -615,6 +615,8 @@ Eina_Bool changed_move : 1; Eina_Bool changed_move_only : 1; Eina_Bool changed_nomove : 1; + Eina_Bool changed_map : 1; + Eina_Bool changed_pchange : 1; Eina_Bool del_ref : 1; Eina_Bool is_frame : 1; |