summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-12-05 16:35:23 -0800
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-11 10:36:08 +0100
commit119cb085fadb55adf71bd20f2ca30056bc99991f (patch)
tree7a30b1a135c60dcfd91914bd58682128227492ee
parent574d1192bb41c744c92fe0fd69380b2080dbb038 (diff)
evas: reduce useless allocation during destruction of image.
Evas image use a GC to reduce duplicated state accross multiple object. Still during shutdown we do clean it up and free it. There is no point to push that down the GC if we are to just free it after. Relying on the fact that dynamic content will avoid triggering the GC altogether as their content change to frequently and is expected to be uniq among other objects, we can avoid unecessary allocation during the destruction by just switching that early on during the destructor. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10815
-rw-r--r--src/lib/evas/canvas/evas_object_image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 4653aff..192c428 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1677,10 +1677,13 @@ evas_object_image_init(Evas_Object *eo_obj)
1677} 1677}
1678 1678
1679EOLIAN static void 1679EOLIAN static void
1680_efl_canvas_image_internal_efl_object_destructor(Eo *eo_obj, Evas_Image_Data *o EINA_UNUSED) 1680_efl_canvas_image_internal_efl_object_destructor(Eo *eo_obj, Evas_Image_Data *o)
1681{ 1681{
1682 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 1682 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
1683 1683
1684 // To avoid unecessary GC storage triggered during shutdown, we mark the content as dynamic
1685 o->content_hint = EFL_GFX_IMAGE_CONTENT_HINT_DYNAMIC;
1686
1684 if (obj->legacy.ctor) 1687 if (obj->legacy.ctor)
1685 evas_object_image_video_surface_set(eo_obj, NULL); 1688 evas_object_image_video_surface_set(eo_obj, NULL);
1686 efl_gfx_image_stretch_region_set(eo_obj, NULL, NULL); 1689 efl_gfx_image_stretch_region_set(eo_obj, NULL, NULL);