mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
wite_texture is now a static global variable inside gfx_display.c
- no longer referenced outside
This commit is contained in:
parent
fe14274b96
commit
490233f3c5
@ -28,9 +28,8 @@
|
||||
* with Ozone driver metrics */
|
||||
#define OZONE_SIDEBAR_WIDTH 408
|
||||
|
||||
/* TODO/FIXME - global that gets referenced outside,
|
||||
* needs to be refactored */
|
||||
uintptr_t gfx_display_white_texture;
|
||||
/* Small 1x1 white texture used for blending purposes */
|
||||
static uintptr_t gfx_white_texture;
|
||||
|
||||
static bool gfx_display_null_font_init_first(
|
||||
void **font_handle, void *video_data,
|
||||
@ -516,7 +515,7 @@ void gfx_display_draw_bg(
|
||||
if (draw->texture)
|
||||
add_opacity_to_wallpaper = true;
|
||||
else
|
||||
draw->texture = gfx_display_white_texture;
|
||||
draw->texture = gfx_white_texture;
|
||||
|
||||
if (add_opacity_to_wallpaper)
|
||||
gfx_display_set_alpha(draw->color, override_opacity);
|
||||
@ -558,7 +557,9 @@ void gfx_display_draw_quad(
|
||||
draw.height = h;
|
||||
draw.coords = &coords;
|
||||
draw.matrix_data = NULL;
|
||||
draw.texture = (texture != 0) ? *texture : gfx_display_white_texture;
|
||||
draw.texture = (texture != 0)
|
||||
? *texture
|
||||
: gfx_white_texture;
|
||||
draw.prim_type = GFX_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
draw.pipeline_id = 0;
|
||||
draw.scale_factor = 1.0f;
|
||||
@ -615,7 +616,7 @@ void gfx_display_draw_polygon(
|
||||
draw.height = height;
|
||||
draw.coords = &coords;
|
||||
draw.matrix_data = NULL;
|
||||
draw.texture = gfx_display_white_texture;
|
||||
draw.texture = gfx_white_texture;
|
||||
draw.prim_type = GFX_DISPLAY_PRIM_TRIANGLESTRIP;
|
||||
draw.pipeline_id = 0;
|
||||
draw.scale_factor = 1.0f;
|
||||
@ -1261,7 +1262,13 @@ void gfx_display_font_free(font_data_t *font)
|
||||
font_driver_free(font);
|
||||
}
|
||||
|
||||
void gfx_display_init_white_texture(uintptr_t white_texture)
|
||||
void gfx_display_deinit_white_texture(void)
|
||||
{
|
||||
if (gfx_white_texture)
|
||||
video_driver_texture_unload(&gfx_white_texture);
|
||||
}
|
||||
|
||||
void gfx_display_init_white_texture(void)
|
||||
{
|
||||
struct texture_image ti;
|
||||
static const uint8_t white_data[] = { 0xff, 0xff, 0xff, 0xff };
|
||||
@ -1271,7 +1278,7 @@ void gfx_display_init_white_texture(uintptr_t white_texture)
|
||||
ti.pixels = (uint32_t*)&white_data;
|
||||
|
||||
video_driver_texture_load(&ti,
|
||||
TEXTURE_FILTER_NEAREST, &gfx_display_white_texture);
|
||||
TEXTURE_FILTER_NEAREST, &gfx_white_texture);
|
||||
}
|
||||
|
||||
void gfx_display_free(void)
|
||||
|
@ -344,15 +344,15 @@ float gfx_display_get_dpi_scale(
|
||||
void *settings_data,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
void gfx_display_init_white_texture(uintptr_t white_texture);
|
||||
void gfx_display_deinit_white_texture(void);
|
||||
|
||||
void gfx_display_init_white_texture(void);
|
||||
|
||||
bool gfx_display_driver_exists(const char *s);
|
||||
|
||||
bool gfx_display_init_first_driver(gfx_display_t *p_disp,
|
||||
bool video_is_threaded);
|
||||
|
||||
extern uintptr_t gfx_display_white_texture;
|
||||
|
||||
extern gfx_display_ctx_driver_t gfx_display_ctx_gl;
|
||||
extern gfx_display_ctx_driver_t gfx_display_ctx_gl_core;
|
||||
extern gfx_display_ctx_driver_t gfx_display_ctx_gl1;
|
||||
|
@ -8056,8 +8056,7 @@ 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);
|
||||
gfx_display_deinit_white_texture();
|
||||
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
|
||||
@ -8077,7 +8076,7 @@ static void materialui_context_bg_destroy(materialui_handle_t *mui)
|
||||
return;
|
||||
|
||||
video_driver_texture_unload(&mui->textures.bg);
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
gfx_display_deinit_white_texture();
|
||||
}
|
||||
|
||||
static void materialui_reset_thumbnails(void)
|
||||
@ -8151,9 +8150,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);
|
||||
gfx_display_deinit_white_texture();
|
||||
gfx_display_init_white_texture();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -8602,9 +8600,8 @@ static void materialui_context_reset(void *data, bool is_threaded)
|
||||
|
||||
materialui_layout(mui, p_disp, settings, 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);
|
||||
gfx_display_deinit_white_texture();
|
||||
gfx_display_init_white_texture();
|
||||
materialui_context_reset_textures(mui);
|
||||
materialui_context_reset_playlist_icons(mui);
|
||||
menu_screensaver_context_destroy(mui->screensaver);
|
||||
|
@ -6914,7 +6914,7 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
gfx_display_set_width(width);
|
||||
gfx_display_set_height(height);
|
||||
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
gfx_display_init_white_texture();
|
||||
|
||||
file_list_initialize(&ozone->horizontal_list);
|
||||
|
||||
@ -7037,8 +7037,7 @@ static void ozone_free(void *data)
|
||||
menu_screensaver_free(ozone->screensaver);
|
||||
}
|
||||
|
||||
if (gfx_display_white_texture)
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
gfx_display_deinit_white_texture();
|
||||
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
@ -7431,9 +7430,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);
|
||||
gfx_display_deinit_white_texture();
|
||||
gfx_display_init_white_texture();
|
||||
|
||||
/* Horizontal list */
|
||||
ozone_context_reset_horizontal_list(ozone);
|
||||
@ -7522,7 +7520,7 @@ static void ozone_context_destroy(void *data)
|
||||
/* Thumbnails */
|
||||
ozone_unload_thumbnail_textures(ozone);
|
||||
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
gfx_display_deinit_white_texture();
|
||||
|
||||
/* Fonts */
|
||||
ozone_font_free(&ozone->fonts.footer);
|
||||
|
@ -5820,7 +5820,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
|
||||
rgui->widgets_supported = gfx_widgets_ready();
|
||||
|
||||
if (rgui->widgets_supported)
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
gfx_display_init_white_texture();
|
||||
#endif
|
||||
|
||||
rgui->menu_title[0] = '\0';
|
||||
@ -5927,10 +5927,7 @@ static void rgui_free(void *data)
|
||||
{
|
||||
#ifdef HAVE_GFX_WIDGETS
|
||||
if (rgui->widgets_supported)
|
||||
{
|
||||
if (gfx_display_white_texture)
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
}
|
||||
gfx_display_deinit_white_texture();
|
||||
#endif
|
||||
if (rgui->thumbnail_path_data)
|
||||
free(rgui->thumbnail_path_data);
|
||||
@ -6882,9 +6879,8 @@ 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);
|
||||
gfx_display_deinit_white_texture();
|
||||
gfx_display_init_white_texture();
|
||||
}
|
||||
#endif
|
||||
video_driver_monitor_reset();
|
||||
@ -6899,7 +6895,7 @@ static void rgui_context_destroy(void *data)
|
||||
|
||||
#ifdef HAVE_GFX_WIDGETS
|
||||
if (rgui->widgets_supported)
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
gfx_display_deinit_white_texture();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -5825,7 +5825,7 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
gfx_display_set_width(width);
|
||||
gfx_display_set_height(height);
|
||||
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
gfx_display_init_white_texture();
|
||||
|
||||
file_list_initialize(&xmb->horizontal_list);
|
||||
|
||||
@ -5901,9 +5901,7 @@ static void xmb_free(void *data)
|
||||
menu_screensaver_free(xmb->screensaver);
|
||||
}
|
||||
|
||||
if (gfx_display_white_texture)
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
|
||||
gfx_display_deinit_white_texture();
|
||||
font_driver_bind_block(NULL, NULL);
|
||||
}
|
||||
|
||||
@ -5912,7 +5910,7 @@ static void xmb_context_bg_destroy(xmb_handle_t *xmb)
|
||||
if (!xmb)
|
||||
return;
|
||||
video_driver_texture_unload(&xmb->textures.bg);
|
||||
video_driver_texture_unload(&gfx_display_white_texture);
|
||||
gfx_display_deinit_white_texture();
|
||||
}
|
||||
|
||||
static bool xmb_load_image(void *userdata, void *data,
|
||||
@ -5928,12 +5926,11 @@ 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);
|
||||
gfx_display_deinit_white_texture();
|
||||
video_driver_texture_load(data,
|
||||
TEXTURE_FILTER_MIPMAP_LINEAR,
|
||||
&xmb->textures.bg);
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
gfx_display_init_white_texture();
|
||||
break;
|
||||
case MENU_IMAGE_NONE:
|
||||
default:
|
||||
@ -6207,9 +6204,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);
|
||||
gfx_display_deinit_white_texture();
|
||||
gfx_display_init_white_texture();
|
||||
|
||||
for (i = 0; i < XMB_TEXTURE_LAST; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user