gfx_display - Get rid of lots of pointer grabbing

This commit is contained in:
twinaphex 2021-03-25 20:12:34 +01:00
parent 8064af8f15
commit cd9d6c0511
20 changed files with 350 additions and 208 deletions

View File

@ -408,12 +408,13 @@ float gfx_display_get_dpi_scale(
}
/* Begin scissoring operation */
void gfx_display_scissor_begin(void *userdata,
void gfx_display_scissor_begin(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
int x, int y, unsigned width, unsigned height)
{
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (dispctx && dispctx->scissor_begin)
{
@ -455,11 +456,11 @@ void gfx_display_scissor_begin(void *userdata,
}
font_data_t *gfx_display_font_file(
gfx_display_t *p_disp,
char* fontpath, float menu_font_size, bool is_threaded)
{
font_data_t *font_data = NULL;
float font_size = menu_font_size;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (!dispctx)
@ -479,14 +480,15 @@ font_data_t *gfx_display_font_file(
return font_data;
}
void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw,
void gfx_display_draw_bg(
gfx_display_t *p_disp,
gfx_display_ctx_draw_t *draw,
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;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (!dispctx || !draw)
return;
@ -525,6 +527,7 @@ void gfx_display_draw_bg(gfx_display_ctx_draw_t *draw,
}
void gfx_display_draw_quad(
gfx_display_t *p_disp,
void *data,
unsigned video_width,
unsigned video_height,
@ -534,8 +537,6 @@ void gfx_display_draw_quad(
{
gfx_display_ctx_draw_t draw;
struct video_coords coords;
gfx_display_t
*p_disp = disp_get_ptr();
gfx_display_ctx_driver_t
*dispctx = p_disp->dispctx;
@ -571,6 +572,7 @@ void gfx_display_draw_quad(
}
void gfx_display_draw_polygon(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -584,7 +586,6 @@ void gfx_display_draw_polygon(
float vertex[8];
gfx_display_ctx_draw_t draw;
struct video_coords coords;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (width == 0 || height == 0)
@ -659,6 +660,7 @@ static 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(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -671,8 +673,6 @@ void gfx_display_draw_texture_slice(
gfx_display_ctx_rotate_draw_t rotate_draw;
struct video_coords coords;
math_matrix_4x4 mymat;
gfx_display_t
*p_disp = disp_get_ptr();
gfx_display_ctx_driver_t
*dispctx = p_disp->dispctx;
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];
@ -788,7 +788,7 @@ void gfx_display_draw_texture_slice(
draw.pipeline_id = 0;
coords.color = (const float*)(color == NULL ? colors : color);
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
draw.texture = texture;
draw.x = 0;
@ -990,11 +990,11 @@ void gfx_display_draw_texture_slice(
dispctx->draw(&draw, userdata, video_width, video_height);
}
void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw, void *data)
void gfx_display_rotate_z(gfx_display_t *p_disp,
gfx_display_ctx_rotate_draw_t *draw, void *data)
{
math_matrix_4x4 matrix_rotated, matrix_scaled;
math_matrix_4x4 *b = NULL;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (
@ -1025,6 +1025,7 @@ void gfx_display_rotate_z(gfx_display_ctx_rotate_draw_t *draw, void *data)
* Draw a hardware cursor on top of the screen for the mouse.
*/
void gfx_display_draw_cursor(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -1034,7 +1035,6 @@ void gfx_display_draw_cursor(
{
gfx_display_ctx_draw_t draw;
struct video_coords coords;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (!dispctx)
@ -1064,66 +1064,22 @@ void gfx_display_draw_cursor(
dispctx->blend_end(userdata);
}
void gfx_display_push_quad(
unsigned width, unsigned height,
const float *colors, int x1, int y1,
int x2, int y2)
{
float vertex[8];
video_coords_t coords;
const float *coord_draw_ptr = NULL;
gfx_display_t *p_disp = disp_get_ptr();
video_coord_array_t *p_dispca = &p_disp->dispca;
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
vertex[0] = x1 / (float)width;
vertex[1] = y1 / (float)height;
vertex[2] = x2 / (float)width;
vertex[3] = y1 / (float)height;
vertex[4] = x1 / (float)width;
vertex[5] = y2 / (float)height;
vertex[6] = x2 / (float)width;
vertex[7] = y2 / (float)height;
if (dispctx && dispctx->get_default_tex_coords)
coord_draw_ptr = dispctx->get_default_tex_coords();
coords.color = colors;
coords.vertex = vertex;
coords.tex_coord = coord_draw_ptr;
coords.lut_tex_coord = coord_draw_ptr;
coords.vertices = 3;
video_coord_array_append(p_dispca, &coords, 3);
coords.color += 4;
coords.vertex += 2;
coords.tex_coord += 2;
coords.lut_tex_coord += 2;
video_coord_array_append(p_dispca, &coords, 3);
}
/* Setup: Initializes the font associated
* to the menu driver */
font_data_t *gfx_display_font(
gfx_display_t *p_disp,
enum application_special_type type,
float menu_font_size,
bool is_threaded)
{
char fontpath[PATH_MAX_LENGTH];
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
if (!dispctx)
return NULL;
fontpath[0] = '\0';
fill_pathname_application_special(
fontpath, sizeof(fontpath), type);
return gfx_display_font_file(fontpath, menu_font_size, is_threaded);
return gfx_display_font_file(p_disp, fontpath, menu_font_size, is_threaded);
}
/* Returns the OSK key at a given position */
@ -1188,6 +1144,7 @@ void gfx_display_set_msg_force(bool state)
}
void gfx_display_draw_keyboard(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -1198,7 +1155,6 @@ void gfx_display_draw_keyboard(
{
unsigned i;
int ptr_width, ptr_height;
gfx_display_t *p_disp = disp_get_ptr();
gfx_display_ctx_driver_t *dispctx = p_disp->dispctx;
static float white[16] = {
@ -1231,6 +1187,7 @@ void gfx_display_draw_keyboard(
coords.color = (const float*)&white[0];
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -1248,7 +1205,7 @@ void gfx_display_draw_keyboard(
if (ptr_width >= ptr_height)
ptr_width = ptr_height;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
draw.coords = &coords;
draw.matrix_data = &mymat;
@ -1391,10 +1348,10 @@ bool gfx_display_driver_exists(const char *s)
return false;
}
bool gfx_display_init_first_driver(bool video_is_threaded)
bool gfx_display_init_first_driver(gfx_display_t *p_disp,
bool video_is_threaded)
{
unsigned i;
gfx_display_t *p_disp = disp_get_ptr();
for (i = 0; gfx_display_ctx_drivers[i]; i++)
{

View File

@ -227,12 +227,8 @@ void gfx_display_free(void);
void gfx_display_init(void);
void gfx_display_push_quad(
unsigned width, unsigned height,
const float *colors, int x1, int y1,
int x2, int y2);
void gfx_display_draw_cursor(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -248,11 +244,17 @@ void gfx_display_draw_text(
bool draw_outside);
font_data_t *gfx_display_font(
gfx_display_t *p_disp,
enum application_special_type type,
float font_size,
bool video_is_threaded);
void gfx_display_scissor_begin(void *data, unsigned video_width, unsigned video_height, int x, int y, unsigned width, unsigned height);
void gfx_display_scissor_begin(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
int x, int y, unsigned width, unsigned height);
void gfx_display_font_free(font_data_t *font);
@ -263,11 +265,13 @@ void gfx_display_set_height(unsigned height);
void gfx_display_set_framebuffer_pitch(size_t pitch);
void gfx_display_set_msg_force(bool state);
bool gfx_display_init_first_driver(bool video_is_threaded);
bool gfx_display_init_first_driver(gfx_display_t *p_disp,
bool video_is_threaded);
gfx_display_t *disp_get_ptr(void);
void gfx_display_draw_keyboard(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -277,11 +281,13 @@ void gfx_display_draw_keyboard(
unsigned text_color);
void gfx_display_draw_bg(
gfx_display_t *p_disp,
gfx_display_ctx_draw_t *draw,
void *userdata,
bool add_opacity, float opacity_override);
void gfx_display_draw_quad(
gfx_display_t *p_disp,
void *data,
unsigned video_width,
unsigned video_height,
@ -290,6 +296,7 @@ void gfx_display_draw_quad(
float *color);
void gfx_display_draw_polygon(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -301,6 +308,7 @@ void gfx_display_draw_polygon(
float *color);
void gfx_display_draw_texture_slice(
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -309,9 +317,11 @@ void gfx_display_draw_texture_slice(
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);
void gfx_display_rotate_z(gfx_display_t *p_disp,
gfx_display_ctx_rotate_draw_t *draw, void *data);
font_data_t *gfx_display_font_file(char* fontpath, float font_size, bool is_threaded);
font_data_t *gfx_display_font_file(gfx_display_t *p_disp,
char* fontpath, float font_size, bool is_threaded);
bool gfx_display_reset_textures_list(
const char *texture_path, const char *iconpath,
@ -337,7 +347,8 @@ void gfx_display_init_white_texture(uintptr_t white_texture);
bool gfx_display_driver_exists(const char *s);
bool gfx_display_init_first_driver(bool video_is_threaded);
bool gfx_display_init_first_driver(gfx_display_t *p_disp,
bool video_is_threaded);
extern uintptr_t gfx_display_white_texture;

View File

@ -738,7 +738,7 @@ void gfx_thumbnail_draw(
rotate_draw.scale_z = 1.0f;
rotate_draw.scale_enable = false;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
/* Configure draw object
* > Note: Colour, width/height and position must

View File

@ -680,7 +680,7 @@ void gfx_widgets_draw_icon(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
coords.vertices = 4;
coords.vertex = NULL;
@ -732,7 +732,7 @@ static void gfx_widgets_draw_icon_blend(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
coords.vertices = 4;
coords.vertex = NULL;
@ -866,6 +866,7 @@ static void gfx_widgets_hourglass_tick(void *userdata)
}
static void gfx_widgets_font_init(
gfx_display_t *p_disp,
dispgfx_widget_t *p_dispwidget,
gfx_widget_font_data_t *font_data,
bool is_threaded, char *font_path, float font_size)
@ -885,7 +886,8 @@ static void gfx_widgets_font_init(
font_data->glyph_width = scaled_size * (3.0f / 4.0f);
/* Create font */
font_data->font = gfx_display_font_file(font_path, scaled_size, is_threaded);
font_data->font = gfx_display_font_file(p_disp,
font_path, scaled_size, is_threaded);
/* Get font metadata */
glyph_width = font_driver_get_message_width(font_data->font, "a", 1, 1.0f);
@ -901,6 +903,7 @@ static void gfx_widgets_font_init(
static void gfx_widgets_layout(
gfx_display_t *p_disp,
dispgfx_widget_t *p_dispwidget,
bool is_threaded, const char *dir_assets, char *font_path)
{
@ -920,32 +923,32 @@ static void gfx_widgets_layout(
/* Create regular font */
fill_pathname_join(font_file, ozone_path, "regular.ttf", sizeof(font_file));
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.regular,
is_threaded, font_file, BASE_FONT_SIZE);
/* Create bold font */
fill_pathname_join(font_file, ozone_path, "bold.ttf", sizeof(font_file));
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.bold,
is_threaded, font_file, BASE_FONT_SIZE);
/* Create msg_queue font */
fill_pathname_join(font_file, ozone_path, "regular.ttf", sizeof(font_file));
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.msg_queue,
is_threaded, font_file, MSG_QUEUE_FONT_SIZE);
}
else
{
/* Load fonts from user-supplied path */
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.regular,
is_threaded, font_path, BASE_FONT_SIZE);
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.bold,
is_threaded, font_path, BASE_FONT_SIZE);
gfx_widgets_font_init(p_dispwidget,
gfx_widgets_font_init(p_disp, p_dispwidget,
&p_dispwidget->gfx_widget_fonts.msg_queue,
is_threaded, font_path, MSG_QUEUE_FONT_SIZE);
}
@ -1048,7 +1051,7 @@ void gfx_widgets_iterate(
/* Note: We don't need a full context reset here
* > Just rescale layout, and reset frame time counter */
gfx_widgets_layout(p_dispwidget,
gfx_widgets_layout(p_disp, p_dispwidget,
is_threaded, dir_assets, font_path);
video_driver_monitor_reset();
}
@ -1165,12 +1168,14 @@ static int gfx_widgets_draw_indicator(
unsigned height = p_dispwidget->simple_widget_height * 2;
width = height;
gfx_display_draw_quad(userdata,
video_width, video_height,
top_right_x_advance - width, y,
width, height,
video_width, video_height,
p_dispwidget->backdrop_orig
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
top_right_x_advance - width, y,
width, height,
video_width, video_height,
p_dispwidget->backdrop_orig
);
gfx_display_set_alpha(p_dispwidget->pure_white, 1.0f);
@ -1199,7 +1204,9 @@ static int gfx_widgets_draw_indicator(
txt,
(unsigned)strlen(txt), 1) + p_dispwidget->simple_widget_padding * 2;
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
top_right_x_advance - width, y,
width, height,
@ -1295,7 +1302,9 @@ static void gfx_widgets_draw_task_msg(
rect_height = p_dispwidget->msg_queue_height / 2;
gfx_display_set_alpha(msg_queue_current_background, msg->alpha);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
rect_x, rect_y,
rect_width, rect_height,
@ -1312,7 +1321,9 @@ static void gfx_widgets_draw_task_msg(
msg_queue_current_bar = msg_queue_task_progress_2;
gfx_display_set_alpha(msg_queue_current_bar, 1.0f);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
p_dispwidget->msg_queue_task_rect_start_x, video_height - msg->offset_y,
bar_width, rect_height,
@ -1355,7 +1366,8 @@ static void gfx_widgets_draw_task_msg(
gfx_widgets_flush_text(video_width, video_height,
&p_dispwidget->gfx_widget_fonts.msg_queue);
gfx_display_scissor_begin(userdata,
gfx_display_scissor_begin(p_disp,
userdata,
video_width, video_height,
rect_x, rect_y, rect_width, rect_height);
@ -1437,7 +1449,8 @@ static void gfx_widgets_draw_regular_msg(
gfx_widgets_flush_text(video_width, video_height,
&p_dispwidget->gfx_widget_fonts.msg_queue);
gfx_display_scissor_begin(userdata,
gfx_display_scissor_begin(p_disp,
userdata,
video_width, video_height,
p_dispwidget->msg_queue_scissor_start_x, 0,
(p_dispwidget->msg_queue_scissor_start_x + msg->width -
@ -1471,6 +1484,7 @@ static void gfx_widgets_draw_regular_msg(
bar_width = p_dispwidget->simple_widget_padding + msg->width;
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -1625,7 +1639,9 @@ void gfx_widgets_frame(void *data)
);
/* top line */
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
0, 0,
video_width,
@ -1635,7 +1651,9 @@ void gfx_widgets_frame(void *data)
outline_color
);
/* bottom line */
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
0,
video_height - p_dispwidget->divider_width_1px,
@ -1646,7 +1664,9 @@ void gfx_widgets_frame(void *data)
outline_color
);
/* left line */
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
0,
@ -1658,7 +1678,9 @@ void gfx_widgets_frame(void *data)
outline_color
);
/* right line */
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
video_width - p_dispwidget->divider_width_1px,
0,
@ -1700,7 +1722,9 @@ void gfx_widgets_frame(void *data)
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
top_right_x_advance - total_width, 0,
@ -2040,7 +2064,7 @@ static void gfx_widgets_context_reset(
p_dispwidget->last_video_height,
fullscreen);
gfx_widgets_layout(p_dispwidget,
gfx_widgets_layout(p_disp, p_dispwidget,
is_threaded, dir_assets, font_path);
video_driver_monitor_reset();
}
@ -2061,7 +2085,7 @@ bool gfx_widgets_init(
p_dispwidget->divider_width_1px = 1;
p_dispwidget->gfx_widgets_generic_tag = (uintptr_t)widgets_active_ptr;
if (!gfx_display_init_first_driver(video_is_threaded))
if (!gfx_display_init_first_driver(p_disp, video_is_threaded))
goto error;
gfx_display_set_alpha(p_dispwidget->backdrop_orig, 0.75f);
for (i = 0; i < 16; i++)

View File

@ -134,13 +134,15 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata)
if (!state->queue[state->queue_read_index].badge)
{
/* Backdrop */
gfx_display_draw_quad(video_info->userdata,
video_width, video_height,
0, (int)state->y,
state->height,
state->height,
video_width, video_height,
p_dispwidget->backdrop_orig);
gfx_display_draw_quad(
p_disp,
video_info->userdata,
video_width, video_height,
0, (int)state->y,
state->height,
state->height,
video_width, video_height,
p_dispwidget->backdrop_orig);
/* Icon */
if (p_dispwidget->gfx_widgets_icons_textures[MENU_WIDGETS_ICON_ACHIEVEMENT])
@ -184,26 +186,29 @@ static void gfx_widget_achievement_popup_frame(void* data, void* userdata)
/* I _think_ state->unfold changes in another thread */
scissor_me_timbers = (fabs(state->unfold - 1.0f) > 0.01);
if (scissor_me_timbers)
gfx_display_scissor_begin(video_info->userdata,
video_width,
video_height,
state->height,
0,
(unsigned)((float)(state->width) * state->unfold),
state->height);
gfx_display_scissor_begin(
p_disp,
video_info->userdata,
video_width,
video_height,
state->height,
0,
(unsigned)((float)(state->width) * state->unfold),
state->height);
/* Backdrop */
gfx_display_draw_quad(
video_info->userdata,
video_width,
video_height,
state->height,
(int)state->y,
state->width,
state->height,
video_width,
video_height,
p_dispwidget->backdrop_orig);
p_disp,
video_info->userdata,
video_width,
video_height,
state->height,
(int)state->y,
state->width,
state->height,
video_width,
video_height,
p_dispwidget->backdrop_orig);
/* Title */
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,

View File

@ -406,6 +406,7 @@ static void gfx_widget_generic_message_iterate(void *user_data,
static void gfx_widget_generic_message_frame(void *data, void *user_data)
{
gfx_display_t *p_disp = disp_get_ptr();
gfx_widget_generic_message_state_t *state = &p_w_generic_message_st;
if (state->status != GFX_WIDGET_GENERIC_MESSAGE_IDLE)
@ -463,6 +464,7 @@ static void gfx_widget_generic_message_frame(void *data, void *user_data)
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -478,6 +480,7 @@ static void gfx_widget_generic_message_frame(void *data, void *user_data)
/* > Top */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -491,6 +494,7 @@ static void gfx_widget_generic_message_frame(void *data, void *user_data)
/* > Left */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -504,6 +508,7 @@ static void gfx_widget_generic_message_frame(void *data, void *user_data)
/* > Right */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -77,6 +77,7 @@ static void gfx_widget_leaderboard_display_context_destroy(void)
static void gfx_widget_leaderboard_display_frame(void* data, void* userdata)
{
gfx_display_t *p_disp = disp_get_ptr();
gfx_widget_leaderboard_display_state_t *state = &p_w_leaderboard_display_st;
/* if there's nothing to display, just bail */
@ -111,11 +112,13 @@ static void gfx_widget_leaderboard_display_frame(void* data, void* userdata)
y -= (widget_height + spacing);
/* Backdrop */
gfx_display_draw_quad(video_info->userdata,
video_width, video_height,
(int)x, (int)y, widget_width, widget_height,
video_width, video_height,
p_dispwidget->backdrop_orig);
gfx_display_draw_quad(
p_disp,
video_info->userdata,
video_width, video_height,
(int)x, (int)y, widget_width, widget_height,
video_width, video_height,
p_dispwidget->backdrop_orig);
/* Text */
gfx_widgets_draw_text(&p_dispwidget->gfx_widget_fonts.regular,

View File

@ -334,6 +334,7 @@ static void gfx_widget_libretro_message_iterate(void *user_data,
static void gfx_widget_libretro_message_frame(void *data, void *user_data)
{
gfx_display_t *p_disp = disp_get_ptr();
gfx_widget_libretro_message_state_t *state = &p_w_libretro_message_st;
if (state->status != GFX_WIDGET_LIBRETRO_MESSAGE_IDLE)
@ -401,6 +402,7 @@ static void gfx_widget_libretro_message_frame(void *data, void *user_data)
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -414,6 +416,7 @@ static void gfx_widget_libretro_message_frame(void *data, void *user_data)
/* Frame */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -426,6 +429,7 @@ static void gfx_widget_libretro_message_frame(void *data, void *user_data)
state->frame_color);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -731,6 +731,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
/* > Background underlay */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -744,6 +745,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
/* > Background shadow */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -756,6 +758,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
state->bg_shadow_top_color);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -769,6 +772,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
/* > Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -812,6 +816,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
* (otherwise layout will look terrible...) */
else
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -895,6 +900,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
/* > Left */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -908,6 +914,7 @@ static void gfx_widget_load_content_animation_frame(void *data, void *user_data)
/* > Right */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -217,6 +217,7 @@ static void gfx_widget_progress_message_layout(
static void gfx_widget_progress_message_frame(void *data, void *user_data)
{
gfx_display_t *p_disp = disp_get_ptr();
gfx_widget_progress_message_state_t *state = &p_w_progress_message_st;
if (state->active)
@ -240,6 +241,7 @@ static void gfx_widget_progress_message_frame(void *data, void *user_data)
gfx_display_set_alpha(backdrop_color, state->alpha * DEFAULT_BACKDROP);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -255,6 +257,7 @@ static void gfx_widget_progress_message_frame(void *data, void *user_data)
gfx_display_set_alpha(state->bar_bg_color, state->alpha);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -279,6 +282,7 @@ static void gfx_widget_progress_message_frame(void *data, void *user_data)
gfx_display_set_alpha(bar_color, state->alpha);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -217,7 +217,9 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data)
gfx_display_set_alpha(p_dispwidget->backdrop_orig, DEFAULT_BACKDROP);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width, video_height,
0, state->y,
state->width, state->height,
@ -269,7 +271,9 @@ static void gfx_widget_screenshot_frame(void* data, void *user_data)
if (state->alpha > 0.0f)
{
gfx_display_set_alpha(pure_white, state->alpha);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
0, 0,

View File

@ -170,16 +170,18 @@ static void gfx_widget_volume_frame(void* data, void *user_data)
/* Backdrop */
gfx_display_set_alpha(backdrop_orig, state->alpha);
gfx_display_draw_quad(userdata,
video_width,
video_height,
0, 0,
state->widget_width,
state->widget_height,
video_width,
video_height,
backdrop_orig
);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
0, 0,
state->widget_width,
state->widget_height,
video_width,
video_height,
backdrop_orig
);
/* Icon */
if (volume_icon)
@ -223,7 +225,9 @@ static void gfx_widget_volume_frame(void* data, void *user_data)
gfx_display_set_alpha(bar_background, state->text_alpha);
gfx_display_set_alpha(bar_foreground, state->text_alpha);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
bar_x + bar_percentage * bar_width, bar_y,
@ -232,7 +236,9 @@ static void gfx_widget_volume_frame(void* data, void *user_data)
bar_background
);
gfx_display_draw_quad(userdata,
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
bar_x, bar_y,

View File

@ -2327,7 +2327,7 @@ static void materialui_draw_icon(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
coords.vertices = 4;
coords.vertex = NULL;
@ -2404,6 +2404,7 @@ static void materialui_draw_thumbnail(
mui->colors.thumbnail_background, alpha);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -2460,6 +2461,7 @@ static void materialui_draw_thumbnail(
/* > Draw background quad */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -2502,7 +2504,9 @@ static void materialui_get_message(void *data, const char *message)
strlcpy(mui->msgbox, message, sizeof(mui->msgbox));
}
static void materialui_render_messagebox(materialui_handle_t *mui,
static void materialui_render_messagebox(
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -2571,6 +2575,7 @@ static void materialui_render_messagebox(materialui_handle_t *mui,
mui->colors.surface_background, mui->transition_alpha);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4365,6 +4370,7 @@ static void materialui_render_menu_entry_playlist_list(
if (draw_divider)
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4521,6 +4527,7 @@ static void materialui_render_menu_entry_playlist_dual_icon(
/* Draw divider */
if (draw_divider)
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4548,6 +4555,7 @@ static void materialui_render_menu_entry_playlist_desktop(
int x_offset)
{
const char *entry_label = NULL;
gfx_display_t *p_disp = disp_get_ptr();
int entry_x = x_offset + node->x;
int entry_y = header_height - mui->scroll_y + node->y;
int divider_y = entry_y + (int)node->entry_height;
@ -4618,6 +4626,7 @@ static void materialui_render_menu_entry_playlist_desktop(
/* Draw divider */
if (draw_divider)
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4688,6 +4697,7 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
/* Draw sidebar background
* > Surface */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4701,6 +4711,7 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
/* > Divider */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4715,6 +4726,7 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
/* > Additional divider */
if (mui->landscape_optimization.enabled)
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4798,6 +4810,7 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
/* Background
* > Surface */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4813,6 +4826,7 @@ static void materialui_render_selected_entry_aux_playlist_desktop(
* (For symmetry, header and status bar
* shadows have the same height) */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4897,7 +4911,9 @@ static void (*materialui_render_selected_entry_aux)(
* ============================== */
static void materialui_render_scrollbar(
materialui_handle_t *mui, void *userdata,
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width, unsigned video_height)
{
/* Do nothing if scrollbar is disabled */
@ -4906,6 +4922,7 @@ static void materialui_render_scrollbar(
/* Draw scrollbar */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4995,7 +5012,7 @@ static void materialui_render_menu_list(
/* Draw scrollbar */
materialui_render_scrollbar(
mui, userdata,
mui, p_disp, userdata,
video_width, video_height);
}
@ -5085,7 +5102,7 @@ static void materialui_render_background(
{
if (dispctx->blend_begin)
dispctx->blend_begin(userdata);
gfx_display_draw_bg(&draw, userdata,
gfx_display_draw_bg(p_disp, &draw, userdata,
add_opacity, opacity_override);
if (dispctx->draw)
if (draw.height > 0 && draw.width > 0)
@ -5097,6 +5114,7 @@ static void materialui_render_background(
static void materialui_render_landscape_border(
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -5113,6 +5131,7 @@ static void materialui_render_landscape_border(
/* Draw left border */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5126,6 +5145,7 @@ static void materialui_render_landscape_border(
/* Draw right border */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5140,7 +5160,9 @@ static void materialui_render_landscape_border(
}
static void materialui_render_selection_highlight(
materialui_handle_t *mui, void *userdata,
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width, unsigned video_height,
unsigned header_height, int x_offset,
size_t selection, float *highlight_color,
@ -5149,14 +5171,12 @@ static void materialui_render_selection_highlight(
/* Only draw highlight if selection is onscreen */
if (materialui_entry_onscreen(mui, selection))
{
file_list_t *list = NULL;
materialui_node_t *node = NULL;
int highlight_x;
int highlight_y;
int highlight_width;
int highlight_height;
list = menu_entries_get_selection_buf_ptr(0);
materialui_node_t *node = NULL;
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
if (!list)
return;
@ -5177,6 +5197,7 @@ static void materialui_render_selection_highlight(
/* Draw highlight quad */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5192,6 +5213,7 @@ static void materialui_render_selection_highlight(
if (mui->show_selection_marker_shadow)
{
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5204,6 +5226,7 @@ static void materialui_render_selection_highlight(
shadow_top_colour);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5221,6 +5244,7 @@ static void materialui_render_selection_highlight(
static void materialui_render_entry_touch_feedback(
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width, unsigned video_height,
unsigned header_height, int x_offset,
@ -5307,7 +5331,7 @@ static void materialui_render_entry_touch_feedback(
/* Draw highlight */
materialui_render_selection_highlight(
mui, userdata, video_width, video_height,
mui, p_disp, userdata, video_width, video_height,
header_height, x_offset,
mui->touch_feedback_selection,
higlight_color,
@ -5350,6 +5374,7 @@ static void materialui_render_header(
/* > Shadow */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5363,6 +5388,7 @@ static void materialui_render_header(
/* > Title bar background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5376,6 +5402,7 @@ static void materialui_render_header(
/* > System bar background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5752,6 +5779,7 @@ static void materialui_render_nav_bar_bottom(
/* > Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5765,6 +5793,7 @@ static void materialui_render_nav_bar_bottom(
/* > Divider */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5828,6 +5857,7 @@ static void materialui_render_nav_bar_bottom(
/* Draw selection marker */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5864,6 +5894,7 @@ static void materialui_render_nav_bar_right(
/* > Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5877,6 +5908,7 @@ static void materialui_render_nav_bar_right(
/* > Divider */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -5940,6 +5972,7 @@ static void materialui_render_nav_bar_right(
/* Draw selection marker */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6148,6 +6181,7 @@ static void materialui_show_fullscreen_thumbnails(
static void materialui_render_fullscreen_thumbnails(
materialui_handle_t *mui,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width, unsigned video_height,
unsigned header_height,
@ -6352,6 +6386,7 @@ static void materialui_render_fullscreen_thumbnails(
/* Darken background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6369,6 +6404,7 @@ static void materialui_render_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6403,6 +6439,7 @@ static void materialui_render_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6696,18 +6733,22 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
/* Draw landscape border
* (does nothing in portrait mode, or if landscape
* optimisations are disabled) */
materialui_render_landscape_border(mui, userdata,
materialui_render_landscape_border(mui,
p_disp,
userdata,
video_width, video_height,
header_height, list_x_offset);
/* Draw 'short press' touch feedback highlight */
materialui_render_entry_touch_feedback(
mui, userdata, video_width, video_height,
mui, p_disp, userdata, video_width, video_height,
header_height, list_x_offset, selection);
/* Draw 'highlighted entry' selection box */
materialui_render_selection_highlight(
mui, userdata, video_width, video_height,
mui,
p_disp,
userdata, video_width, video_height,
header_height, list_x_offset, selection,
mui->colors.list_highlighted_background,
mui->colors.selection_marker_shadow_top,
@ -6733,7 +6774,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
/* Draw fullscreen thumbnails, if currently active
* > Must be done *after* we flush the first layer
* of text */
materialui_render_fullscreen_thumbnails(mui, userdata,
materialui_render_fullscreen_thumbnails(mui, p_disp, userdata,
video_width, video_height, header_height, selection);
/* Draw title + system bar */
@ -6762,6 +6803,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
gfx_display_set_alpha(
mui->colors.screen_fade, mui->colors.screen_fade_opacity);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6773,11 +6815,13 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
/* Draw message box */
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
materialui_render_messagebox(mui,
p_disp,
userdata, video_width, video_height,
video_height / 4, msg);
/* Draw onscreen keyboard */
gfx_display_draw_keyboard(
p_disp,
userdata,
video_width,
video_height,
@ -6799,6 +6843,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
gfx_display_set_alpha(
mui->colors.screen_fade, mui->colors.screen_fade_opacity);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -6809,6 +6854,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
/* Draw message box */
materialui_render_messagebox(mui,
p_disp,
userdata, video_width, video_height,
video_height / 2, mui->msgbox);
mui->msgbox[0] = '\0';
@ -6832,6 +6878,7 @@ static void materialui_frame(void *data, video_frame_info_t *video_info)
if (cursor_visible)
gfx_display_draw_cursor(
p_disp,
userdata,
video_width,
video_height,
@ -7530,14 +7577,17 @@ static void materialui_layout(
}
mui->font_data.title.font = gfx_display_font(
p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
title_font_size, video_is_threaded);
mui->font_data.list.font = gfx_display_font(
p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
list_font_size, video_is_threaded);
mui->font_data.hint.font = gfx_display_font(
p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
hint_font_size, video_is_threaded);

View File

@ -985,7 +985,8 @@ static bool ozone_init_font(
ozone_font_data_t *font_data,
bool is_threaded, char *font_path, float font_size)
{
int glyph_width = 0;
int glyph_width = 0;
gfx_display_t *p_disp = disp_get_ptr();
/* Free existing */
if (font_data->font)
@ -999,7 +1000,8 @@ static bool ozone_init_font(
font_data->glyph_width = (int)((font_size * (3.0f / 4.0f)) + 0.5f);
/* Create font */
font_data->font = gfx_display_font_file(font_path, font_size, is_threaded);
font_data->font = gfx_display_font_file(p_disp,
font_path, font_size, is_threaded);
if (!font_data->font)
return false;
@ -2154,6 +2156,7 @@ static void ozone_draw_header(
/* Separator */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -2416,6 +2419,7 @@ static void ozone_draw_footer(
/* Separator */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -2961,6 +2965,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
background_color = ozone->theme->background;
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -3002,7 +3007,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
menu_framebuffer_opacity);
/* Menu entries */
gfx_display_scissor_begin(userdata,
gfx_display_scissor_begin(p_disp,
userdata,
video_width,
video_height,
ozone->sidebar_offset + (unsigned) ozone->dimensions_sidebar_width,
@ -3157,6 +3163,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
gfx_display_set_alpha(ozone->pure_white, 1.0f);
if (cursor_visible)
gfx_display_draw_cursor(
p_disp,
userdata,
video_width,
video_height,

View File

@ -113,35 +113,37 @@ static void ozone_draw_cursor_slice(
/* Cursor without border */
gfx_display_draw_texture_slice(
userdata,
video_width,
video_height,
slice_x,
slice_y,
80, 80,
slice_new_w,
slice_new_h,
video_width, video_height,
ozone->theme_dynamic.cursor_alpha,
20, scale_factor,
ozone->theme->textures[OZONE_THEME_TEXTURE_CURSOR_NO_BORDER]
);
p_disp,
userdata,
video_width,
video_height,
slice_x,
slice_y,
80, 80,
slice_new_w,
slice_new_h,
video_width, video_height,
ozone->theme_dynamic.cursor_alpha,
20, scale_factor,
ozone->theme->textures[OZONE_THEME_TEXTURE_CURSOR_NO_BORDER]
);
/* Tainted border */
gfx_display_draw_texture_slice(
userdata,
video_width,
video_height,
slice_x,
slice_y,
80, 80,
slice_new_w,
slice_new_h,
video_width, video_height,
ozone->theme_dynamic.cursor_border,
20, scale_factor,
ozone->textures[OZONE_TEXTURE_CURSOR_BORDER]
);
p_disp,
userdata,
video_width,
video_height,
slice_x,
slice_y,
80, 80,
slice_new_w,
slice_new_h,
video_width, video_height,
ozone->theme_dynamic.cursor_border,
20, scale_factor,
ozone->textures[OZONE_TEXTURE_CURSOR_BORDER]
);
if (dispctx && dispctx->blend_end)
dispctx->blend_end(userdata);
@ -149,6 +151,7 @@ static void ozone_draw_cursor_slice(
static void ozone_draw_cursor_fallback(
ozone_handle_t *ozone,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -167,6 +170,7 @@ static void ozone_draw_cursor_fallback(
/* Fill */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -182,6 +186,7 @@ static void ozone_draw_cursor_fallback(
/* Top */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -195,6 +200,7 @@ static void ozone_draw_cursor_fallback(
/* Bottom */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -208,6 +214,7 @@ static void ozone_draw_cursor_fallback(
/* Left */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -221,6 +228,7 @@ static void ozone_draw_cursor_fallback(
/* Right */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -279,6 +287,7 @@ void ozone_draw_cursor(
new_x, width, height, new_y, alpha);
else
ozone_draw_cursor_fallback(ozone,
p_disp,
userdata,
video_width,
video_height,
@ -312,7 +321,7 @@ void ozone_draw_icon(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
coords.vertices = 4;
coords.vertex = NULL;
@ -349,6 +358,7 @@ void ozone_draw_backdrop(
0.00, 0.00, 0.00, 0.75,
};
static float last_alpha = 0.0f;
gfx_display_t *p_disp = disp_get_ptr();
/* TODO: Replace this backdrop by a blur shader
* on the whole screen if available */
@ -359,6 +369,7 @@ void ozone_draw_backdrop(
}
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -379,6 +390,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
{
unsigned i;
char message[2048];
gfx_display_t *p_disp = disp_get_ptr();
const char *text = str;
unsigned text_color = 0xffffffff;
static float ozone_osk_backdrop[16] = {
@ -406,6 +418,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Border */
/* Top */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -419,6 +432,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Bottom */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -432,6 +446,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Left */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -445,6 +460,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Right */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -459,6 +475,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Backdrop */
/* TODO: Remove the backdrop if blur shader is available */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -512,6 +529,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
ozone->fonts.entries_label.font, msg,
(unsigned)strlen(msg), 1);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -537,6 +555,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
/* Keyboard */
gfx_display_draw_keyboard(
p_disp,
userdata,
video_width,
video_height,
@ -641,6 +660,7 @@ void ozone_draw_messagebox(
: (16.0f * ((float)slice_new_h / 256.0f)));
gfx_display_draw_texture_slice(
p_disp,
userdata,
video_width,
video_height,
@ -686,6 +706,8 @@ void ozone_draw_fullscreen_thumbnails(
unsigned video_width,
unsigned video_height)
{
gfx_display_t *p_disp = disp_get_ptr();
/* Check whether fullscreen thumbnails are visible */
if (ozone->animations.fullscreen_thumbnail_alpha > 0.0f)
{
@ -858,6 +880,7 @@ void ozone_draw_fullscreen_thumbnails(
/* Darken background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -871,6 +894,7 @@ void ozone_draw_fullscreen_thumbnails(
/* Draw full-width separators */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -883,6 +907,7 @@ void ozone_draw_fullscreen_thumbnails(
separator_color);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -901,6 +926,7 @@ void ozone_draw_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -935,6 +961,7 @@ void ozone_draw_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -567,6 +567,7 @@ void ozone_draw_entries(
/* Borders */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -578,6 +579,7 @@ void ozone_draw_entries(
video_height,
ozone->theme_dynamic.entries_border);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -948,6 +950,7 @@ void ozone_draw_thumbnail_bar(
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
{
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -959,6 +962,7 @@ void ozone_draw_thumbnail_bar(
video_height,
ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -970,6 +974,7 @@ void ozone_draw_thumbnail_bar(
video_height,
ozone->theme->sidebar_background);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -1197,6 +1202,7 @@ void ozone_draw_thumbnail_bar(
gfx_display_set_alpha(ozone->theme_dynamic.entries_border, metadata_alpha);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -209,7 +209,9 @@ void ozone_draw_sidebar(
horizontal_list_size = (unsigned)ozone->horizontal_list.size;
gfx_display_scissor_begin(userdata,
gfx_display_scissor_begin(
p_disp,
userdata,
video_width, video_height,
0,
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
@ -222,6 +224,7 @@ void ozone_draw_sidebar(
if (!libretro_running || (menu_framebuffer_opacity >= 1.0f))
{
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -233,6 +236,7 @@ void ozone_draw_sidebar(
video_height,
ozone->theme->sidebar_top_gradient);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -244,6 +248,7 @@ void ozone_draw_sidebar(
video_height,
ozone->theme->sidebar_background);
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -380,6 +385,7 @@ void ozone_draw_sidebar(
if (horizontal_list_size > 0)
{
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,

View File

@ -801,6 +801,7 @@ static void stripes_render_messagebox_internal(
if (menu_input_dialog_get_display_kb())
gfx_display_draw_keyboard(
p_disp,
userdata,
video_width,
video_height,
@ -2468,7 +2469,7 @@ static int stripes_draw_item(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
stripes_draw_icon(
userdata,
@ -2555,7 +2556,7 @@ static void stripes_draw_items(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
@ -2828,7 +2829,7 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
if (dispctx && dispctx->blend_begin)
dispctx->blend_begin(userdata);
@ -2862,6 +2863,7 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
color[15] = 0.55;
gfx_display_draw_polygon(
p_disp,
userdata,
video_width,
video_height,
@ -2913,7 +2915,7 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
stripes_draw_icon(
userdata,
@ -3028,6 +3030,7 @@ static void stripes_frame(void *data, video_frame_info_t *video_info)
if (cursor_visible)
gfx_display_draw_cursor(
p_disp,
userdata,
video_width,
video_height,
@ -3713,10 +3716,10 @@ static void stripes_context_reset(void *data, bool is_threaded)
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
stripes_layout(stripes);
stripes->font = gfx_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
stripes->font = gfx_display_font(p_disp, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
stripes->font_size,
is_threaded);
stripes->font2 = gfx_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
stripes->font2 = gfx_display_font(p_disp, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
stripes->font2_size,
is_threaded);
stripes_context_reset_textures(stripes, iconpath);

View File

@ -1011,6 +1011,7 @@ static void xmb_render_messagebox_internal(
dispctx->blend_begin(userdata);
gfx_display_draw_texture_slice(
p_disp,
userdata,
video_width,
video_height,
@ -1038,6 +1039,7 @@ static void xmb_render_messagebox_internal(
if (input_dialog_display_kb)
gfx_display_draw_keyboard(
p_disp,
userdata,
video_width,
video_height,
@ -3427,7 +3429,7 @@ static int xmb_draw_item(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
xmb_draw_icon(
userdata,
@ -3514,7 +3516,7 @@ static void xmb_draw_items(
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
@ -4093,7 +4095,7 @@ static void xmb_draw_bg(
draw.x = 0;
draw.y = 0;
gfx_display_draw_bg(&draw, userdata, false,
gfx_display_draw_bg(p_disp, &draw, userdata, false,
menu_wallpaper_opacity);
if (draw.height > 0 && draw.width > 0)
if (dispctx && dispctx->draw)
@ -4147,7 +4149,7 @@ static void xmb_draw_bg(
draw.x = 0;
draw.y = 0;
gfx_display_draw_bg(&draw, userdata, false,
gfx_display_draw_bg(p_disp, &draw, userdata, false,
menu_wallpaper_opacity);
if (draw.height > 0 && draw.width > 0)
if (dispctx && dispctx->draw)
@ -4166,7 +4168,7 @@ static void xmb_draw_bg(
if (libretro_running || xmb_color_theme == XMB_THEME_WALLPAPER)
add_opacity = true;
gfx_display_draw_bg(&draw, userdata,
gfx_display_draw_bg(p_disp, &draw, userdata,
add_opacity, menu_wallpaper_opacity);
}
}
@ -4231,6 +4233,7 @@ static void xmb_draw_dark_layer(
static void xmb_draw_fullscreen_thumbnails(
xmb_handle_t *xmb,
gfx_animation_t *p_anim,
gfx_display_t *p_disp,
void *userdata,
unsigned video_width,
unsigned video_height,
@ -4454,6 +4457,7 @@ static void xmb_draw_fullscreen_thumbnails(
/* Darken background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4470,6 +4474,7 @@ static void xmb_draw_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4562,6 +4567,7 @@ static void xmb_draw_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4596,6 +4602,7 @@ static void xmb_draw_fullscreen_thumbnails(
{
/* Background */
gfx_display_draw_quad(
p_disp,
userdata,
video_width,
video_height,
@ -4788,7 +4795,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
/**************************/
/* Draw thumbnails: START */
@ -5208,7 +5215,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
rotate_draw.scale_z = 1;
rotate_draw.scale_enable = true;
gfx_display_rotate_z(&rotate_draw, userdata);
gfx_display_rotate_z(p_disp, &rotate_draw, userdata);
xmb_draw_icon(
userdata,
@ -5282,6 +5289,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
xmb_draw_fullscreen_thumbnails(
xmb,
p_anim,
p_disp,
userdata,
video_width,
video_height,
@ -5325,6 +5333,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
gfx_display_set_alpha(xmb_coord_white, MIN(xmb->alpha, 1.00f));
if (cursor_visible)
gfx_display_draw_cursor(
p_disp,
userdata,
video_width,
video_height,
@ -6223,6 +6232,7 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
{
char iconpath[PATH_MAX_LENGTH];
char bg_file_path[PATH_MAX_LENGTH];
gfx_display_t *p_disp = disp_get_ptr();
iconpath[0] = bg_file_path[0] = '\0';
fill_pathname_application_special(bg_file_path,
@ -6249,10 +6259,12 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb,
gfx_display_font_free(xmb->font2);
xmb->font2 = NULL;
}
xmb->font = gfx_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font = gfx_display_font(p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font_size,
is_threaded);
xmb->font2 = gfx_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font2 = gfx_display_font(p_disp,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
xmb->font2_size,
is_threaded);

View File

@ -32777,6 +32777,7 @@ static void drivers_init(struct rarch_state *p_rarch, int flags)
#endif
bool video_is_threaded = VIDEO_DRIVER_IS_THREADED_INTERNAL();
settings_t *settings = p_rarch->configuration_settings;
gfx_display_t *p_disp = &p_rarch->dispgfx;
#if defined(HAVE_GFX_WIDGETS)
bool video_font_enable = settings->bools.video_font_enable;
bool menu_enable_widgets = settings->bools.menu_enable_widgets;
@ -32906,7 +32907,7 @@ static void drivers_init(struct rarch_state *p_rarch, int flags)
else
#endif
{
gfx_display_init_first_driver(video_is_threaded);
gfx_display_init_first_driver(p_disp, video_is_threaded);
}
#ifdef HAVE_MENU