From 7d41e01e9360a00fe6e3b6816e5264a5886a0bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Sun, 8 Mar 2015 14:12:13 -0300 Subject: [PATCH] (RGUI) Only render when needed --- menu/drivers/rgui.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 8c9a8bef54..cab9fc0952 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -45,6 +45,9 @@ static int rgui_entry_iterate(unsigned action) if (!menu->menu_list) return -1; + if (action != MENU_ACTION_NOOP || menu->need_refresh) + g_runloop.frames.video.current.menu.framebuf.dirty = true; + cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset( menu->menu_list->selection_buf, menu->navigation.selection_ptr); @@ -333,6 +336,10 @@ static void rgui_render(void) if (menu->need_refresh && g_runloop.is_menu && !menu->msg_force) return; + if (!g_runloop.frames.video.current.menu.framebuf.dirty + && !g_runloop.frames.video.current.menu.animation.is_active + && !g_runloop.frames.video.current.menu.label.is_updated) + return; menu->mouse.ptr = menu->mouse.y / 11 - 2 + menu->begin;