evas/render: Add a flag for dropping the map cache if needed.

The map cache must be dropped if the content of the surface is rendered again.
The example evas-smart-object.c has a valid test case for this bug.



SVN revision: 75636
This commit is contained in:
Rafael Antognolli 2012-08-23 19:58:02 +00:00
parent cc2ec4105b
commit be7953b243
3 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,9 @@ evas_object_change_reset(Evas_Object *obj)
void
evas_object_cur_prev(Evas_Object *obj)
{
if (!obj->prev.valid_map && (obj->prev.map == obj->cur.map))
obj->prev.map = NULL;
if (obj->cur.map != obj->prev.map)
{
if (obj->cache_map) evas_map_free(obj->cache_map);

View File

@ -917,6 +917,11 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
evas_object_change_reset(obj);
}
/* mark the old map as invalid, so later we don't reuse it as a
* cache. */
if (changed && obj->prev.map)
obj->prev.valid_map = EINA_FALSE;
// clear surface before re-render
if ((changed) && (obj->cur.map->surface))
{
@ -988,6 +993,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
obj->cur.map->surface = e->engine.func->image_dirty_region
(e->engine.data.output, obj->cur.map->surface,
0, 0, obj->cur.map->surface_w, obj->cur.map->surface_h);
obj->cur.valid_map = EINA_TRUE;
}
e->engine.func->context_clip_unset(e->engine.data.output,
context);

View File

@ -533,6 +533,7 @@ struct _Evas_Object
unsigned char r, g, b, a;
} color;
Eina_Bool usemap : 1;
Eina_Bool valid_map : 1;
Eina_Bool visible : 1;
Eina_Bool have_clipees : 1;
Eina_Bool anti_alias : 1;