mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-08 18:36:28 +00:00
Create egl_bind_hw_render
This commit is contained in:
parent
6dee1fcc92
commit
e2c82900d1
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -298,4 +298,5 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
|
||||
gfx_ctx_emscripten_write_egl_image,
|
||||
NULL,
|
||||
"emscripten",
|
||||
egl_bind_hw_render,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user