evas: Use efl_gfx APIs where appropriate

This is a better fix than the previous patch, as it keeps
the legacy API check. The point of that check is: if the object
has been created with legacy API (evas_object_image_[filled_]add,
then legacy APIs are allowed, otherwise they are disallowed. This
means only EO APIs should be used on an eo_add() image object.
This commit is contained in:
Jean-Philippe Andre 2016-06-20 14:11:32 +09:00
parent 17a51cffd3
commit ccaf12e1b6
2 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@
#include "evas_image.eo.h"
#define EVAS_IMAGE_API(_o, ...) do { \
if (EINA_UNLIKELY(!eo_isa(_o, EFL_CANVAS_IMAGE_INTERNAL_CLASS))) { \
if (EINA_UNLIKELY(!eo_isa(_o, EVAS_IMAGE_CLASS))) { \
EINA_SAFETY_ERROR("object is not an image!"); \
return __VA_ARGS__; \
} } while (0)

View File

@ -564,8 +564,8 @@ _efl_canvas_image_internal_efl_gfx_fill_fill_auto_set(Eo *eo_obj, Evas_Image_Dat
{
Evas_Coord w, h;
evas_object_geometry_get(eo_obj, NULL, NULL, &w, &h);
evas_object_image_fill_set(eo_obj, 0, 0, w, h);
efl_gfx_geometry_get(eo_obj, NULL, NULL, &w, &h);
efl_gfx_fill_set(eo_obj, 0, 0, w, h);
evas_object_event_callback_add(eo_obj, EVAS_CALLBACK_RESIZE,
evas_object_image_filled_resize_listener,
@ -777,7 +777,7 @@ _efl_canvas_image_internal_efl_gfx_buffer_alpha_set(Eo *eo_obj, Evas_Image_Data
}
o->written = EINA_TRUE;
}
evas_object_image_data_update_add(eo_obj, 0, 0, o->cur->image.w, o->cur->image.h);
efl_gfx_buffer_update_add(eo_obj, 0, 0, o->cur->image.w, o->cur->image.h);
EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(o);
}
@ -3152,10 +3152,10 @@ evas_object_image_filled_resize_listener(void *data EINA_UNUSED, Evas *e EINA_UN
{
Evas_Coord w, h;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
efl_gfx_geometry_get(obj, NULL, NULL, &w, &h);
if (w < 1) w = 1;
if (h < 1) h = 1;
evas_object_image_fill_set(obj, 0, 0, w, h);
efl_gfx_fill_set(obj, 0, 0, w, h);
}
Eina_Bool