forked from enlightenment/efl
evas: introduce a engine_new/free in gl_generic backend.
This commit is contained in:
parent
46e2e103d7
commit
3a8d98a54f
|
@ -8,6 +8,7 @@
|
|||
#include "../gl_common/evas_gl_core.h"
|
||||
#include "../gl_common/evas_gl_core_private.h"
|
||||
|
||||
typedef struct _Render_Engine_GL_Generic Render_Engine_GL_Generic;
|
||||
typedef struct _Render_Output_GL_Generic Render_Output_GL_Generic;
|
||||
typedef struct _Context_3D Context_3D;
|
||||
|
||||
|
@ -17,6 +18,11 @@ typedef void *(*Window_EGL_Display_Get)(Outbuf *ob);
|
|||
typedef Context_3D *(*Window_GL_Context_New)(Outbuf *ob);
|
||||
typedef void (*Window_GL_Context_Use)(Context_3D *ctx);
|
||||
|
||||
struct _Render_Engine_GL_Generic
|
||||
{
|
||||
Render_Engine_Software_Generic software;
|
||||
};
|
||||
|
||||
struct _Render_Output_GL_Generic
|
||||
{
|
||||
Render_Output_Software_Generic software;
|
||||
|
|
|
@ -123,6 +123,28 @@ _context_stored_reset(void *data EINA_UNUSED, void *surface)
|
|||
#define CONTEXT_STORE(data, surface, context) _context_store(data, surface, context)
|
||||
#define CONTEXT_STORED_RESET(data, surface) _context_stored_reset(data, surface)
|
||||
|
||||
static void *
|
||||
eng_engine_new(void)
|
||||
{
|
||||
Render_Engine_GL_Generic *engine;
|
||||
|
||||
engine = calloc(1, sizeof (Render_Engine_GL_Generic));
|
||||
if (!engine) return NULL;
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_engine_free(void *engine)
|
||||
{
|
||||
Render_Engine_GL_Generic *e = engine;
|
||||
Render_Output_GL_Generic *output;
|
||||
|
||||
EINA_LIST_FREE(e->software.outputs, output)
|
||||
ERR("Output %p not properly cleaned before engine destruction.", output);
|
||||
free(e);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_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)
|
||||
{
|
||||
|
@ -3081,6 +3103,9 @@ module_open(Evas_Module *em)
|
|||
func = pfunc;
|
||||
/* now to override methods */
|
||||
#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
|
||||
ORD(engine_new);
|
||||
ORD(engine_free);
|
||||
|
||||
ORD(context_clip_image_set);
|
||||
ORD(context_clip_image_unset);
|
||||
ORD(context_clip_image_get);
|
||||
|
|
Loading…
Reference in New Issue