(Context drivers) Cleanups - use egl_get_proc_address directly instead

of wrapper functions
This commit is contained in:
twinaphex 2020-07-18 17:22:24 +02:00
parent 7c66f0adbc
commit 34662e8fe8
13 changed files with 68 additions and 129 deletions

View File

@ -329,15 +329,6 @@ static void android_gfx_ctx_set_swap_interval(void *data, int swap_interval)
#endif
}
static gfx_ctx_proc_t android_gfx_ctx_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void android_gfx_ctx_bind_hw_render(void *data, bool enable)
{
android_ctx_data_t *and = (android_ctx_data_t*)data;
@ -381,7 +372,11 @@ const gfx_ctx_driver_t gfx_ctx_android = {
false, /* has_windowed */
android_gfx_ctx_swap_buffers,
android_gfx_ctx_input_driver,
android_gfx_ctx_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -822,15 +822,6 @@ static bool gfx_ctx_drm_bind_api(void *video_driver,
return false;
}
static gfx_ctx_proc_t gfx_ctx_drm_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void gfx_ctx_drm_bind_hw_render(void *data, bool enable)
{
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
@ -891,7 +882,11 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
false, /* has_windowed */
gfx_ctx_drm_swap_buffers,
gfx_ctx_drm_input_driver,
gfx_ctx_drm_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -110,15 +110,6 @@ static void gfx_ctx_go2_drm_input_driver(void *data,
*input_data = NULL;
}
static gfx_ctx_proc_t gfx_ctx_go2_drm_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void *gfx_ctx_go2_drm_init(void *video_driver)
{
gfx_ctx_go2_drm_data_t *drm = (gfx_ctx_go2_drm_data_t*)
@ -399,7 +390,11 @@ const gfx_ctx_driver_t gfx_ctx_go2_drm = {
false, /* has_windowed */
gfx_ctx_go2_drm_swap_buffers,
gfx_ctx_go2_drm_input_driver,
gfx_ctx_go2_drm_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -291,15 +291,6 @@ static bool gfx_ctx_emscripten_write_egl_image(void *data,
const void *frame, unsigned width, unsigned height, unsigned pitch,
bool rgb32, unsigned index, void **image_handle) { return false; }
static gfx_ctx_proc_t gfx_ctx_emscripten_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void gfx_ctx_emscripten_bind_hw_render(void *data, bool enable)
{
emscripten_ctx_data_t *emscripten = (emscripten_ctx_data_t*)data;
@ -340,7 +331,11 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
false,
gfx_ctx_emscripten_swap_buffers,
gfx_ctx_emscripten_input_driver,
gfx_ctx_emscripten_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
gfx_ctx_emscripten_init_egl_image_buffer,
gfx_ctx_emscripten_write_egl_image,
NULL,

View File

@ -254,13 +254,6 @@ static void gfx_ctx_mali_fbdev_swap_buffers(void *data)
#endif
}
static gfx_ctx_proc_t gfx_ctx_mali_fbdev_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#endif
}
static void gfx_ctx_mali_fbdev_bind_hw_render(void *data, bool enable)
{
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
@ -313,7 +306,11 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
false, /* has_windowed */
gfx_ctx_mali_fbdev_swap_buffers,
gfx_ctx_mali_fbdev_input_driver,
gfx_ctx_mali_fbdev_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -214,13 +214,6 @@ static void gfx_ctx_opendingux_set_swap_interval(
#endif
}
#ifdef HAVE_EGL
static gfx_ctx_proc_t gfx_ctx_opendingux_get_proc_address(const char *symbol)
{
return egl_get_proc_address(symbol);
}
#endif
static void gfx_ctx_opendingux_bind_hw_render(void *data, bool enable)
{
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
@ -262,7 +255,7 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
gfx_ctx_opendingux_swap_buffers,
gfx_ctx_opendingux_input_driver,
#ifdef HAVE_EGL
gfx_ctx_opendingux_get_proc_address,
egl_get_proc_address,
#else
NULL,
#endif

View File

@ -235,13 +235,6 @@ static void orbis_ctx_swap_buffers(void *data)
#endif
}
static gfx_ctx_proc_t orbis_ctx_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#endif
}
static void orbis_ctx_bind_hw_render(void *data, bool enable)
{
orbis_ctx_data_t *ctx_orbis = (orbis_ctx_data_t *)data;
@ -300,7 +293,11 @@ const gfx_ctx_driver_t orbis_ctx = {
false, /* has_windowed */
orbis_ctx_swap_buffers,
orbis_ctx_input_driver,
orbis_ctx_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -407,13 +407,6 @@ static void gfx_ctx_qnx_bind_hw_render(void *data, bool enable)
#endif
}
static gfx_ctx_proc_t gfx_ctx_qnx_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#endif
}
static uint32_t gfx_ctx_qnx_get_flags(void *data)
{
uint32_t flags = 0;
@ -447,7 +440,11 @@ const gfx_ctx_driver_t gfx_ctx_qnx = {
false, /* has_windowed */
gfx_ctx_qnx_swap_buffers,
gfx_ctx_qnx_input_driver,
gfx_ctx_qnx_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -231,13 +231,6 @@ static void switch_ctx_swap_buffers(void *data)
#endif
}
static gfx_ctx_proc_t switch_ctx_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#endif
}
static void switch_ctx_bind_hw_render(void *data, bool enable)
{
switch_ctx_data_t *ctx_nx = (switch_ctx_data_t *)data;
@ -348,7 +341,11 @@ const gfx_ctx_driver_t switch_ctx = {
false, /* has_windowed */
switch_ctx_swap_buffers,
switch_ctx_input_driver,
switch_ctx_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -670,15 +670,6 @@ static void gfx_ctx_vc_bind_hw_render(void *data, bool enable)
#endif
}
static gfx_ctx_proc_t gfx_ctx_vc_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static uint32_t gfx_ctx_vc_get_flags(void *data)
{
uint32_t flags = 0;
@ -711,7 +702,11 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
false, /* has_windowed */
gfx_ctx_vc_swap_buffers,
gfx_ctx_vc_input_driver,
gfx_ctx_vc_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
gfx_ctx_vc_image_buffer_init,
gfx_ctx_vc_image_buffer_write,
NULL,

View File

@ -219,15 +219,6 @@ static void gfx_ctx_vivante_swap_buffers(void *data)
#endif
}
static gfx_ctx_proc_t gfx_ctx_vivante_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void gfx_ctx_vivante_bind_hw_render(void *data, bool enable)
{
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
@ -268,7 +259,11 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
false, /* has_windowed */
gfx_ctx_vivante_swap_buffers,
gfx_ctx_vivante_input_driver,
gfx_ctx_vivante_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
NULL,

View File

@ -843,15 +843,6 @@ static void gfx_ctx_wl_swap_buffers(void *data)
#endif
}
static gfx_ctx_proc_t gfx_ctx_wl_get_proc_address(const char *symbol)
{
#ifdef HAVE_EGL
return egl_get_proc_address(symbol);
#else
return NULL;
#endif
}
static void gfx_ctx_wl_bind_hw_render(void *data, bool enable)
{
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
@ -923,7 +914,11 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
true, /* has_windowed */
gfx_ctx_wl_swap_buffers,
gfx_ctx_wl_input_driver,
gfx_ctx_wl_get_proc_address,
#ifdef HAVE_EGL
egl_get_proc_address,
#else
NULL,
#endif
NULL,
NULL,
gfx_ctx_wl_show_mouse,

View File

@ -517,11 +517,14 @@ static void gfx_ctx_wgl_update_title(void *data)
static void gfx_ctx_wgl_get_video_size(void *data,
unsigned *width, unsigned *height)
{
HWND window = win32_get_window();
HWND window = win32_get_window();
(void)data;
if (!window)
if (window)
{
*width = g_win32_resize_width;
*height = g_win32_resize_height;
}
else
{
RECT mon_rect;
MONITORINFOEX current_mon;
@ -529,14 +532,9 @@ static void gfx_ctx_wgl_get_video_size(void *data,
HMONITOR hm_to_use = NULL;
win32_monitor_info(&current_mon, &hm_to_use, &mon_id);
mon_rect = current_mon.rcMonitor;
*width = mon_rect.right - mon_rect.left;
*height = mon_rect.bottom - mon_rect.top;
}
else
{
*width = g_win32_resize_width;
*height = g_win32_resize_height;
mon_rect = current_mon.rcMonitor;
*width = mon_rect.right - mon_rect.left;
*height = mon_rect.bottom - mon_rect.top;
}
}
@ -837,13 +835,8 @@ static void gfx_ctx_wgl_get_video_output_size(void *data,
win32_get_video_output_size(width, height);
}
static void gfx_ctx_wgl_get_video_output_prev(void *data)
{
}
static void gfx_ctx_wgl_get_video_output_next(void *data)
{
}
static void gfx_ctx_wgl_get_video_output_prev(void *data) { }
static void gfx_ctx_wgl_get_video_output_next(void *data) { }
const gfx_ctx_driver_t gfx_ctx_wgl = {
gfx_ctx_wgl_init,