diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index 9c26231fac..e3a3791c50 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -765,26 +765,24 @@ void gfx_display_draw_blend( gfx_display_blend_end(data); } -void gfx_display_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) +void gfx_display_draw_pipeline( + gfx_display_ctx_draw_t *draw, + void *userdata, + unsigned video_width, + unsigned video_height) { - void *userdata = video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; - if (dispctx && draw && dispctx->draw_pipeline) dispctx->draw_pipeline(draw, userdata, video_width, video_height); } void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info, bool add_opacity_to_wallpaper, + void *userdata, bool add_opacity_to_wallpaper, float override_opacity) { static struct video_coords coords; const float *new_vertex = NULL; const float *new_tex_coord = NULL; - void *userdata = video_info->userdata; if (!dispctx || !draw) return; @@ -820,19 +818,19 @@ void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw, userdata); } -void gfx_display_draw_gradient(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info) +void gfx_display_draw_gradient( + gfx_display_ctx_draw_t *draw, + void *userdata, + unsigned video_width, + unsigned video_height, + float menu_wallpaper_opacity + ) { - void *userdata = video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; - float menu_wallpaper_opacity = video_info->menu_wallpaper_opacity; - draw->texture = 0; draw->x = 0; draw->y = 0; - gfx_display_draw_bg(draw, video_info, false, + gfx_display_draw_bg(draw, userdata, false, menu_wallpaper_opacity); gfx_display_draw(draw, userdata, video_width, video_height); @@ -975,7 +973,9 @@ void gfx_display_draw_texture( * The middle sections will only scale in the X axis, and the side * sections will only scale in the Y axis. */ void gfx_display_draw_texture_slice( - video_frame_info_t *video_info, + void *userdata, + unsigned video_width, + unsigned video_height, int x, int y, unsigned w, unsigned h, unsigned new_w, unsigned new_h, unsigned width, unsigned height, @@ -987,9 +987,6 @@ void gfx_display_draw_texture_slice( math_matrix_4x4 mymat; unsigned i; float V_BL[2], V_BR[2], V_TL[2], V_TR[2], T_BL[2], T_BR[2], T_TL[2], T_TR[2]; - void *userdata = video_info->userdata; - unsigned video_width = video_info->width; - unsigned video_height = video_info->height; /* need space for the coordinates of two triangles in a strip, * so 8 vertices */ diff --git a/gfx/gfx_display.h b/gfx/gfx_display.h index 3c0a27b6f1..3a33a9a039 100644 --- a/gfx/gfx_display.h +++ b/gfx/gfx_display.h @@ -284,15 +284,24 @@ void gfx_display_draw_keyboard( char *grid[], unsigned id, unsigned text_color); -void gfx_display_draw_pipeline(gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info); +void gfx_display_draw_pipeline( + gfx_display_ctx_draw_t *draw, + void *userdata, + unsigned video_width, + unsigned video_height); + void gfx_display_draw_bg( gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info, + void *userdata, bool add_opacity, float opacity_override); + void gfx_display_draw_gradient( gfx_display_ctx_draw_t *draw, - video_frame_info_t *video_info); + void *userdata, + unsigned video_width, + unsigned video_height, + float menu_wallpaper_opacity + ); void gfx_display_draw_quad( void *data, @@ -318,10 +327,14 @@ void gfx_display_draw_texture( int x, int y, unsigned w, unsigned h, unsigned width, unsigned height, float *color, uintptr_t texture); + void gfx_display_draw_texture_slice( - video_frame_info_t *video_info, + void *userdata, + unsigned video_width, + unsigned video_height, int x, int y, unsigned w, unsigned h, - unsigned new_w, unsigned new_h, unsigned width, unsigned height, + unsigned new_w, unsigned new_h, + unsigned width, unsigned height, float *color, unsigned offset, float scale_factor, uintptr_t texture); void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw, void *data); diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index c8b6a2a2ab..66cd8788be 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -3555,7 +3555,8 @@ static void materialui_render_background(materialui_handle_t *mui, video_frame_i /* Draw background */ gfx_display_blend_begin(video_info->userdata); - gfx_display_draw_bg(&draw, video_info, add_opacity, opacity_override); + gfx_display_draw_bg(&draw, video_info->userdata, + add_opacity, opacity_override); gfx_display_draw(&draw, video_info->userdata, video_info->width, video_info->height); gfx_display_blend_end(video_info->userdata); diff --git a/menu/drivers/ozone/ozone_display.c b/menu/drivers/ozone/ozone_display.c index 20d212b590..784e685244 100644 --- a/menu/drivers/ozone/ozone_display.c +++ b/menu/drivers/ozone/ozone_display.c @@ -132,7 +132,9 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone, /* Cursor without border */ gfx_display_draw_texture_slice( - video_info, + video_info->userdata, + video_info->width, + video_info->height, slice_x, slice_y, 80, 80, @@ -146,7 +148,9 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone, /* Tainted border */ gfx_display_draw_texture_slice( - video_info, + video_info->userdata, + video_info->width, + video_info->height, slice_x, slice_y, 80, 80, @@ -530,17 +534,19 @@ void ozone_draw_messagebox(ozone_handle_t *ozone, unsigned slice_new_h = ozone->footer_font_glyph_height * (list->size + 2); gfx_display_draw_texture_slice( - video_info, - slice_x, - y, - 256, 256, - slice_new_w, - slice_new_h, - width, height, - ozone->theme_dynamic.message_background, - 16, scale_factor, - ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_DIALOG_SLICE] - ); + video_info->userdata, + video_info->width, + video_info->height, + slice_x, + y, + 256, 256, + slice_new_w, + slice_new_h, + width, height, + ozone->theme_dynamic.message_background, + 16, scale_factor, + ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_DIALOG_SLICE] + ); } for (i = 0; i < list->size; i++) diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 247de97dac..0716251238 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -827,7 +827,9 @@ static void stripes_render_messagebox_internal( gfx_display_blend_begin(video_info->userdata); gfx_display_draw_texture_slice( - video_info, + video_info->userdata, + video_info->width, + video_info->height, x - longest_width/2 - stripes->margins_dialog, y + stripes->margins_slice - stripes->margins_dialog, 256, 256, diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 50b8f07dd2..3fcee71cc5 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -922,7 +922,9 @@ static void xmb_render_messagebox_internal( gfx_display_blend_begin(video_info->userdata); gfx_display_draw_texture_slice( - video_info, + video_info->userdata, + video_info->width, + video_info->height, x - longest_width/2 - xmb->margins_dialog, y + xmb->margins_slice - xmb->margins_dialog, 256, 256, @@ -3656,7 +3658,12 @@ static void xmb_draw_bg( else gfx_display_set_alpha(draw.color, coord_white[3]); - gfx_display_draw_gradient(&draw, video_info); + gfx_display_draw_gradient(&draw, + video_info->userdata, + video_info->width, + video_info->height, + video_info->menu_wallpaper_opacity + ); draw.pipeline.id = VIDEO_SHADER_MENU_2; @@ -3681,7 +3688,10 @@ static void xmb_draw_bg( break; } - gfx_display_draw_pipeline(&draw, video_info); + gfx_display_draw_pipeline(&draw, + video_info->userdata, + video_info->width, + video_info->height); } else #endif @@ -3697,7 +3707,11 @@ static void xmb_draw_bg( gfx_display_set_alpha(draw.color, coord_white[3]); if (xmb_color_theme != XMB_THEME_WALLPAPER) - gfx_display_draw_gradient(&draw, video_info); + gfx_display_draw_gradient(&draw, + video_info->userdata, + video_info->width, + video_info->height, + video_info->menu_wallpaper_opacity); { bool add_opacity = false; @@ -3711,7 +3725,8 @@ static void xmb_draw_bg( if (libretro_running || xmb_color_theme == XMB_THEME_WALLPAPER) add_opacity = true; - gfx_display_draw_bg(&draw, video_info, add_opacity, menu_wallpaper_opacity); + gfx_display_draw_bg(&draw, video_info->userdata, + add_opacity, menu_wallpaper_opacity); } }