Call video_driver_set_viewport directly

This commit is contained in:
twinaphex 2020-09-15 11:05:47 +02:00
parent c133c2a10c
commit 3a37e13a54
9 changed files with 15 additions and 29 deletions

View File

@ -1634,16 +1634,6 @@ bool gfx_display_get_update_pending(void)
return false; return false;
} }
void gfx_display_set_viewport(unsigned width, unsigned height)
{
video_driver_set_viewport(width, height, true, false);
}
void gfx_display_unset_viewport(unsigned width, unsigned height)
{
video_driver_set_viewport(width, height, false, true);
}
/* Checks if the display framebuffer has its 'dirty flag' set. This /* Checks if the display framebuffer has its 'dirty flag' set. This
* means that the current contents of the framebuffer has changed * means that the current contents of the framebuffer has changed
* and that it has to be rendered to the screen. */ * and that it has to be rendered to the screen. */

View File

@ -279,8 +279,6 @@ void gfx_display_set_framebuffer_pitch(size_t pitch);
bool gfx_display_get_msg_force(void); bool gfx_display_get_msg_force(void);
void gfx_display_set_msg_force(bool state); void gfx_display_set_msg_force(bool state);
bool gfx_display_get_update_pending(void); bool gfx_display_get_update_pending(void);
void gfx_display_set_viewport(unsigned width, unsigned height);
void gfx_display_unset_viewport(unsigned width, unsigned height);
bool gfx_display_get_framebuffer_dirty_flag(void); bool gfx_display_get_framebuffer_dirty_flag(void);
void gfx_display_set_framebuffer_dirty_flag(void); void gfx_display_set_framebuffer_dirty_flag(void);
void gfx_display_unset_framebuffer_dirty_flag(void); void gfx_display_unset_framebuffer_dirty_flag(void);

View File

@ -1321,7 +1321,7 @@ void gfx_widgets_frame(void *data)
p_dispwidget->gfx_widgets_frame_count++; p_dispwidget->gfx_widgets_frame_count++;
gfx_display_set_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, true, false);
/* Font setup */ /* Font setup */
gfx_widgets_font_bind(&p_dispwidget->gfx_widget_fonts.regular); gfx_widgets_font_bind(&p_dispwidget->gfx_widget_fonts.regular);
@ -1550,7 +1550,7 @@ void gfx_widgets_frame(void *data)
gfx_widgets_font_unbind(&p_dispwidget->gfx_widget_fonts.bold); gfx_widgets_font_unbind(&p_dispwidget->gfx_widget_fonts.bold);
gfx_widgets_font_unbind(&p_dispwidget->gfx_widget_fonts.msg_queue); gfx_widgets_font_unbind(&p_dispwidget->gfx_widget_fonts.msg_queue);
gfx_display_unset_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, false, true);
} }
bool gfx_widgets_init(uintptr_t widgets_active_ptr, bool gfx_widgets_init(uintptr_t widgets_active_ptr,

View File

@ -6585,7 +6585,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
if (!mui) if (!mui)
return; return;
gfx_display_set_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, true, false);
/* Clear text */ /* Clear text */
materialui_font_bind(&mui->font_data.title); materialui_font_bind(&mui->font_data.title);
@ -6796,7 +6796,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
materialui_font_unbind(&mui->font_data.list); materialui_font_unbind(&mui->font_data.list);
materialui_font_unbind(&mui->font_data.hint); materialui_font_unbind(&mui->font_data.hint);
gfx_display_unset_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, false, true);
} }
/* Determines current list view type, based on /* Determines current list view type, based on

View File

@ -2697,7 +2697,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
last_use_preferred_system_color_theme = use_preferred_system_color_theme; last_use_preferred_system_color_theme = use_preferred_system_color_theme;
} }
gfx_display_set_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, true, false);
/* Clear text */ /* Clear text */
ozone_font_bind(&ozone->fonts.footer); ozone_font_bind(&ozone->fonts.footer);
@ -2915,7 +2915,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
ozone_font_unbind(&ozone->fonts.entries_sublabel); ozone_font_unbind(&ozone->fonts.entries_sublabel);
ozone_font_unbind(&ozone->fonts.sidebar); ozone_font_unbind(&ozone->fonts.sidebar);
gfx_display_unset_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, false, true);
} }
static void ozone_set_header(ozone_handle_t *ozone) static void ozone_set_header(ozone_handle_t *ozone)

View File

@ -3082,7 +3082,7 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
video_height); video_height);
} }
gfx_display_unset_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, false, true);
} }
static void stripes_layout_ps3(stripes_handle_t *stripes, int width, int height) static void stripes_layout_ps3(stripes_handle_t *stripes, int width, int height)

View File

@ -4025,7 +4025,7 @@ static void xmb_draw_bg(
draw.pipeline_active = xmb_shader_pipeline_active(menu_shader_pipeline); draw.pipeline_active = xmb_shader_pipeline_active(menu_shader_pipeline);
gfx_display_blend_begin(userdata); gfx_display_blend_begin(userdata);
gfx_display_set_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, true, false);
#ifdef HAVE_SHADERPIPELINE #ifdef HAVE_SHADERPIPELINE
if (menu_shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER if (menu_shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
@ -5231,7 +5231,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
video_height); video_height);
} }
gfx_display_unset_viewport(video_width, video_height); video_driver_set_viewport(video_width, video_height, false, true);
} }
static void xmb_layout_ps3(xmb_handle_t *xmb, int width) static void xmb_layout_ps3(xmb_handle_t *xmb, int width)

View File

@ -32028,16 +32028,14 @@ error:
return false; return false;
} }
bool video_driver_set_viewport(unsigned width, unsigned height, void video_driver_set_viewport(unsigned width, unsigned height,
bool force_fullscreen, bool allow_rotate) bool force_fullscreen, bool allow_rotate)
{ {
struct rarch_state *p_rarch = &rarch_st; struct rarch_state *p_rarch = &rarch_st;
if (!p_rarch->current_video || !p_rarch->current_video->set_viewport) if (p_rarch->current_video && p_rarch->current_video->set_viewport)
return false; p_rarch->current_video->set_viewport(
p_rarch->current_video->set_viewport( p_rarch->video_driver_data, width, height,
p_rarch->video_driver_data, width, height, force_fullscreen, allow_rotate);
force_fullscreen, allow_rotate);
return true;
} }
bool video_driver_set_rotation(unsigned rotation) bool video_driver_set_rotation(unsigned rotation)

View File

@ -1610,7 +1610,7 @@ void video_driver_set_filtering(unsigned index, bool smooth, bool ctx_scaling);
const char *video_driver_get_ident(void); const char *video_driver_get_ident(void);
bool video_driver_set_viewport(unsigned width, unsigned height, void video_driver_set_viewport(unsigned width, unsigned height,
bool force_fullscreen, bool allow_rotate); bool force_fullscreen, bool allow_rotate);
void video_driver_get_size(unsigned *width, unsigned *height); void video_driver_get_size(unsigned *width, unsigned *height);