perf(mainloop): set run all tasks in one frame
@@ -237,10 +237,12 @@ void LCUI_DestroyEvent( LCUI_SysEvent e )
void LCUI_ProcessEvents( void )
{
- LCUIWorker_RunTask( MainApp.main_worker );
if( MainApp.driver_ready ) {
MainApp.driver->ProcessEvents();
}
+ while( LCUIWorker_RunTask( MainApp.main_worker ) ) {
+ LCUIDisplay_Update();
+ }
}
LCUI_BOOL LCUI_PostTask( LCUI_Task task )
@@ -313,7 +315,6 @@ int LCUIMainLoop_Run( LCUI_MainLoop loop )
MainApp.loop = loop;
while( loop->state != STATE_EXITED ) {
LCUI_ProcessEvents();
- LCUIDisplay_Update();
LCUIDisplay_Render();
LCUIDisplay_Present();
StepTimer_Remain( MainApp.timer );
