summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:50:35 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:50:35 -0700
commit3a8d98a54f969ae7dbbc2450b49160a1bf023811 (patch)
tree8570d8aaa51481e5e1fdb195929d71f0998edab9 /src/modules
parent46e2e103d7fcc08dbe5b12990c36234ebf13d3c1 (diff)
evas: introduce a engine_new/free in gl_generic backend.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h6
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c25
2 files changed, 31 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
index 7fdcea5..f222469 100644
--- a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
+++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
@@ -8,6 +8,7 @@
8#include "../gl_common/evas_gl_core.h" 8#include "../gl_common/evas_gl_core.h"
9#include "../gl_common/evas_gl_core_private.h" 9#include "../gl_common/evas_gl_core_private.h"
10 10
11typedef struct _Render_Engine_GL_Generic Render_Engine_GL_Generic;
11typedef struct _Render_Output_GL_Generic Render_Output_GL_Generic; 12typedef struct _Render_Output_GL_Generic Render_Output_GL_Generic;
12typedef struct _Context_3D Context_3D; 13typedef struct _Context_3D Context_3D;
13 14
@@ -17,6 +18,11 @@ typedef void *(*Window_EGL_Display_Get)(Outbuf *ob);
17typedef Context_3D *(*Window_GL_Context_New)(Outbuf *ob); 18typedef Context_3D *(*Window_GL_Context_New)(Outbuf *ob);
18typedef void (*Window_GL_Context_Use)(Context_3D *ctx); 19typedef void (*Window_GL_Context_Use)(Context_3D *ctx);
19 20
21struct _Render_Engine_GL_Generic
22{
23 Render_Engine_Software_Generic software;
24};
25
20struct _Render_Output_GL_Generic 26struct _Render_Output_GL_Generic
21{ 27{
22 Render_Output_Software_Generic software; 28 Render_Output_Software_Generic software;
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index ef9bf2a..bba3c26 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -123,6 +123,28 @@ _context_stored_reset(void *data EINA_UNUSED, void *surface)
123#define CONTEXT_STORE(data, surface, context) _context_store(data, surface, context) 123#define CONTEXT_STORE(data, surface, context) _context_store(data, surface, context)
124#define CONTEXT_STORED_RESET(data, surface) _context_stored_reset(data, surface) 124#define CONTEXT_STORED_RESET(data, surface) _context_stored_reset(data, surface)
125 125
126static void *
127eng_engine_new(void)
128{
129 Render_Engine_GL_Generic *engine;
130
131 engine = calloc(1, sizeof (Render_Engine_GL_Generic));
132 if (!engine) return NULL;
133
134 return engine;
135}
136
137static void
138eng_engine_free(void *engine)
139{
140 Render_Engine_GL_Generic *e = engine;
141 Render_Output_GL_Generic *output;
142
143 EINA_LIST_FREE(e->software.outputs, output)
144 ERR("Output %p not properly cleaned before engine destruction.", output);
145 free(e);
146}
147
126static void 148static void
127eng_rectangle_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async EINA_UNUSED) 149eng_rectangle_draw(void *engine EINA_UNUSED, void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async EINA_UNUSED)
128{ 150{
@@ -3081,6 +3103,9 @@ module_open(Evas_Module *em)
3081 func = pfunc; 3103 func = pfunc;
3082 /* now to override methods */ 3104 /* now to override methods */
3083#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 3105#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
3106 ORD(engine_new);
3107 ORD(engine_free);
3108
3084 ORD(context_clip_image_set); 3109 ORD(context_clip_image_set);
3085 ORD(context_clip_image_unset); 3110 ORD(context_clip_image_unset);
3086 ORD(context_clip_image_get); 3111 ORD(context_clip_image_get);