Remove video_driver_get_size call in gfx/drivers_font
This commit is contained in:
parent
dd2839686b
commit
2f175f1a15
|
@ -115,7 +115,8 @@ static void caca_render_msg(video_frame_info_t *video_info,
|
|||
caca_refresh_display(*font->caca->caca_display);
|
||||
}
|
||||
|
||||
static void caca_font_flush_block(void* data)
|
||||
static void caca_font_flush_block(unsigned width, unsigned height,
|
||||
void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
|
|
@ -438,7 +438,7 @@ static const struct font_glyph* ctr_font_get_glyph(
|
|||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void ctr_font_flush_block(void* data)
|
||||
static void ctr_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ static void gdi_render_msg(
|
|||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
|
||||
static void gdi_font_flush_block(void* data)
|
||||
static void gdi_font_flush_block(unsigned width, unsigned height, void* data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
|
|
@ -518,17 +518,15 @@ static const struct font_glyph *gl_raster_font_get_glyph(
|
|||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void gl_raster_font_flush_block(void *data)
|
||||
static void gl_raster_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
{
|
||||
unsigned width, height;
|
||||
gl_raster_t *font = (gl_raster_t*)data;
|
||||
video_font_raster_block_t *block = font ? font->block : NULL;
|
||||
|
||||
if (!font || !block || !block->carr.coords.vertices)
|
||||
return;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
gl_raster_font_setup_viewport(width, height, font, block->fullscreen);
|
||||
gl_raster_font_draw_vertices(font, (video_coords_t*)&block->carr.coords);
|
||||
gl_raster_font_restore_viewport(width, height, font->gl, block->fullscreen);
|
||||
|
|
|
@ -344,7 +344,8 @@ static const struct font_glyph *vita2d_font_get_glyph(
|
|||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void vita2d_font_flush_block(void *data)
|
||||
static void vita2d_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
|
|
@ -359,7 +359,8 @@ static const struct font_glyph *vulkan_raster_font_get_glyph(
|
|||
return font->font_driver->get_glyph((void*)font->font_driver, code);
|
||||
}
|
||||
|
||||
static void vulkan_raster_font_flush_block(void *data)
|
||||
static void vulkan_raster_font_flush_block(unsigned width, unsigned height,
|
||||
void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
|
|
@ -364,11 +364,11 @@ void font_driver_bind_block(void *font_data, void *block)
|
|||
font->renderer->bind_block(font->renderer_data, block);
|
||||
}
|
||||
|
||||
void font_driver_flush(void *font_data)
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data)
|
||||
{
|
||||
font_data_t *font = (font_data_t*)(font_data ? font_data : video_font_driver);
|
||||
if (font && font->renderer && font->renderer->flush)
|
||||
font->renderer->flush(font->renderer_data);
|
||||
font->renderer->flush(width, height, font->renderer_data);
|
||||
}
|
||||
|
||||
int font_driver_get_message_width(void *font_data,
|
||||
|
|
|
@ -110,7 +110,7 @@ typedef struct font_renderer
|
|||
|
||||
const struct font_glyph *(*get_glyph)(void *data, uint32_t code);
|
||||
void (*bind_block)(void *data, void *block);
|
||||
void (*flush)(void *data);
|
||||
void (*flush)(unsigned width, unsigned height, void *data);
|
||||
|
||||
int (*get_message_width)(void *data, const char *msg, unsigned msg_len_full, float scale);
|
||||
} font_renderer_t;
|
||||
|
@ -151,7 +151,7 @@ void font_driver_bind_block(void *font_data, void *block);
|
|||
|
||||
int font_driver_get_message_width(void *font_data, const char *msg, unsigned len, float scale);
|
||||
|
||||
void font_driver_flush(void *font_data);
|
||||
void font_driver_flush(unsigned width, unsigned height, void *font_data);
|
||||
|
||||
void font_driver_free(void *font_data);
|
||||
|
||||
|
|
|
@ -1300,8 +1300,8 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
|
|||
&active_tab_marker_color[0]
|
||||
);
|
||||
|
||||
menu_display_font_flush_block(mui->font);
|
||||
menu_display_font_flush_block(mui->font2);
|
||||
menu_display_font_flush_block(video_info->width, video_info->height, mui->font);
|
||||
menu_display_font_flush_block(video_info->width, video_info->height, mui->font2);
|
||||
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
|
||||
|
||||
/* header */
|
||||
|
|
|
@ -2839,8 +2839,8 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
|||
width,
|
||||
height);
|
||||
|
||||
menu_display_font_flush_block(xmb->font);
|
||||
menu_display_font_flush_block(xmb->font2);
|
||||
menu_display_font_flush_block(video_info->width, video_info->height, xmb->font);
|
||||
menu_display_font_flush_block(video_info->width, video_info->height, xmb->font2);
|
||||
|
||||
if (xmb->savestate_thumbnail)
|
||||
xmb_draw_thumbnail(menu_disp_info,
|
||||
|
|
|
@ -982,7 +982,8 @@ static void zarch_frame(void *data, video_frame_info_t *video_info)
|
|||
|
||||
zui->rendering = false;
|
||||
|
||||
menu_display_font_flush_block((font_data_t*)zui->font);
|
||||
menu_display_font_flush_block(video_info->width, video_info->height,
|
||||
(font_data_t*)zui->font);
|
||||
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||
}
|
||||
|
||||
|
|
|
@ -240,9 +240,10 @@ void menu_display_font_bind_block(font_data_t *font, void *block)
|
|||
font_driver_bind_block(font, block);
|
||||
}
|
||||
|
||||
bool menu_display_font_flush_block(font_data_t *font)
|
||||
bool menu_display_font_flush_block(unsigned width, unsigned height,
|
||||
font_data_t *font)
|
||||
{
|
||||
font_driver_flush(font);
|
||||
font_driver_flush(width, height, font);
|
||||
font_driver_bind_block(font, NULL);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ void menu_display_blend_end(void);
|
|||
void menu_display_font_free(font_data_t *font);
|
||||
font_data_t *menu_display_font_main_init(menu_display_ctx_font_t *font);
|
||||
void menu_display_font_bind_block(font_data_t *font, void *block);
|
||||
bool menu_display_font_flush_block(font_data_t *font);
|
||||
bool menu_display_font_flush_block(unsigned width, unsigned height, font_data_t *font);
|
||||
|
||||
void menu_display_framebuffer_deinit(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue