mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Revert "Add get_metrics to poke interface"
This reverts commit 119689c9405b5e4a321fafc340f6f0294b0338c3.
This commit is contained in:
parent
31f570fdf6
commit
3e41cbc381
@ -243,7 +243,6 @@ static void caca_set_texture_frame(void *data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t caca_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1247,7 +1247,6 @@ static uint32_t ctr_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t ctr_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
ctr_get_flags,
|
||||
ctr_load_texture,
|
||||
ctr_unload_texture,
|
||||
|
@ -1754,11 +1754,10 @@ static void d3d10_get_video_output_next(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d10_poke_interface = {
|
||||
win32_get_metrics,
|
||||
d3d10_get_flags,
|
||||
d3d10_gfx_load_texture,
|
||||
d3d10_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* set_video_mode */
|
||||
#ifndef __WINRT__
|
||||
win32_get_refresh_rate,
|
||||
#else
|
||||
|
@ -1835,11 +1835,10 @@ static void d3d11_get_video_output_next(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d11_poke_interface = {
|
||||
win32_get_metrics,
|
||||
d3d11_get_flags,
|
||||
d3d11_gfx_load_texture,
|
||||
d3d11_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* set_video_mode */
|
||||
#ifndef __WINRT__
|
||||
win32_get_refresh_rate,
|
||||
#else
|
||||
|
@ -1834,11 +1834,10 @@ static void d3d12_get_video_output_next(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d12_poke_interface = {
|
||||
win32_get_metrics,
|
||||
d3d12_get_flags,
|
||||
d3d12_gfx_load_texture,
|
||||
d3d12_gfx_unload_texture,
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* set_video_mode */
|
||||
#ifndef __WINRT__
|
||||
win32_get_refresh_rate,
|
||||
#else
|
||||
|
@ -1794,7 +1794,6 @@ static uint32_t d3d8_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d_poke_interface = {
|
||||
win32_get_metrics,
|
||||
d3d8_get_flags,
|
||||
d3d8_load_texture,
|
||||
d3d8_unload_texture,
|
||||
|
@ -1966,7 +1966,6 @@ static uint32_t d3d9_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t d3d9_poke_interface = {
|
||||
win32_get_metrics,
|
||||
d3d9_get_flags,
|
||||
d3d9_load_texture,
|
||||
d3d9_unload_texture,
|
||||
|
@ -580,7 +580,6 @@ static uint32_t dispmanx_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t dispmanx_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
dispmanx_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
@ -607,6 +606,7 @@ static const video_poke_interface_t dispmanx_poke_interface = {
|
||||
static void dispmanx_gfx_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &dispmanx_poke_interface;
|
||||
}
|
||||
|
||||
|
@ -933,7 +933,6 @@ static void drm_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t drm_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1368,12 +1368,25 @@ static void exynos_gfx_set_nonblock_state(void *data, bool state,
|
||||
vid->data->sync = !state;
|
||||
}
|
||||
|
||||
/* always alive */
|
||||
static bool exynos_gfx_alive(void *data) { return true; }
|
||||
/* drm device always has focus */
|
||||
static bool exynos_gfx_focus(void *data) { return true; }
|
||||
static bool exynos_gfx_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true; /* always alive */
|
||||
}
|
||||
|
||||
static bool exynos_gfx_suppress_screensaver(void *data, bool enable) { return false; }
|
||||
static bool exynos_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true; /* drm device always has focus */
|
||||
}
|
||||
|
||||
static bool exynos_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void exynos_gfx_set_rotation(void *data, unsigned rotation)
|
||||
{
|
||||
@ -1405,16 +1418,19 @@ static void exynos_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||
vid->aspect_changed = true;
|
||||
}
|
||||
|
||||
static void exynos_set_texture_frame(void *data,
|
||||
const void *frame, bool rgb32,
|
||||
static void exynos_apply_state_changes(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void exynos_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
const enum exynos_buffer_type buf_type =
|
||||
defaults[EXYNOS_IMAGE_MENU].buf_type;
|
||||
struct exynos_video *vid = data;
|
||||
struct exynos_data *pdata = vid->data;
|
||||
struct g2d_image *src = pdata->src[EXYNOS_IMAGE_MENU];
|
||||
const unsigned size = width * height * (rgb32 ? 4 : 2);
|
||||
const enum exynos_buffer_type buf_type = defaults[EXYNOS_IMAGE_MENU].buf_type;
|
||||
struct exynos_video *vid = data;
|
||||
struct exynos_data *pdata = vid->data;
|
||||
struct g2d_image *src = pdata->src[EXYNOS_IMAGE_MENU];
|
||||
const unsigned size = width * height * (rgb32 ? 4 : 2);
|
||||
|
||||
if (exynos_realloc_buffer(pdata, buf_type, size) != 0)
|
||||
return;
|
||||
@ -1445,13 +1461,21 @@ static void exynos_set_texture_enable(void *data, bool state, bool full_screen)
|
||||
vid->menu_active = state;
|
||||
}
|
||||
|
||||
static void exynos_apply_state_changes(void *data) { }
|
||||
static void exynos_set_osd_msg(void *data, const char *msg,
|
||||
const struct font_params *params) { }
|
||||
static void exynos_show_mouse(void *data, bool state) { }
|
||||
const struct font_params *params)
|
||||
{
|
||||
(void)data;
|
||||
(void)msg;
|
||||
(void)params;
|
||||
}
|
||||
|
||||
static void exynos_show_mouse(void *data, bool state)
|
||||
{
|
||||
(void)data;
|
||||
(void)state;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t exynos_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -273,8 +273,35 @@ static void fpga_gfx_free(void *data)
|
||||
do_mmap_op(&fpga->regOp);
|
||||
}
|
||||
|
||||
static bool fpga_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void fpga_gfx_set_rotation(void *data,
|
||||
unsigned rotation)
|
||||
{
|
||||
(void)data;
|
||||
(void)rotation;
|
||||
}
|
||||
|
||||
static void fpga_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp)
|
||||
{
|
||||
(void)data;
|
||||
(void)vp;
|
||||
}
|
||||
|
||||
static bool fpga_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
||||
{
|
||||
(void)data;
|
||||
(void)buffer;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -309,25 +336,24 @@ static void fpga_set_texture_frame(void *data,
|
||||
}
|
||||
}
|
||||
|
||||
static bool fpga_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path) { return false; }
|
||||
static void fpga_gfx_set_rotation(void *data,
|
||||
unsigned rotation) { }
|
||||
static void fpga_gfx_viewport_info(void *data,
|
||||
struct video_viewport *vp) { }
|
||||
static void fpga_set_osd_msg(void *data,
|
||||
const char *msg,
|
||||
const void *params, void *font) { }
|
||||
const void *params, void *font)
|
||||
{
|
||||
}
|
||||
|
||||
static void fpga_get_video_output_size(void *data,
|
||||
unsigned *width, unsigned *height) { }
|
||||
static void fpga_get_video_output_prev(void *data) { }
|
||||
static void fpga_get_video_output_next(void *data) { }
|
||||
|
||||
static void fpga_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
bool fullscreen) { }
|
||||
bool fullscreen)
|
||||
{
|
||||
}
|
||||
|
||||
static const video_poke_interface_t fpga_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
fpga_set_video_mode,
|
||||
NULL,
|
||||
|
@ -645,7 +645,6 @@ static uint32_t gcm_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gcm_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
gcm_get_flags,
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
|
@ -682,7 +682,6 @@ static void gdi_get_video_output_next(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gdi_poke_interface = {
|
||||
win32_get_metrics,
|
||||
gdi_get_flags,
|
||||
gdi_load_texture,
|
||||
gdi_unload_texture,
|
||||
|
@ -4532,20 +4532,7 @@ static uint32_t gl2_get_flags(void *data)
|
||||
return flags;
|
||||
}
|
||||
|
||||
static bool gl2_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
gl_t *gl = (gl_t*)data;
|
||||
if ( gl
|
||||
&& gl->ctx_data
|
||||
&& gl->ctx_driver
|
||||
&& gl->ctx_driver->get_metrics)
|
||||
return gl->ctx_driver->get_metrics(gl->ctx_data, type, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl2_poke_interface = {
|
||||
gl2_get_metrics,
|
||||
gl2_get_flags,
|
||||
gl2_load_texture,
|
||||
gl2_unload_texture,
|
||||
@ -4572,6 +4559,7 @@ static const video_poke_interface_t gl2_poke_interface = {
|
||||
static void gl2_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
(void)data;
|
||||
*iface = &gl2_poke_interface;
|
||||
}
|
||||
|
||||
|
@ -1386,20 +1386,7 @@ static uint32_t gl1_get_flags(void *data)
|
||||
return flags;
|
||||
}
|
||||
|
||||
static bool gl1_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
gl1_t *gl1 = (gl1_t*)data;
|
||||
if ( gl1
|
||||
&& gl1->ctx_data
|
||||
&& gl1->ctx_driver
|
||||
&& gl1->ctx_driver->get_metrics)
|
||||
return gl1->ctx_driver->get_metrics(gl1->ctx_data, type, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl1_poke_interface = {
|
||||
gl1_get_metrics,
|
||||
gl1_get_flags,
|
||||
gl1_load_texture,
|
||||
gl1_unload_texture,
|
||||
|
@ -2240,20 +2240,7 @@ static retro_proc_address_t gl_core_get_proc_address(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool gl_core_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
gl_core_t *gl = (gl_core_t*)data;
|
||||
if ( gl
|
||||
&& gl->ctx_data
|
||||
&& gl->ctx_driver
|
||||
&& gl->ctx_driver->get_metrics)
|
||||
return gl->ctx_driver->get_metrics(gl->ctx_data, type, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gl_core_poke_interface = {
|
||||
gl_core_get_metrics,
|
||||
gl_core_get_flags,
|
||||
gl_core_load_texture,
|
||||
gl_core_unload_texture,
|
||||
|
@ -1717,7 +1717,6 @@ static uint32_t wiiu_gfx_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t wiiu_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
wiiu_gfx_get_flags,
|
||||
wiiu_gfx_load_texture,
|
||||
wiiu_gfx_unload_texture,
|
||||
|
@ -1326,12 +1326,11 @@ static uint32_t gx_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t gx_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
gx_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
gx_set_video_mode,
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL,
|
||||
gx_get_video_output_size,
|
||||
gx_get_video_output_prev,
|
||||
|
@ -59,15 +59,14 @@ static uint32_t metal_get_flags(void *data);
|
||||
#pragma mark Graphics Context for Metal
|
||||
|
||||
// The graphics context for the Metal driver is just a stubbed out version
|
||||
// It supports getting metrics such as DPI which is needed for iOS/tvOS
|
||||
// It supports getting metrics such as dpi which is needed for iOS/tvOS
|
||||
|
||||
static bool metal_gfx_ctx_get_metrics(
|
||||
void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
static bool metal_gfx_ctx_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
#ifdef HAVE_COCOATOUCH
|
||||
CGRect screenRect = [[UIScreen mainScreen] bounds];
|
||||
CGFloat scale = [[UIScreen mainScreen] scale];
|
||||
CGRect screenRect = [[UIScreen mainScreen] bounds];
|
||||
CGFloat scale = [[UIScreen mainScreen] scale];
|
||||
float displayHeight = screenRect.size.height;
|
||||
float physicalWidth = screenRect.size.width * scale;
|
||||
float physicalHeight = screenRect.size.height * scale;
|
||||
@ -401,7 +400,6 @@ static uint32_t metal_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t metal_poke_interface = {
|
||||
.get_metrics = metal_gfx_ctx_get_metrics,
|
||||
.get_flags = metal_get_flags,
|
||||
.load_texture = metal_load_texture,
|
||||
.unload_texture = metal_unload_texture,
|
||||
|
@ -421,8 +421,7 @@ static void network_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
bool fullscreen) { }
|
||||
|
||||
static const video_poke_interface_t network_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
network_set_video_mode,
|
||||
|
@ -382,28 +382,27 @@ static void oga_gfx_viewport_info(void *data, struct video_viewport *vp)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t oga_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
oga_set_texture_frame,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
oga_set_texture_frame,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
void oga_set_rotation(void *data, unsigned rotation)
|
||||
|
@ -1099,7 +1099,6 @@ static float omap_get_refresh_rate(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t omap_gfx_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -407,12 +407,11 @@ static bool ps2_get_hw_render_interface(void* data,
|
||||
}
|
||||
|
||||
static const video_poke_interface_t ps2_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL, /* get_refresh_rate */
|
||||
ps2_set_filtering,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
|
@ -783,7 +783,6 @@ static uint32_t psp_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t psp_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
psp_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -698,7 +698,6 @@ static void sdl2_grab_mouse_toggle(void *data)
|
||||
static uint32_t sdl2_get_flags(void *data) { return 0; }
|
||||
|
||||
static video_poke_interface_t sdl2_video_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
sdl2_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -266,7 +266,6 @@ static void sdl_dingux_apply_state_changes(void *data) { }
|
||||
static uint32_t sdl_dingux_get_flags(void *data) { return 0; }
|
||||
|
||||
static const video_poke_interface_t sdl_dingux_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
sdl_dingux_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -521,7 +521,6 @@ static uint32_t sdl_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t sdl_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
sdl_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -516,8 +516,7 @@ static void sixel_set_video_mode(void *data, unsigned width, unsigned height,
|
||||
bool fullscreen) { }
|
||||
|
||||
static const video_poke_interface_t sixel_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
sixel_set_video_mode,
|
||||
|
@ -932,7 +932,6 @@ static float sunxi_get_refresh_rate (void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t sunxi_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -377,7 +377,6 @@ static void switch_set_texture_enable(void *data, bool enable, bool full_screen)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t switch_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
|
@ -652,28 +652,27 @@ void switch_overlay_interface(void *data, const video_overlay_interface_t **ifac
|
||||
#endif
|
||||
|
||||
static const video_poke_interface_t switch_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL, /* set_filtering */
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL, /* get_proc_address */
|
||||
switch_set_aspect_ratio, /* set_aspect_ratio */
|
||||
switch_apply_state_changes, /* apply_state_changes */
|
||||
switch_set_texture_frame,
|
||||
switch_set_texture_enable,
|
||||
font_driver_render_msg,
|
||||
NULL, /* show_mouse */
|
||||
NULL, /* grab_mouse_toggle */
|
||||
NULL, /* get_current_shader */
|
||||
NULL, /* get_current_software_framebuffer */
|
||||
NULL, /* get_hw_render_interface */
|
||||
NULL, /* get_flags */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL, /* set_filtering */
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL, /* get_proc_address */
|
||||
switch_set_aspect_ratio, /* set_aspect_ratio */
|
||||
switch_apply_state_changes, /* apply_state_changes */
|
||||
switch_set_texture_frame,
|
||||
switch_set_texture_enable,
|
||||
font_driver_render_msg,
|
||||
NULL, /* show_mouse */
|
||||
NULL, /* grab_mouse_toggle */
|
||||
NULL, /* get_current_shader */
|
||||
NULL, /* get_current_software_framebuffer */
|
||||
NULL, /* get_hw_render_interface */
|
||||
};
|
||||
|
||||
static void switch_get_poke_interface(void *data,
|
||||
|
@ -483,49 +483,10 @@ static bool vg_suppress_screensaver(void *data, bool enable)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool vg_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
vg_t *vg = (vg_t*)data;
|
||||
if (vg && vg->ctx_data &&
|
||||
vg->ctx_driver && vg->ctx_driver->get_metrics)
|
||||
return vg->ctx_driver->get_metrics(vg->ctx_data, type, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vg_poke_interface = {
|
||||
vg_get_metrics, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL, /* load_texture */
|
||||
NULL, /* unload_texture */
|
||||
NULL, /* set_video_mode */
|
||||
NULL, /* get_refresh_rate */
|
||||
NULL,
|
||||
NULL, /* get_video_output_size */
|
||||
NULL, /* get_video_output_prev */
|
||||
NULL, /* get_video_output_next */
|
||||
NULL, /* get_current_framebuffer */
|
||||
NULL, /* get_proc_address */
|
||||
NULL, /* set_aspect_ratio */
|
||||
NULL, /* apply_state_changes */
|
||||
NULL, /* set_texture_frame */
|
||||
NULL, /* set_texture_enable */
|
||||
NULL, /* render_msg */
|
||||
NULL, /* show_mouse */
|
||||
NULL,
|
||||
NULL, /* get_current_shader */
|
||||
NULL, /* get_current_software_framebuffer */
|
||||
NULL /* get_hw_render_interface */
|
||||
};
|
||||
|
||||
static bool vg_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path) { return false; }
|
||||
|
||||
static void vg_get_poke_interface(void *data,
|
||||
const video_poke_interface_t **iface)
|
||||
{
|
||||
*iface = &vg_poke_interface;
|
||||
}
|
||||
const video_poke_interface_t **iface) { }
|
||||
|
||||
static bool vg_has_windowed(void *data)
|
||||
{
|
||||
|
@ -359,7 +359,6 @@ static void vga_set_texture_frame(void *data,
|
||||
static uint32_t vga_get_flags(void *data) { return 0; }
|
||||
|
||||
static const video_poke_interface_t vga_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
vga_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -775,7 +775,6 @@ static uint32_t vita_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vita_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
vita_get_flags,
|
||||
vita_load_texture,
|
||||
vita_unload_texture,
|
||||
|
@ -2567,20 +2567,7 @@ static void vulkan_get_video_output_next(void *data)
|
||||
vk->ctx_driver->get_video_output_next(vk->ctx_data);
|
||||
}
|
||||
|
||||
static bool vulkan_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
vk_t *vk = (vk_t*)data;
|
||||
if ( vk
|
||||
&& vk->ctx_data
|
||||
&& vk->ctx_driver
|
||||
&& vk->ctx_driver->get_metrics)
|
||||
return vk->ctx_driver->get_metrics(vk->ctx_data, type, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
static const video_poke_interface_t vulkan_poke_interface = {
|
||||
vulkan_get_metrics,
|
||||
vulkan_get_flags,
|
||||
vulkan_load_texture,
|
||||
vulkan_unload_texture,
|
||||
|
@ -179,7 +179,6 @@ static void xshm_show_mouse(void *data, bool state) { }
|
||||
static void xshm_grab_mouse_toggle(void *data) { }
|
||||
|
||||
static video_poke_interface_t xshm_video_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
NULL, /* get_flags */
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1092,7 +1092,6 @@ static void xv_viewport_info(void *data, struct video_viewport *vp)
|
||||
static uint32_t xv_get_flags(void *data) { return 0; }
|
||||
|
||||
static video_poke_interface_t xv_video_poke_interface = {
|
||||
NULL, /* get_metrics */
|
||||
xv_get_flags,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -299,7 +299,7 @@ float gfx_display_get_dpi_scale_internal(unsigned width, unsigned height)
|
||||
diagonal_pixels = (float)sqrt(
|
||||
(double)((width * width) + (height * height)));
|
||||
|
||||
/* TODO/FIXME: On Mac, calling video_driver_get_metrics()
|
||||
/* TODO/FIXME: On Mac, calling video_context_driver_get_metrics()
|
||||
* here causes RetroArch to crash (EXC_BAD_ACCESS). This is
|
||||
* unfortunate, and needs to be fixed at the gfx context driver
|
||||
* level. Until this is done, all we can do is fallback to using
|
||||
@ -322,7 +322,7 @@ float gfx_display_get_dpi_scale_internal(unsigned width, unsigned height)
|
||||
metrics.type = DISPLAY_METRIC_DPI;
|
||||
metrics.value = &dpi;
|
||||
|
||||
if (video_driver_get_metrics(&metrics) && (dpi > 0.0f))
|
||||
if (video_context_driver_get_metrics(&metrics) && (dpi > 0.0f))
|
||||
{
|
||||
float display_size;
|
||||
float dpi_scale;
|
||||
@ -433,7 +433,7 @@ float gfx_display_get_dpi_scale(unsigned width, unsigned height)
|
||||
|
||||
/* Scale is based on display metrics - these are a fixed
|
||||
* hardware property. To minimise performance overheads
|
||||
* we therefore only call video_driver_get_metrics()
|
||||
* we therefore only call video_context_driver_get_metrics()
|
||||
* on first run, or when the current video resolution changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
@ -498,7 +498,7 @@ float gfx_display_get_widget_dpi_scale(
|
||||
|
||||
/* Scale is based on display metrics - these are a fixed
|
||||
* hardware property. To minimise performance overheads
|
||||
* we therefore only call video_driver_get_metrics()
|
||||
* we therefore only call video_context_driver_get_metrics()
|
||||
* on first run, or when the current video resolution changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
|
@ -1260,15 +1260,6 @@ static struct video_shader *thread_get_current_shader(void *data)
|
||||
return thr->poke->get_current_shader(thr->driver_data);
|
||||
}
|
||||
|
||||
static bool thread_get_metrics(void *data, enum display_metric_types type,
|
||||
float *value)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
if (!thr || !thr->poke || !thr->poke->get_metrics)
|
||||
return false;
|
||||
return thr->poke->get_metrics(thr->driver_data, type, value);
|
||||
}
|
||||
|
||||
static uint32_t thread_get_flags(void *data)
|
||||
{
|
||||
thread_video_t *thr = (thread_video_t*)data;
|
||||
@ -1278,7 +1269,6 @@ static uint32_t thread_get_flags(void *data)
|
||||
}
|
||||
|
||||
static const video_poke_interface_t thread_poke = {
|
||||
thread_get_metrics,
|
||||
thread_get_flags,
|
||||
thread_load_texture,
|
||||
thread_unload_texture,
|
||||
|
@ -1255,7 +1255,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
|
||||
metrics.type = DISPLAY_METRIC_MM_WIDTH;
|
||||
metrics.value = &val;
|
||||
|
||||
if (video_driver_get_metrics(&metrics))
|
||||
if (video_context_driver_get_metrics(&metrics))
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "%s: %.2f",
|
||||
msg_hash_to_str(
|
||||
@ -1269,7 +1269,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
|
||||
|
||||
metrics.type = DISPLAY_METRIC_MM_HEIGHT;
|
||||
|
||||
if (video_driver_get_metrics(&metrics))
|
||||
if (video_context_driver_get_metrics(&metrics))
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "%s: %.2f",
|
||||
msg_hash_to_str(
|
||||
@ -1283,7 +1283,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
|
||||
|
||||
metrics.type = DISPLAY_METRIC_DPI;
|
||||
|
||||
if (video_driver_get_metrics(&metrics))
|
||||
if (video_context_driver_get_metrics(&metrics))
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), "%s: %.2f",
|
||||
msg_hash_to_str(
|
||||
|
27
retroarch.c
27
retroarch.c
@ -25237,21 +25237,19 @@ static float menu_input_get_dpi(struct rarch_state *p_rarch)
|
||||
|
||||
/* Regardless of menu driver, need 'actual' screen DPI
|
||||
* Note: DPI is a fixed hardware property. To minimise performance
|
||||
* overheads we therefore only call video_driver_get_metrics()
|
||||
* overheads we therefore only call video_context_driver_get_metrics()
|
||||
* on first run, or when the current video resolution changes */
|
||||
if (!dpi_cached ||
|
||||
(p_rarch->video_driver_width != last_video_width) ||
|
||||
(p_rarch->video_driver_height != last_video_height))
|
||||
{
|
||||
struct gfx_ctx_metrics metrs;
|
||||
/* Note: If video_driver_get_metrics() fails,
|
||||
/* Note: If video_context_driver_get_metrics() fails,
|
||||
* we don't know what happened to dpi - so ensure it
|
||||
* is reset to a sane value */
|
||||
|
||||
metrs.type = DISPLAY_METRIC_DPI;
|
||||
metrs.value = &dpi;
|
||||
|
||||
if (!video_driver_get_metrics(&metrs))
|
||||
if (!p_rarch->current_video_context.get_metrics(
|
||||
p_rarch->video_context_data,
|
||||
DISPLAY_METRIC_DPI,
|
||||
&dpi))
|
||||
dpi = 0.0f;
|
||||
|
||||
dpi_cached = true;
|
||||
@ -30786,6 +30784,8 @@ bool video_driver_started_fullscreen(void)
|
||||
|
||||
/* Stub functions */
|
||||
|
||||
static bool get_metrics_null(void *data, enum display_metric_types type,
|
||||
float *value) { return false; }
|
||||
static bool set_resize_null(void *a, unsigned b, unsigned c) { return false; }
|
||||
|
||||
/**
|
||||
@ -30889,6 +30889,9 @@ static void video_context_driver_reset(void)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
|
||||
if (!p_rarch->current_video_context.get_metrics)
|
||||
p_rarch->current_video_context.get_metrics = get_metrics_null;
|
||||
|
||||
if (!p_rarch->current_video_context.set_resize)
|
||||
p_rarch->current_video_context.set_resize = set_resize_null;
|
||||
}
|
||||
@ -30916,7 +30919,7 @@ void video_context_driver_destroy(void)
|
||||
p_rarch->current_video_context.get_video_output_size = NULL;
|
||||
p_rarch->current_video_context.get_video_output_prev = NULL;
|
||||
p_rarch->current_video_context.get_video_output_next = NULL;
|
||||
p_rarch->current_video_context.get_metrics = NULL;
|
||||
p_rarch->current_video_context.get_metrics = get_metrics_null;
|
||||
p_rarch->current_video_context.translate_aspect = NULL;
|
||||
p_rarch->current_video_context.update_window_title = NULL;
|
||||
p_rarch->current_video_context.check_window = NULL;
|
||||
@ -33492,12 +33495,10 @@ void video_context_driver_free(void)
|
||||
p_rarch->video_context_data = NULL;
|
||||
}
|
||||
|
||||
bool video_driver_get_metrics(gfx_ctx_metrics_t *metrics)
|
||||
bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics)
|
||||
{
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
if (!p_rarch->video_driver_poke || !p_rarch->video_driver_poke->get_metrics)
|
||||
return false;
|
||||
return p_rarch->video_driver_poke->get_metrics(
|
||||
return p_rarch->current_video_context.get_metrics(
|
||||
p_rarch->video_context_data,
|
||||
metrics->type,
|
||||
metrics->value);
|
||||
|
@ -1380,7 +1380,6 @@ struct aspect_ratio_elem
|
||||
|
||||
typedef struct video_poke_interface
|
||||
{
|
||||
get_metrics_cb get_metrics;
|
||||
uint32_t (*get_flags)(void *data);
|
||||
uintptr_t (*load_texture)(void *video_data, void *data,
|
||||
bool threaded, enum texture_filter_type filter_type);
|
||||
@ -1782,7 +1781,7 @@ bool video_context_driver_get_refresh_rate(float *refresh_rate);
|
||||
|
||||
bool video_context_driver_set_flags(gfx_ctx_flags_t *flags);
|
||||
|
||||
bool video_driver_get_metrics(gfx_ctx_metrics_t *metrics);
|
||||
bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics);
|
||||
|
||||
bool video_context_driver_input_driver(gfx_ctx_input_t *inp);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user