From 0353eb5b7f86684690b306922013fda987aaa700 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 25 Jul 2017 14:42:54 +0900 Subject: [PATCH] evas: Add debug_name to image objects --- src/lib/evas/canvas/efl_canvas_image_internal.eo | 1 + src/lib/evas/canvas/evas_image_private.h | 4 ++-- src/lib/evas/canvas/evas_object_image.c | 26 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo index 2f65a48..f21053a 100644 --- a/src/lib/evas/canvas/efl_canvas_image_internal.eo +++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo @@ -10,6 +10,7 @@ abstract Efl.Canvas.Image.Internal (Efl.Canvas.Object, Efl.Canvas.Filter.Interna Efl.Object.constructor; Efl.Object.destructor; Efl.Object.finalize; + Efl.Object.debug_name_override; Efl.File.save; Efl.Orientation.orientation { get; set; } Efl.Flipable.flip { get; set; } diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h index 91c7e22..4c35d5c 100644 --- a/src/lib/evas/canvas/evas_image_private.h +++ b/src/lib/evas/canvas/evas_image_private.h @@ -84,8 +84,8 @@ struct _Evas_Object_Image_State Evas_Canvas3D_Scene *scene; union { - const char *file; - Eina_File *f; + const char *file; // used if !mmaped_source + Eina_File *f; // used if mmaped_source } u; const char *key; int frame; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 269898c..8021775 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3664,6 +3664,32 @@ _evas_object_image_surface_get(Evas_Object_Protected_Data *obj, Eina_Bool create return pd->engine_data; } +EOLIAN static Eina_Strbuf * +_efl_canvas_image_internal_efl_object_debug_name_override(Eo *eo_obj, Evas_Image_Data *o, Eina_Strbuf *sb) +{ + sb = efl_debug_name_override(efl_super(eo_obj, MY_CLASS), sb); + if (o->cur->u.f) + { + const char *fname = o->cur->mmaped_source ? + eina_file_filename_get(o->cur->u.f) : o->cur->u.file; + eina_strbuf_append_printf(sb, ":file='%s',key='%s'", fname, o->cur->key); + } + else if (o->pixels && o->pixels->func.get_pixels) + { + eina_strbuf_append_printf(sb, ":get_pixels=%p:dirty=%d", + o->pixels->func.get_pixels, o->dirty_pixels); + } + else if (o->cur->source) + { + eina_strbuf_append_printf(sb, ":proxy_source=%p", o->cur->source); + } + else + { + eina_strbuf_append_printf(sb, ":unknown_image"); + } + return sb; +} + #define EFL_CANVAS_IMAGE_INTERNAL_EXTRA_OPS \ EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_image_internal_efl_object_dbg_info_get) -- 2.7.4