Evas.Image: Remove pixels_dirty and pixels_callback

Those APIs belong to legacy, not Eo. Also, the image object
shouldn't be used directly for GL rendering, instead the GLview
widget should be used.
This commit is contained in:
Jean-Philippe Andre 2016-03-29 14:52:32 +09:00
parent 3c40ebb998
commit a5b89d8ab3
4 changed files with 68 additions and 67 deletions

View File

@ -3700,6 +3700,38 @@ EAPI void evas_object_image_source_visible_set(Evas_Object *obj, Eina_Bool visib
*/
EAPI Eina_Bool evas_object_image_source_visible_get(const Evas_Object *obj);
/**
* @brief Mark whether the given image object is dirty and needs to request its
* pixels.
*
* This function will only properly work if a pixels get callback has been set.
*
* @warning Use this function if you really know what you are doing.
*
* @param[in] dirty Whether the image is dirty.
*/
EAPI void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty);
/**
* @brief Retrieves whether the given image object is dirty (needs to be
* redrawn).
*
* @return Whether the image is dirty.
*/
EAPI Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj);
/**
* @brief Set the callback function to get pixels from a canvas' image.
*
* This functions sets a function to be the callback function that get pixels
* from a image of the canvas.
*
* @param[in] func The callback function.
* @param[in] data The data pointer to be passed to @c func.
*/
EAPI void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) EINA_ARG_NONNULL(2);
/**
* @typedef Evas_Video_Surface
*

View File

@ -6,43 +6,6 @@ class Evas.Image (Evas.Object, Evas.Filter,
/* Legacy is implement inside Efl.Canvas.Image */
legacy_prefix: evas_object_image;
eo_prefix: null;
methods {
/* GL View */
@property pixels_dirty {
set {
[[Mark whether the given image object is dirty and needs to
request its pixels.
This function will only properly work if a pixels get
callback has been set.
Warning: Use this function if you really know what you are
doing.
]]
}
get {
[[Retrieves whether the given image object is dirty (needs to
be redrawn).
]]
}
values {
dirty: bool; [[Whether the image is dirty.]]
}
}
@property pixels_get_callback {
set {
[[Set the callback function to get pixels from a canvas' image.
This functions sets a function to be the callback function
that get pixels from a image of the canvas.
]]
}
values {
func: Evas_Object_Image_Pixels_Get_Cb @nonull; [[The callback function.]]
data: void *; [[The data pointer to be passed to $func.]]
}
}
}
implements {
Eo.Base.constructor;
Eo.Base.destructor;

View File

@ -471,6 +471,42 @@ evas_object_image_native_surface_get(const Evas_Object *eo_obj)
return _evas_image_native_surface_get(eo_obj);
}
EAPI void
evas_object_image_pixels_get_callback_set(Eo *eo_obj, Evas_Object_Image_Pixels_Get_Cb func, void *data)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
evas_object_async_block(obj);
EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write)
{
pixi_write->func.get_pixels = func;
pixi_write->func.get_pixels_data = data;
}
EINA_COW_PIXEL_WRITE_END(o, pixi_write);
}
EAPI void
evas_object_image_pixels_dirty_set(Eo *eo_obj, Eina_Bool dirty)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
evas_object_async_block(obj);
if (dirty) o->dirty_pixels = EINA_TRUE;
else o->dirty_pixels = EINA_FALSE;
o->changed = EINA_TRUE;
evas_object_change(eo_obj, obj);
}
EAPI Eina_Bool
evas_object_image_pixels_dirty_get(const Eo *eo_obj)
{
Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
return (o->dirty_pixels ? 1 : 0);
}
EAPI void
evas_object_image_data_set(Eo *eo_obj, void *data)
{

View File

@ -931,36 +931,6 @@ _evas_image_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file
return ok;
}
EOLIAN static void
_evas_image_pixels_get_callback_set(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, Evas_Object_Image_Pixels_Get_Cb func, void *data)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
evas_object_async_block(obj);
EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write)
{
pixi_write->func.get_pixels = func;
pixi_write->func.get_pixels_data = data;
}
EINA_COW_PIXEL_WRITE_END(o, pixi_write);
}
EOLIAN static void
_evas_image_pixels_dirty_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool dirty)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
evas_object_async_block(obj);
if (dirty) o->dirty_pixels = EINA_TRUE;
else o->dirty_pixels = EINA_FALSE;
o->changed = EINA_TRUE;
evas_object_change(eo_obj, obj);
}
EOLIAN static Eina_Bool
_evas_image_pixels_dirty_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return (o->dirty_pixels ? 1 : 0);
}
EOLIAN static Efl_Gfx_Colorspace
_evas_image_efl_gfx_buffer_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{