Evas.Image: Add ERR in long-deprecated functions
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 22 Mar 2016 05:45:10 +0000 (14:45 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 28 Mar 2016 07:40:01 +0000 (16:40 +0900)
- evas_object_image_data_convert()
- evas_object_image_pixels_import()

src/lib/evas/canvas/evas_image_legacy.c

index 1850057..6103cc6 100644 (file)
@@ -918,9 +918,17 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
 
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
    Evas_Image_Data *o;
+   void *engine_data;
    DATA32 *data;
    void* result = NULL;
 
+   static int warned = 0;
+   if (!warned)
+     {
+        ERR("%s is deprecated and shouldn't be called", __FUNCTION__);
+        warned = 1;
+     }
+
    evas_object_async_block(obj);
    o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
    if ((o->preloading) && (o->engine_data))
@@ -933,12 +941,10 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
      o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video);
    if (o->cur->cspace == to_cspace) return NULL;
    data = NULL;
-   o->engine_data = ENFN->image_data_get(ENDT, o->engine_data, 0, &data, &o->load_error, NULL);
+   engine_data = ENFN->image_data_get(ENDT, o->engine_data, 0, &data, &o->load_error, NULL);
    result = _evas_image_data_convert_internal(o, data, to_cspace);
-   if (o->engine_data)
-     {
-        o->engine_data = ENFN->image_data_put(ENDT, o->engine_data, data);
-     }
+   if (engine_data)
+     o->engine_data = ENFN->image_data_put(ENDT, engine_data, data);
 
    return result;
 }
@@ -988,6 +994,13 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p
    Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
    Evas_Image_Data *o;
 
+   static int warned = 0;
+   if (!warned)
+     {
+        ERR("%s is deprecated and shouldn't be called", __FUNCTION__);
+        warned = 1;
+     }
+
    evas_object_async_block(obj);
    o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
    _evas_image_cleanup(eo_obj, obj, o);