Create egl_bind_hw_render

This commit is contained in:
twinaphex 2015-11-19 14:32:39 +01:00
parent 6dee1fcc92
commit e2c82900d1
9 changed files with 21 additions and 75 deletions

View File

@ -106,3 +106,15 @@ void egl_destroy(void)
g_egl_dpy = EGL_NO_DISPLAY;
g_egl_config = 0;
}
void egl_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf,
enable ? g_egl_hw_ctx : g_egl_ctx);
}

View File

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

View File

@ -306,20 +306,6 @@ static bool android_gfx_ctx_has_windowed(void *data)
return false;
}
static void android_gfx_ctx_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy)
return;
if (!g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf, enable ?
g_egl_hw_ctx : g_egl_ctx);
}
static void dpi_get_density(char *s, size_t len)
{
system_property_get("getprop", "ro.sf.lcd_density", s);
@ -384,5 +370,5 @@ const gfx_ctx_driver_t gfx_ctx_android = {
NULL,
NULL,
"android",
android_gfx_ctx_bind_hw_render,
egl_bind_hw_render,
};

View File

@ -384,17 +384,6 @@ static bool gfx_ctx_qnx_has_windowed(void *data)
return false;
}
static void gfx_qnx_ctx_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf, enable ? g_egl_hw_ctx : g_egl_ctx);
}
const gfx_ctx_driver_t gfx_ctx_bbqnx = {
gfx_ctx_qnx_init,
gfx_ctx_qnx_destroy,
@ -420,5 +409,5 @@ const gfx_ctx_driver_t gfx_ctx_bbqnx = {
NULL,
NULL,
"blackberry_qnx",
gfx_qnx_ctx_bind_hw_render,
egl_bind_hw_render,
};

View File

@ -907,17 +907,6 @@ static bool gfx_ctx_drm_egl_bind_api(void *data,
return false;
}
static void gfx_ctx_drm_egl_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf,
enable ? g_egl_hw_ctx : g_egl_ctx);
}
const gfx_ctx_driver_t gfx_ctx_drm_egl = {
gfx_ctx_drm_egl_init,
@ -944,5 +933,5 @@ const gfx_ctx_driver_t gfx_ctx_drm_egl = {
NULL,
NULL,
"kms-egl",
gfx_ctx_drm_egl_bind_hw_render,
egl_bind_hw_render,
};

View File

@ -298,4 +298,5 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
gfx_ctx_emscripten_write_egl_image,
NULL,
"emscripten",
egl_bind_hw_render,
};

View File

@ -609,17 +609,6 @@ static bool gfx_ctx_vc_image_buffer_write(void *data, const void *frame, unsigne
return ret;
}
static void gfx_ctx_vc_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf, enable ? g_egl_hw_ctx : g_egl_ctx);
}
const gfx_ctx_driver_t gfx_ctx_videocore = {
gfx_ctx_vc_init,
gfx_ctx_vc_destroy,
@ -645,5 +634,5 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
gfx_ctx_vc_image_buffer_write,
NULL,
"videocore",
gfx_ctx_vc_bind_hw_render,
egl_bind_hw_render,
};

View File

@ -667,17 +667,6 @@ static bool gfx_ctx_wl_bind_api(void *data,
return false;
}
static void gfx_ctx_wl_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf,
enable ? g_egl_hw_ctx : g_egl_ctx);
}
static void keyboard_handle_keymap(void* data,
struct wl_keyboard* keyboard,
uint32_t format,
@ -847,5 +836,5 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
NULL,
NULL,
"wayland",
gfx_ctx_wl_bind_hw_render,
egl_bind_hw_render,
};

View File

@ -559,17 +559,6 @@ static void gfx_ctx_xegl_show_mouse(void *data, bool state)
x11_show_mouse(g_x11_dpy, g_x11_win, state);
}
static void gfx_ctx_xegl_bind_hw_render(void *data, bool enable)
{
g_use_hw_ctx = enable;
if (!g_egl_dpy || !g_egl_surf)
return;
eglMakeCurrent(g_egl_dpy, g_egl_surf,
g_egl_surf, enable ? g_egl_hw_ctx : g_egl_ctx);
}
const gfx_ctx_driver_t gfx_ctx_x_egl =
{
gfx_ctx_xegl_init,
@ -596,5 +585,5 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
NULL,
gfx_ctx_xegl_show_mouse,
"x-egl",
gfx_ctx_xegl_bind_hw_render,
egl_bind_hw_render,
};