cedric pushed a commit to branch master.
commit ddfd471c717c3d85e6227b049a1c47dfc0979562
Author: Paulo Cavalcanti <[email protected]>
Date: Thu Feb 28 18:36:32 2013 -0300
efl/evas/text: Fix rendering issue with changed texts of same size
Introduce a new function called evas_object_content_change(). It should
be used when object contents get changed.
The rendering issue involving text objects was due to its map surfaces
not being freed. Thus, evas_object_content_change() is now called in
evas_object_text_text_set() during the relayout of the text for making
sure to get their map surfaces freed before rendering them.
Signed-off-by: Paulo Cavalcanti <[email protected]>
---
src/lib/evas/canvas/evas_object_main.c | 20 ++++++++++++++++++++
src/lib/evas/canvas/evas_object_text.c | 2 ++
src/lib/evas/include/evas_private.h | 1 +
3 files changed, 23 insertions(+)
diff --git a/src/lib/evas/canvas/evas_object_main.c
b/src/lib/evas/canvas/evas_object_main.c
index aadcb41..72afc8e 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -229,6 +229,26 @@ evas_object_change(Evas_Object *eo_obj,
Evas_Object_Protected_Data *obj)
}
void
+evas_object_content_change(Evas_Object *eo_obj, Evas_Object_Protected_Data
*obj)
+{
+ MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
+ return;
+ MAGIC_CHECK_END();
+
+ if ((obj->map) && (obj->map->surface))
+ {
+ EINA_COW_WRITE_BEGIN(evas_object_map_cow,
+ obj->map, Evas_Object_Map_Data, map_write)
+ {
+ obj->layer->evas->engine.func->image_map_surface_free
+ (obj->layer->evas->engine.data.output, map_write->surface);
+ map_write->surface = NULL;
+ }
+ EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
+ }
+}
+
+void
evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *eo_obj,
int is_v, int was_v)
{
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, MY_CLASS);
diff --git a/src/lib/evas/canvas/evas_object_text.c
b/src/lib/evas/canvas/evas_object_text.c
index 45f82d3..3b27712 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -699,6 +699,8 @@ _evas_object_text_layout(Evas_Object *eo_obj,
Evas_Object_Text *o, Eina_Unicode
o->last_computed.h == obj->cur.geometry.h)
return ;
+ evas_object_content_change(eo_obj, obj);
+
if (o->items) _evas_object_text_items_clean(obj, o);
if (text && *text)
diff --git a/src/lib/evas/include/evas_private.h
b/src/lib/evas/include/evas_private.h
index 995f00e..d8f1e70 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -942,6 +942,7 @@ void evas_object_update_bounding_box(Evas_Object *obj,
Evas_Object_Protected_Dat
void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas
*e);
void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int
clean_layer);
void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
+void evas_object_content_change(Evas_Object *obj, Evas_Object_Protected_Data
*pd);
void evas_object_clip_changes_clean(Evas_Object *obj);
void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object
*obj, int is_v, int was_v);
void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object
*obj);
--
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb