Create egl_swap_buffers

This commit is contained in:
twinaphex 2015-11-19 14:38:55 +01:00
parent e2c82900d1
commit 7b39fd50a3
10 changed files with 19 additions and 58 deletions

View File

@ -118,3 +118,8 @@ void egl_bind_hw_render(void *data, bool enable)
g_egl_surf,
enable ? g_egl_hw_ctx : g_egl_ctx);
}
void egl_swap_buffers(void *data)
{
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}

View File

@ -38,4 +38,6 @@ gfx_ctx_proc_t egl_get_proc_address(const char *symbol);
void egl_bind_hw_render(void *data, bool enable);
void egl_swap_buffers(void *data);
#endif

View File

@ -192,19 +192,6 @@ error:
return false;
}
static void android_gfx_ctx_swap_buffers(void *data)
{
driver_t *driver = driver_get_ptr();
gfx_ctx_android_data_t *android = NULL;
android = (gfx_ctx_android_data_t*)driver->video_context_data;
(void)data;
if (android)
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void android_gfx_ctx_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
@ -363,7 +350,7 @@ const gfx_ctx_driver_t gfx_ctx_android = {
android_gfx_ctx_has_focus,
android_gfx_ctx_suppress_screensaver,
android_gfx_ctx_has_windowed,
android_gfx_ctx_swap_buffers,
egl_swap_buffers,
android_gfx_ctx_input_driver,
egl_get_proc_address,
NULL,

View File

@ -282,12 +282,6 @@ screen_error:
return false;
}
static void gfx_ctx_qnx_swap_buffers(void *data)
{
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void gfx_ctx_qnx_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
@ -402,7 +396,7 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = {
gfx_ctx_qnx_has_focus,
gfx_ctx_qnx_suppress_screensaver,
gfx_ctx_qnx_has_windowed,
gfx_ctx_qnx_swap_buffers,
egl_swap_buffers,
gfx_ctx_qnx_input_driver,
egl_get_proc_address,
NULL,

View File

@ -266,7 +266,7 @@ static void gfx_ctx_drm_egl_swap_buffers(void *data)
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
egl_swap_buffers(data);
/* I guess we have to wait for flip to have taken
* place before another flip can be queued up. */
@ -802,7 +802,7 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data,
goto error;
glClear(GL_COLOR_BUFFER_BIT);
eglSwapBuffers(g_egl_dpy, g_egl_surf);
egl_swap_buffers(NULL);
drm->g_bo = gbm_surface_lock_front_buffer(drm->g_gbm_surface);
fb = drm_fb_get_from_bo(drm, drm->g_bo);

View File

@ -66,8 +66,10 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
static void gfx_ctx_emscripten_swap_buffers(void *data)
{
(void)data;
// no-op in emscripten, no way to force swap/wait for VSync in browsers
//eglSwapBuffers(g_egl_dpy, g_egl_surf);
/* no-op in emscripten, no way to force swap/wait for VSync in browsers */
#if 0
egl_swap_buffers(data);
#endif
}
static void gfx_ctx_emscripten_set_resize(void *data,

View File

@ -147,12 +147,6 @@ error:
return false;
}
static void gfx_ctx_mali_fbdev_swap_buffers(void *data)
{
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
@ -302,7 +296,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
gfx_ctx_mali_fbdev_has_focus,
gfx_ctx_mali_fbdev_suppress_screensaver,
gfx_ctx_mali_fbdev_has_windowed,
gfx_ctx_mali_fbdev_swap_buffers,
egl_swap_buffers,
gfx_ctx_mali_fbdev_input_driver,
egl_get_proc_address,
NULL,

View File

@ -98,12 +98,6 @@ static void gfx_ctx_vc_check_window(void *data, bool *quit,
*quit = g_quit;
}
static void gfx_ctx_vc_swap_buffers(void *data)
{
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height)
{
(void)data;
@ -627,7 +621,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
gfx_ctx_vc_has_focus,
gfx_ctx_vc_suppress_screensaver,
gfx_ctx_vc_has_windowed,
gfx_ctx_vc_swap_buffers,
egl_swap_buffers,
gfx_ctx_vc_input_driver,
egl_get_proc_address,
gfx_ctx_vc_image_buffer_init,

View File

@ -254,17 +254,6 @@ static void gfx_ctx_wl_check_window(void *data, bool *quit,
*quit = g_quit;
}
static void gfx_ctx_wl_swap_buffers(void *data)
{
driver_t *driver = driver_get_ptr();
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)
driver->video_context_data;
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
{
driver_t *driver = driver_get_ptr();
@ -829,7 +818,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
gfx_ctx_wl_has_focus,
gfx_ctx_wl_suppress_screensaver,
gfx_ctx_wl_has_windowed,
gfx_ctx_wl_swap_buffers,
egl_swap_buffers,
gfx_ctx_wl_input_driver,
egl_get_proc_address,
NULL,

View File

@ -73,12 +73,6 @@ static void gfx_ctx_xegl_swap_interval(void *data, unsigned interval)
}
}
static void gfx_ctx_xegl_swap_buffers(void *data)
{
(void)data;
eglSwapBuffers(g_egl_dpy, g_egl_surf);
}
static void gfx_ctx_xegl_set_resize(void *data,
unsigned width, unsigned height)
{
@ -578,7 +572,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
gfx_ctx_xegl_has_focus,
gfx_ctx_xegl_suppress_screensaver,
gfx_ctx_xegl_has_windowed,
gfx_ctx_xegl_swap_buffers,
egl_swap_buffers,
gfx_ctx_xegl_input_driver,
egl_get_proc_address,
NULL,