elementary/mapbuf - revert 1850e735698f926cad8303cfe96610b5c58410d1

This makes the mapbuf performance slow down before it enabled the mapbuf.

need more better way.
This commit is contained in:
ChunEon Park 2013-09-27 21:52:10 +09:00
parent e985332fe4
commit 0c3ca99871
2 changed files with 5 additions and 42 deletions

View File

@ -115,40 +115,18 @@ _configure(Evas_Object *obj, Eina_Bool update_force)
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->content) return;
Eina_Bool inside_all = EINA_FALSE;
Evas_Coord x, y, w, h, x2, y2, w2, h2, vx, vy, vw, vh;
Evas_Coord x, y, w, h, x2, y2, w2, h2;
evas_object_geometry_get(wd->resize_obj, &x, &y, &w, &h);
evas_object_geometry_get(sd->content, &x2, &y2, &w2, &h2);
if ((update_force) || ((x != x2) || (y != y2) || (w != w2) || (h != h2)))
{
Evas *e = evas_object_evas_get(obj);
evas_output_viewport_get(e, &vx, &vy, &vw, &vh);
/* Apply no changes once the content is rendered fully one time. We
aren't sure that the content is updated correctly if the content was
outside of the viewport, especially it has many child members. Some
type of children will do the lazy updated (ie, textblock) on right
before the rendering. It means they lose the update time cause
of the mapbuf since the mapbuf tries nochange forcefully. */
if (!sd->inside_view[0] && ((x >= vx) && (x <= (vx + vw))))
sd->inside_view[0] = EINA_TRUE;
if (!sd->inside_view[1] && ((y >= vy) && (y <= (vy + vh))))
sd->inside_view[1] = EINA_TRUE;
if (!sd->inside_view[2] && (((x + w) >= vx) && ((x + w) <= (vx + vw))))
sd->inside_view[2] = EINA_TRUE;
if (!sd->inside_view[3] && (((y + h) >= vy) && ((y + h) <= (vy + vh))))
sd->inside_view[3] = EINA_TRUE;
if (sd->inside_view[0] && sd->inside_view[1] && sd->inside_view[2] &&
sd->inside_view[3])
inside_all = EINA_TRUE;
if (!sd->enabled || !inside_all)
if (!sd->enabled)
evas_object_move(sd->content, x, y);
else
{
Evas *e = evas_object_evas_get(obj);
/* This causes many side effects in calculating mapbuf objects.
But it doesn't affect to the mapbuf it's own special feature, performance. */
// evas_smart_objects_calculate(e);
@ -240,17 +218,6 @@ _elm_mapbuf_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
_configure(obj, EINA_FALSE);
}
static void
_elm_mapbuf_inside_view_reset(Evas_Object *obj)
{
ELM_MAPBUF_DATA_GET(obj, sd);
sd->inside_view[0] = EINA_FALSE;
sd->inside_view[1] = EINA_FALSE;
sd->inside_view[2] = EINA_FALSE;
sd->inside_view[3] = EINA_FALSE;
}
static void
_elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
@ -286,7 +253,6 @@ _elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list)
else
evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
_elm_mapbuf_inside_view_reset(obj);
_sizing_eval(obj);
_configure(obj, EINA_TRUE);
@ -394,8 +360,6 @@ _internal_enable_set(Eo *obj, Elm_Mapbuf_Smart_Data *sd, Eina_Bool enabled)
if (sd->enabled == enabled) return;
sd->enabled = enabled;
_elm_mapbuf_inside_view_reset(obj);
if (sd->content) evas_object_static_clip_set(sd->content, sd->enabled);
_configure(obj, EINA_TRUE);
}

View File

@ -25,7 +25,6 @@ struct _Elm_Mapbuf_Smart_Data
Ecore_Idler *idler;
Eina_Bool inside_view[4];
Eina_Bool enabled : 1;
Eina_Bool smooth_saved : 1;
Eina_Bool smooth : 1;