forked from enlightenment/efl
api for image content hint - nothing uses it yet, but... it will. and does
nothing right now... but that will be able to change. it opens up better optimisation paths in future. SVN revision: 46922
This commit is contained in:
parent
73a9612f2c
commit
10da9b00a3
|
@ -532,6 +532,13 @@ typedef enum _Evas_Image_Scale_Hint
|
|||
EVAS_IMAGE_SCALE_HINT_STATIC = 2
|
||||
} Evas_Image_Scale_Hint;
|
||||
|
||||
typedef enum _Evas_Image_Content_Hint
|
||||
{
|
||||
EVAS_IMAGE_CONTENT_HINT_NONE = 0,
|
||||
EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1,
|
||||
EVAS_IMAGE_CONTENT_HINT_STATIC = 2
|
||||
} Evas_Image_Content_Hint;
|
||||
|
||||
struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
|
||||
{
|
||||
int magic; /**< Magic number */
|
||||
|
@ -895,6 +902,8 @@ extern "C" {
|
|||
EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
|
||||
EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
|
||||
EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
|
||||
/* image cache */
|
||||
EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -57,7 +57,8 @@ struct _Evas_Object_Image
|
|||
void *get_pixels_data;
|
||||
} func;
|
||||
|
||||
Evas_Image_Scale_Hint scale_hint;
|
||||
Evas_Image_Scale_Hint scale_hint;
|
||||
Evas_Image_Content_Hint content_hint;
|
||||
|
||||
void *engine_data;
|
||||
|
||||
|
@ -2022,6 +2023,53 @@ evas_object_image_scale_hint_get(const Evas_Object *obj)
|
|||
return o->scale_hint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the content hint of a given image of the canvas.
|
||||
*
|
||||
* @param obj The given canvas pointer.
|
||||
* @param hint The content hint value.
|
||||
*
|
||||
* This function sets the content hint value of the given image of the canvas.
|
||||
*
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
|
||||
{
|
||||
Evas_Object_Image *o;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Image *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o->content_hint = hint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the content hint of a given image of the canvas.
|
||||
*
|
||||
* @param obj The given canvas pointer.
|
||||
*
|
||||
* This function returns the content hint value of the given image of the canvas.
|
||||
*
|
||||
*/
|
||||
EAPI Evas_Image_Content_Hint
|
||||
evas_object_image_content_hint_get(const Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Image *o;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return EVAS_IMAGE_CONTENT_HINT_NONE;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Image *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
|
||||
return EVAS_IMAGE_CONTENT_HINT_NONE;
|
||||
MAGIC_CHECK_END();
|
||||
return o->content_hint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush the image cache of the canvas.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue