diff --git a/driver.h b/driver.h index 8aa49fc5a3..30feead836 100644 --- a/driver.h +++ b/driver.h @@ -199,7 +199,6 @@ typedef struct driver { frontend_ctx_driver_t *frontend_ctx; const ui_companion_driver_t *ui_companion; - const void *video_context; const input_driver_t *input; const camera_driver_t *camera; const location_driver_t *location; diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index facce56939..db42c91e65 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -78,7 +78,8 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = { NULL }; -static void *video_context_data; +static const gfx_ctx_driver_t *video_context; +static void *video_context_data; void *gfx_ctx_data_get_ptr(void) { @@ -87,22 +88,17 @@ void *gfx_ctx_data_get_ptr(void) void gfx_ctx_set(const gfx_ctx_driver_t *ctx_driver) { - driver_t *driver = driver_get_ptr(); - if (!driver || !ctx_driver) + if (!ctx_driver) return; - driver->video_context = ctx_driver; + video_context = ctx_driver; } void gfx_ctx_destroy(const gfx_ctx_driver_t *ctx_driver) { - driver_t *driver = driver_get_ptr(); - if (!driver) - return; - if (ctx_driver) gfx_ctx_destroy(ctx_driver); - driver->video_context = NULL; + video_context = NULL; } void gfx_ctx_data_set(void *ptr) @@ -121,10 +117,7 @@ void gfx_ctx_free_data(void) static const gfx_ctx_driver_t *gfx_ctx_get_ptr(void) { - driver_t *driver = driver_get_ptr(); - if (!driver) - return NULL; - return (const gfx_ctx_driver_t*)driver->video_context; + return video_context; } void gfx_ctx_free(void *data)