summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsubhransu mohanty <sub.mohanty@samsung.com>2017-10-27 13:42:01 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-10 11:20:38 +0900
commitbefb7701a71e45e9c76fb3873f3056b74d62527c (patch)
tree4ced404473847bb60ba69aade8ee5c9087dbb925 /src
parentaacf277c3affcc68806020c1f9e7a44829e1bb74 (diff)
evas/engine: added new engine api for ector
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_common_generic_cache.c6
-rw-r--r--src/lib/evas/include/evas_private.h6
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c65
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c53
4 files changed, 126 insertions, 4 deletions
diff --git a/src/lib/evas/common/evas_common_generic_cache.c b/src/lib/evas/common/evas_common_generic_cache.c
index 55fd6e06b2..55bcf725d6 100644
--- a/src/lib/evas/common/evas_common_generic_cache.c
+++ b/src/lib/evas/common/evas_common_generic_cache.c
@@ -34,7 +34,7 @@ generic_cache_dump(Generic_Cache *cache)
34} 34}
35 35
36EAPI void 36EAPI void
37generic_cache_set(Generic_Cache *cache, void *key, void *surface) 37generic_cache_data_set(Generic_Cache *cache, void *key, void *surface)
38{ 38{
39 Generic_Cache_Entry *entry = NULL; 39 Generic_Cache_Entry *entry = NULL;
40 int count; 40 int count;
@@ -59,7 +59,7 @@ generic_cache_set(Generic_Cache *cache, void *key, void *surface)
59} 59}
60 60
61EAPI void * 61EAPI void *
62generic_cache_get(Generic_Cache *cache, void *key) 62generic_cache_data_get(Generic_Cache *cache, void *key)
63{ 63{
64 Generic_Cache_Entry *entry = NULL, *lru_data; 64 Generic_Cache_Entry *entry = NULL, *lru_data;
65 Eina_List *l; 65 Eina_List *l;
@@ -84,7 +84,7 @@ generic_cache_get(Generic_Cache *cache, void *key)
84} 84}
85 85
86EAPI void 86EAPI void
87generic_cache_drop(Generic_Cache *cache, void *key) 87generic_cache_data_drop(Generic_Cache *cache, void *key)
88{ 88{
89 Generic_Cache_Entry *entry = NULL; 89 Generic_Cache_Entry *entry = NULL;
90 90
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 7ec4095692..2fac91e094 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1513,6 +1513,12 @@ struct _Evas_Func
1513 void* (*ector_new) (void *engine, void *context, Ector_Surface *ector, void *surface); 1513 void* (*ector_new) (void *engine, void *context, Ector_Surface *ector, void *surface);
1514 void (*ector_free) (void *engine_data); 1514 void (*ector_free) (void *engine_data);
1515 1515
1516 void *(*ector_surface_create) (void *engine, int w, int h, int *error);
1517 void (*ector_surface_destroy) (void *engine, void *surface);
1518 void (*ector_surface_cache_set) (void *engine, void *key, void *surface);
1519 void *(*ector_surface_cache_get) (void *engine, void *key);
1520 void (*ector_surface_cache_drop) (void *engine, void *key);
1521
1516 Evas_Filter_Support (*gfx_filter_supports) (void *engine, Evas_Filter_Command *cmd); 1522 Evas_Filter_Support (*gfx_filter_supports) (void *engine, Evas_Filter_Command *cmd);
1517 Eina_Bool (*gfx_filter_process) (void *engine, Evas_Filter_Command *cmd); 1523 Eina_Bool (*gfx_filter_process) (void *engine, Evas_Filter_Command *cmd);
1518 1524
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 62f1a38290..6e6d6a9082 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2623,6 +2623,65 @@ eng_ector_renderer_draw(void *engine EINA_UNUSED, void *data, void *context, voi
2623 eina_array_free(c); 2623 eina_array_free(c);
2624} 2624}
2625 2625
2626// Ector functions start
2627static void*
2628eng_ector_surface_create(void *engine, int width, int height, int *error)
2629{
2630 void *surface;
2631
2632 *error = EINA_FALSE;
2633
2634 if (use_gl)
2635 {
2636 surface = evas_gl_common_image_surface_new(gl_generic_context_get(engine, EINA_TRUE),
2637 width, height, EINA_TRUE, EINA_FALSE);
2638 if (!surface) *error = EINA_TRUE;
2639 }
2640 else
2641 {
2642 surface = eng_image_new_from_copied_data(engine, width, height, NULL, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
2643 if (!surface)
2644 *error = EINA_TRUE;
2645 else //Use this hint for ZERO COPY texture upload.
2646 eng_image_content_hint_set(engine, surface, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
2647 }
2648
2649 return surface;
2650}
2651
2652static void
2653eng_ector_surface_destroy(void *engine, void *surface)
2654{
2655 if (!surface) return;
2656 eng_image_free(engine, surface);
2657}
2658
2659static void
2660eng_ector_surface_cache_set(void *engine, void *key , void *surface)
2661{
2662 Render_Engine_GL_Generic *e = engine;
2663
2664 generic_cache_data_set(e->software.surface_cache, key, surface);
2665
2666}
2667
2668static void *
2669eng_ector_surface_cache_get(void *engine, void *key)
2670{
2671 Render_Engine_GL_Generic *e = engine;
2672
2673 return generic_cache_data_get(e->software.surface_cache, key);
2674}
2675
2676static void
2677eng_ector_surface_cache_drop(void *engine, void *key)
2678{
2679 Render_Engine_GL_Generic *e = engine;
2680
2681 generic_cache_data_drop(e->software.surface_cache, key);
2682}
2683
2684
2626typedef struct _Evas_GL_Ector Evas_GL_Ector; 2685typedef struct _Evas_GL_Ector Evas_GL_Ector;
2627struct _Evas_GL_Ector 2686struct _Evas_GL_Ector
2628{ 2687{
@@ -3305,7 +3364,11 @@ module_open(Evas_Module *em)
3305 ORD(ector_end); 3364 ORD(ector_end);
3306 ORD(ector_new); 3365 ORD(ector_new);
3307 ORD(ector_free); 3366 ORD(ector_free);
3308 3367 ORD(ector_surface_create);
3368 ORD(ector_surface_destroy);
3369 ORD(ector_surface_cache_set);
3370 ORD(ector_surface_cache_get);
3371 ORD(ector_surface_cache_drop);
3309 ORD(gfx_filter_supports); 3372 ORD(gfx_filter_supports);
3310 ORD(gfx_filter_process); 3373 ORD(gfx_filter_process);
3311 3374
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 8dfafc2d7d..1d7c97c7d4 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4294,6 +4294,8 @@ eng_output_idle_flush(void *engine EINA_UNUSED, void *data)
4294 if (re->outbuf_idle_flush) re->outbuf_idle_flush(re->ob); 4294 if (re->outbuf_idle_flush) re->outbuf_idle_flush(re->ob);
4295} 4295}
4296 4296
4297// Ector functions
4298
4297static Eina_Bool use_cairo; 4299static Eina_Bool use_cairo;
4298 4300
4299static Ector_Surface * 4301static Ector_Surface *
@@ -4318,6 +4320,52 @@ eng_ector_create(void *engine EINA_UNUSED)
4318 return ector; 4320 return ector;
4319} 4321}
4320 4322
4323static void*
4324eng_ector_surface_create(void *engine, int width, int height, int *error)
4325{
4326 void *surface;
4327
4328 *error = EINA_FALSE;
4329
4330 surface = eng_image_new_from_copied_data(engine, width, height, NULL, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
4331 if (!surface) *error = EINA_TRUE;
4332
4333 return surface;
4334}
4335
4336static void
4337eng_ector_surface_destroy(void *engine, void *surface)
4338{
4339 if (!surface) return;
4340 eng_image_free(engine, surface);
4341}
4342
4343static void
4344eng_ector_surface_cache_set(void *engine, void *key , void *surface)
4345{
4346 Render_Engine_Software_Generic *e = engine;
4347
4348 generic_cache_data_set(e->surface_cache, key, surface);
4349
4350}
4351
4352static void *
4353eng_ector_surface_cache_get(void *engine, void *key)
4354{
4355 Render_Engine_Software_Generic *e = engine;
4356
4357 return generic_cache_data_get(e->surface_cache, key);
4358}
4359
4360static void
4361eng_ector_surface_cache_drop(void *engine, void *key)
4362{
4363 Render_Engine_Software_Generic *e = engine;
4364
4365 generic_cache_data_drop(e->surface_cache, key);
4366}
4367
4368
4321static void 4369static void
4322eng_ector_output_set(void *engine EINA_UNUSED, 4370eng_ector_output_set(void *engine EINA_UNUSED,
4323 Ector_Surface *surface EINA_UNUSED, 4371 Ector_Surface *surface EINA_UNUSED,
@@ -4846,6 +4894,11 @@ static Evas_Func func =
4846 eng_ector_end, 4894 eng_ector_end,
4847 eng_ector_new, 4895 eng_ector_new,
4848 eng_ector_free, 4896 eng_ector_free,
4897 eng_ector_surface_create,
4898 eng_ector_surface_destroy,
4899 eng_ector_surface_cache_set,
4900 eng_ector_surface_cache_get,
4901 eng_ector_surface_cache_drop,
4849 eng_gfx_filter_supports, 4902 eng_gfx_filter_supports,
4850 eng_gfx_filter_process, 4903 eng_gfx_filter_process,
4851 /* FUTURE software generic calls go here */ 4904 /* FUTURE software generic calls go here */