e_map: add e_map_new_with_direct_render 01/281001/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 7 Sep 2022 11:06:14 +0000 (20:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 7 Sep 2022 11:19:16 +0000 (20:19 +0900)
Change-Id: I1ba642f4008ad5d9efc71c622824004ed6f6d38d

src/bin/e_map.c
src/bin/e_map.h

index 8a195671df223dd358cb7741f979937bbc87b9f4..dd0f965ed1b226c039b96458f51ad3f67f364f26 100644 (file)
@@ -70,6 +70,30 @@ e_map_new(void)
    return em;
 }
 
+E_API E_Map *
+e_map_new_with_direct_render(Eina_Bool direct_render)
+{
+   E_Map *em = E_NEW(E_Map, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(em, NULL);
+
+   em->map = evas_map_new(4);
+   if (!em->map)
+     {
+        ELOGF("MAP", "evas_map_new failed.", NULL);
+        free(em);
+        return NULL;
+     }
+
+   em->count = 4;
+   em->internal = EINA_FALSE;
+
+   /* for optimize memory usage */
+   if (direct_render)
+      evas_map_direct_render_set(em->map, EINA_TRUE);
+
+   return em;
+}
+
 E_API E_Map *
 e_map_dup(E_Map *em)
 {
index a385cafa7e89cae7b7a8e846199b0fb69a66dc17..6e330c69ae4de4ddcbf3f175d2586c9e6b61f869 100644 (file)
@@ -7,6 +7,7 @@ typedef struct _E_Map E_Map;
 /* current Evas_Map is support only four points.
  * So, we're provide e_map_new without count parameter. */
 E_API E_Map           *e_map_new(void);
+E_API E_Map           *e_map_new_with_direct_render(Eina_Bool direct_render);
 E_API E_Map           *e_map_dup(E_Map *em);
 E_API Eina_Bool        e_map_free(E_Map *em);
 E_API Eina_Bool        e_map_point_coord_get(E_Map *em, int idx, int *x, int *y, int *z);