summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-09 16:21:08 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-15 11:11:59 +0900
commit0c95b694742c712ec4c66e566f216f1b6c1b7079 (patch)
tree4826c248cf1f4490c1d5f78bfb9741838efd3510 /src/lib/evas/canvas/evas_object_image.c
parent20b4d9dd6adb88f9dd0cd51fa849f0c360432279 (diff)
Evas.Image: Move native surfaces to Efl.Canvas.Surface
X11, TBM and Wayland support are implemented for now.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 42056bffb6..f9e6bc49a4 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1607,12 +1607,10 @@ _on_image_native_surface_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_O
1607 evas_object_image_native_surface_set(obj, NULL); 1607 evas_object_image_native_surface_set(obj, NULL);
1608} 1608}
1609 1609
1610EAPI void 1610Eina_Bool
1611evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *surf) 1611_evas_image_native_surface_set(Eo *eo_obj, Evas_Native_Surface *surf)
1612{ 1612{
1613 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); 1613 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
1614 return;
1615 MAGIC_CHECK_END();
1616 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1614 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1617 evas_object_async_block(obj); 1615 evas_object_async_block(obj);
1618 evas_object_event_callback_del_full 1616 evas_object_event_callback_del_full
@@ -1620,29 +1618,30 @@ evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *s
1620 if (surf) // We need to unset native surf on del to remove shared hash refs 1618 if (surf) // We need to unset native surf on del to remove shared hash refs
1621 evas_object_event_callback_add 1619 evas_object_event_callback_add
1622 (eo_obj, EVAS_CALLBACK_DEL, _on_image_native_surface_del, NULL); 1620 (eo_obj, EVAS_CALLBACK_DEL, _on_image_native_surface_del, NULL);
1623 evas_obj_image_native_surface_set(eo_obj, surf);
1624}
1625 1621
1626EOLIAN static void
1627_evas_image_native_surface_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Native_Surface *surf)
1628{
1629 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1630 evas_object_async_block(obj);
1631 evas_render_rendering_wait(obj->layer->evas); 1622 evas_render_rendering_wait(obj->layer->evas);
1632
1633 _evas_image_cleanup(eo_obj, obj, o); 1623 _evas_image_cleanup(eo_obj, obj, o);
1634 if (!ENFN->image_native_set) return; 1624 if (!ENFN->image_native_set) return EINA_FALSE;
1635 if ((surf) && 1625 if ((surf) &&
1636 ((surf->version < 2) || 1626 ((surf->version < 2) ||
1637 (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return; 1627 (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return EINA_FALSE;
1638 o->engine_data = ENFN->image_native_set(ENDT, o->engine_data, surf); 1628 o->engine_data = ENFN->image_native_set(ENDT, o->engine_data, surf);
1629 return (o->engine_data != NULL);
1639} 1630}
1640 1631
1641EOLIAN static Evas_Native_Surface* 1632EAPI void
1642_evas_image_native_surface_get(Eo *eo_obj, Evas_Image_Data *o) 1633evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *surf)
1634{
1635 EVAS_OBJECT_LEGACY_API(eo_obj);
1636 _evas_image_native_surface_set(eo_obj, surf);
1637}
1638
1639Evas_Native_Surface *
1640_evas_image_native_surface_get(const Evas_Object *eo_obj)
1643{ 1641{
1644 Evas_Native_Surface *surf = NULL;
1645 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1642 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1643 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
1644 Evas_Native_Surface *surf = NULL;
1646 1645
1647 if (ENFN->image_native_get) 1646 if (ENFN->image_native_get)
1648 surf = ENFN->image_native_get(ENDT, o->engine_data); 1647 surf = ENFN->image_native_get(ENDT, o->engine_data);
@@ -1650,6 +1649,13 @@ _evas_image_native_surface_get(Eo *eo_obj, Evas_Image_Data *o)
1650 return surf; 1649 return surf;
1651} 1650}
1652 1651
1652EAPI Evas_Native_Surface *
1653evas_object_image_native_surface_get(const Evas_Object *eo_obj)
1654{
1655 EVAS_OBJECT_LEGACY_API(eo_obj, NULL);
1656 return _evas_image_native_surface_get(eo_obj);
1657}
1658
1653EOLIAN static void 1659EOLIAN static void
1654_evas_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Scale_Hint hint) 1660_evas_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Scale_Hint hint)
1655{ 1661{