(GLUI) Only update text vertices when needed
This commit is contained in:
parent
8b7bbc7975
commit
d3d976c92b
|
@ -366,7 +366,7 @@ static void gl_flush_block(void *data)
|
||||||
restore_viewport(font->gl);
|
restore_viewport(font->gl);
|
||||||
}
|
}
|
||||||
|
|
||||||
block->carr.coords.vertices = 0;
|
/* block->carr.coords.vertices = 0; */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_bind_block(void *data, gl_font_raster_block_t *block)
|
static void gl_bind_block(void *data, gl_font_raster_block_t *block)
|
||||||
|
|
|
@ -56,10 +56,18 @@ static int glui_entry_iterate(unsigned action)
|
||||||
const char *label = NULL;
|
const char *label = NULL;
|
||||||
menu_file_list_cbs_t *cbs = NULL;
|
menu_file_list_cbs_t *cbs = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu || !runloop)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (action != MENU_ACTION_NOOP || menu->need_refresh ||
|
||||||
|
runloop->frames.video.current.menu.label.is_updated ||
|
||||||
|
runloop->frames.video.current.menu.animation.is_active)
|
||||||
|
{
|
||||||
|
runloop->frames.video.current.menu.framebuf.dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(
|
cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(
|
||||||
menu->menu_list->selection_buf, menu->navigation.selection_ptr);
|
menu->menu_list->selection_buf, menu->navigation.selection_ptr);
|
||||||
|
|
||||||
|
@ -291,10 +299,6 @@ static void glui_render(void)
|
||||||
menu->frame_buf.width = gl->win_width;
|
menu->frame_buf.width = gl->win_width;
|
||||||
menu->frame_buf.height = gl->win_height;
|
menu->frame_buf.height = gl->win_height;
|
||||||
|
|
||||||
runloop->frames.video.current.menu.animation.is_active = false;
|
|
||||||
runloop->frames.video.current.menu.label.is_updated = false;
|
|
||||||
runloop->frames.video.current.menu.framebuf.dirty = false;
|
|
||||||
|
|
||||||
menu->mouse.ptr = (menu->mouse.y - glui->margin) /
|
menu->mouse.ptr = (menu->mouse.y - glui->margin) /
|
||||||
glui->line_height - 2 + menu->begin;
|
glui->line_height - 2 + menu->begin;
|
||||||
|
|
||||||
|
@ -353,12 +357,22 @@ static void glui_frame(void)
|
||||||
|
|
||||||
glViewport(0, 0, gl->win_width, gl->win_height);
|
glViewport(0, 0, gl->win_width, gl->win_height);
|
||||||
|
|
||||||
|
glui_render_background(settings, gl, glui, false);
|
||||||
|
|
||||||
|
if (!menu_display_update_pending())
|
||||||
|
goto draw_text;
|
||||||
|
|
||||||
|
glui->raster_block.carr.coords.vertices = 0;
|
||||||
|
|
||||||
|
runloop->frames.video.current.menu.animation.is_active = false;
|
||||||
|
runloop->frames.video.current.menu.label.is_updated = false;
|
||||||
|
runloop->frames.video.current.menu.framebuf.dirty = false;
|
||||||
|
|
||||||
end = (menu->begin + glui->term_height <=
|
end = (menu->begin + glui->term_height <=
|
||||||
menu_list_get_size(menu->menu_list)) ?
|
menu_list_get_size(menu->menu_list)) ?
|
||||||
menu->begin + glui->term_height :
|
menu->begin + glui->term_height :
|
||||||
menu_list_get_size(menu->menu_list);
|
menu_list_get_size(menu->menu_list);
|
||||||
|
|
||||||
glui_render_background(settings, gl, glui, false);
|
|
||||||
|
|
||||||
menu_list_get_last_stack(menu->menu_list, &dir, &label, &menu_type);
|
menu_list_get_last_stack(menu->menu_list, &dir, &label, &menu_type);
|
||||||
|
|
||||||
|
@ -464,6 +478,7 @@ static void glui_frame(void)
|
||||||
if (settings->menu.mouse.enable)
|
if (settings->menu.mouse.enable)
|
||||||
glui_draw_cursor(gl, menu->mouse.x, menu->mouse.y);
|
glui_draw_cursor(gl, menu->mouse.x, menu->mouse.y);
|
||||||
|
|
||||||
|
draw_text:
|
||||||
if (gl->font_driver->flush)
|
if (gl->font_driver->flush)
|
||||||
gl->font_driver->flush(gl->font_handle);
|
gl->font_driver->flush(gl->font_handle);
|
||||||
|
|
||||||
|
@ -515,6 +530,9 @@ static void glui_free(void *data)
|
||||||
|
|
||||||
gl_coord_array_release(&glui->raster_block.carr);
|
gl_coord_array_release(&glui->raster_block.carr);
|
||||||
|
|
||||||
|
if (gl->font_driver->bind_block)
|
||||||
|
gl->font_driver->bind_block(gl->font_handle, NULL);
|
||||||
|
|
||||||
if (menu->alloc_font)
|
if (menu->alloc_font)
|
||||||
free((uint8_t*)menu->font);
|
free((uint8_t*)menu->font);
|
||||||
|
|
||||||
|
@ -569,6 +587,7 @@ static void glui_context_reset(void)
|
||||||
glui_handle_t *glui = NULL;
|
glui_handle_t *glui = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
gl_t *gl = (gl_t*)video_driver_get_ptr(NULL);
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
@ -602,6 +621,9 @@ static void glui_context_reset(void)
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gl->font_driver->bind_block)
|
||||||
|
gl->font_driver->bind_block(gl->font_handle, &glui->raster_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void glui_navigation_clear(bool pending_push)
|
static void glui_navigation_clear(bool pending_push)
|
||||||
|
|
|
@ -1515,6 +1515,9 @@ static void xmb_free(void *data)
|
||||||
xmb = (xmb_handle_t*)menu->userdata;
|
xmb = (xmb_handle_t*)menu->userdata;
|
||||||
|
|
||||||
gl_coord_array_release(&xmb->raster_block.carr);
|
gl_coord_array_release(&xmb->raster_block.carr);
|
||||||
|
|
||||||
|
if (gl->font_driver->bind_block)
|
||||||
|
gl->font_driver->bind_block(gl->font_handle, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool xmb_font_init_first(const gl_font_renderer_t **font_driver,
|
static bool xmb_font_init_first(const gl_font_renderer_t **font_driver,
|
||||||
|
@ -1782,6 +1785,9 @@ static void xmb_context_reset(void)
|
||||||
else if (xmb->depth <= 1)
|
else if (xmb->depth <= 1)
|
||||||
node->alpha = xmb->categories.passive.alpha;
|
node->alpha = xmb->categories.passive.alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gl->font_driver->bind_block)
|
||||||
|
gl->font_driver->bind_block(gl->font_handle, &xmb->raster_block);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_navigation_clear(bool pending_push)
|
static void xmb_navigation_clear(bool pending_push)
|
||||||
|
|
Loading…
Reference in New Issue