aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-07-25 14:42:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-04 10:24:03 +0900
commit0353eb5b7f86684690b306922013fda987aaa700 (patch)
tree23fa982e8790d1f125546e789447400d28c3a03c
parenteina_slstr: Fix leak in an error case (diff)
downloadefl-0353eb5b7f86684690b306922013fda987aaa700.tar.gz
evas: Add debug_name to image objects
-rw-r--r--src/lib/evas/canvas/efl_canvas_image_internal.eo1
-rw-r--r--src/lib/evas/canvas/evas_image_private.h4
-rw-r--r--src/lib/evas/canvas/evas_object_image.c26
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 2f65a48a63..f21053a371 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 91c7e22af1..4c35d5ca62 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 269898c6b2..802177501d 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)