evas-gl-drm: Readd support for pre_swap/post_swap callbacks

Summary: The pre/post swap callbacks were forgotten when doing the
engine rewrite, so readd them

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-06-03 14:30:10 -04:00
parent 354fd6f67b
commit 47a2602af7
4 changed files with 20 additions and 5 deletions

View File

@ -29,6 +29,13 @@ struct _Evas_Engine_Info_GL_Drm
unsigned char swap_mode : 4;
} info;
struct
{
void (*pre_swap)(void *data, Evas *evas);
void (*post_swap)(void *data, Evas *evas);
void *data;
} callback;
/* non-blocking or blocking mode */
Evas_Engine_Render_Mode render_mode;
};

View File

@ -794,6 +794,8 @@ eng_setup(Evas *evas, void *in)
return 0;
}
ob->evas = evas;
if (!evas_render_engine_gl_generic_init(&re->generic, ob,
evas_outbuf_buffer_state_get,
evas_outbuf_rot_get,
@ -861,6 +863,8 @@ eng_setup(Evas *evas, void *in)
evas_outbuf_use(ob);
if (ob)
{
ob->evas = evas;
evas_render_engine_software_generic_update(&re->generic.software, ob,
epd->output.w, epd->output.h);
@ -889,6 +893,8 @@ eng_setup(Evas *evas, void *in)
evas_outbuf_use(ob);
if (ob)
{
ob->evas = evas;
evas_render_engine_software_generic_update(&re->generic.software, ob,
epd->output.w, epd->output.h);

View File

@ -66,6 +66,8 @@ struct _Outbuf
Evas_Engine_Info_GL_Drm *info;
Evas_Engine_GL_Context *gl_context;
Evas *evas; // used for pre_swap, post_swap
int w, h;
unsigned int rotation, depth;
Render_Engine_Swap_Mode swap_mode;

View File

@ -214,7 +214,7 @@ evas_outbuf_new(Evas_Engine_Info_GL_Drm *info, int w, int h, Render_Engine_Swap_
ob->depth = info->info.depth;
ob->rotation = info->info.rotation;
ob->destination_alpha = info->info.destination_alpha;
ob->vsync = info->info.vsync;
/* ob->vsync = info->info.vsync; */
ob->gbm = info->info.gbm;
ob->surface = info->info.surface;
ob->swap_mode = swap_mode;
@ -528,8 +528,8 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode
ob->vsync = 1;
}
/* if (ob->info->callback.pre_swap) */
/* ob->info->callback.pre_swap(ob->info->callback.data, ob->evas); */
if (ob->info->callback.pre_swap)
ob->info->callback.pre_swap(ob->info->callback.data, ob->evas);
// TODO: Check eglSwapBuffersWithDamage for gl_drm and apply
#if 0
@ -592,8 +592,8 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode
#endif
eglSwapBuffers(ob->egl.disp, ob->egl.surface[0]);
/* if (ob->info->callback.post_swap) */
/* ob->info->callback.post_swap(ob->info->callback.data, ob->evas); */
if (ob->info->callback.post_swap)
ob->info->callback.post_swap(ob->info->callback.data, ob->evas);
//Flush GL Surface data to Framebuffer
_evas_outbuf_buffer_swap(ob, NULL, 0);