Do white texture freeing outside of gfx_display_init_white_texture

This commit is contained in:
twinaphex 2020-09-24 07:03:24 +02:00
parent a74d24c3ce
commit eb0376fe7d
6 changed files with 39 additions and 6 deletions

View File

@ -1774,9 +1774,6 @@ void gfx_display_init_white_texture(uintptr_t white_texture)
ti.height = 1;
ti.pixels = (uint32_t*)&white_data;
if (gfx_display_white_texture)
video_driver_texture_unload(&white_texture);
video_driver_texture_load(&ti,
TEXTURE_FILTER_NEAREST, &white_texture);
}

View File

@ -7746,6 +7746,9 @@ static void materialui_free(void *data)
video_coord_array_free(&mui->font_data.list.raster_block.carr);
video_coord_array_free(&mui->font_data.hint.raster_block.carr);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
font_driver_bind_block(NULL, NULL);
if (mui->thumbnail_path_data)
@ -7834,6 +7837,8 @@ static bool materialui_load_image(void *userdata, void *data, enum menu_image_ty
materialui_context_bg_destroy(mui);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR, &mui->textures.bg);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
}
@ -8274,6 +8279,8 @@ static void materialui_context_reset(void *data, bool is_threaded)
materialui_layout(mui, is_threaded);
materialui_context_bg_destroy(mui);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
materialui_context_reset_textures(mui);
materialui_context_reset_playlist_icons(mui);

View File

@ -771,8 +771,6 @@ static void ozone_free(void *data)
video_coord_array_free(&ozone->fonts.entries_sublabel.raster_block.carr);
video_coord_array_free(&ozone->fonts.sidebar.raster_block.carr);
font_driver_bind_block(NULL, NULL);
ozone_free_list_nodes(&ozone->selection_buf_old, false);
ozone_free_list_nodes(&ozone->horizontal_list, false);
file_list_deinitialize(&ozone->selection_buf_old);
@ -784,6 +782,12 @@ static void ozone_free(void *data)
if (ozone->thumbnail_path_data)
free(ozone->thumbnail_path_data);
}
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
font_driver_bind_block(NULL, NULL);
gfx_animation_unset_update_time_cb();
}
@ -1167,6 +1171,8 @@ static void ozone_context_reset(void *data, bool is_threaded)
}
}
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
/* Horizontal list */

View File

@ -4789,6 +4789,11 @@ static void rgui_free(void *data)
if (rgui)
{
if (rgui->widgets_supported)
{
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
}
if (rgui->thumbnail_path_data)
free(rgui->thumbnail_path_data);
}
@ -5664,7 +5669,11 @@ static void rgui_context_reset(void *data, bool is_threaded)
#ifdef HAVE_GFX_WIDGETS
if (rgui->widgets_supported)
{
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
}
#endif
video_driver_monitor_reset();
}

View File

@ -3348,7 +3348,7 @@ static void *stripes_init(void **userdata, bool video_is_threaded)
{
unsigned width, height;
int i;
stripes_handle_t *stripes = NULL;
stripes_handle_t *stripes = NULL;
settings_t *settings = config_get_ptr();
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
float scale_value = settings->floats.menu_scale_factor * 100.0f;
@ -3493,6 +3493,9 @@ static void stripes_free(void *data)
free(stripes->bg_file_path);
}
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
font_driver_bind_block(NULL, NULL);
}
@ -3521,6 +3524,8 @@ static bool stripes_load_image(void *userdata, void *data, enum menu_image_type
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR,
&stripes->textures.bg);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
break;
case MENU_IMAGE_THUMBNAIL:
@ -3694,6 +3699,8 @@ static void stripes_context_reset_textures(
for (i = 0; i < STRIPES_TEXTURE_LAST; i++)
gfx_display_reset_textures_list(stripes_texture_path(i), iconpath, &stripes->textures.list[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
stripes->main_menu_node.icon = stripes->textures.list[STRIPES_TEXTURE_MAIN_MENU];

View File

@ -5715,6 +5715,9 @@ static void xmb_free(void *data)
free(xmb->thumbnail_path_data);
}
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
font_driver_bind_block(NULL, NULL);
gfx_animation_unset_update_time_cb();
@ -5741,6 +5744,8 @@ static bool xmb_load_image(void *userdata, void *data,
case MENU_IMAGE_WALLPAPER:
xmb_context_bg_destroy(xmb);
video_driver_texture_unload(&xmb->textures.bg);
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR,
&xmb->textures.bg);
@ -6018,6 +6023,8 @@ static void xmb_context_reset_textures(
xmb->assets_missing = false;
if (gfx_display_white_texture)
video_driver_texture_unload(&gfx_display_white_texture);
gfx_display_init_white_texture(gfx_display_white_texture);
for (i = 0; i < XMB_TEXTURE_LAST; i++)