Disable FPS limiter for OSX (GAL).

This commit is contained in:
Bernhard Stegmaier 2016-02-18 11:29:12 -05:00 committed by Wayne Stambaugh
parent dcd81e23f4
commit a773ecc735
1 changed files with 9 additions and 2 deletions

View File

@ -182,20 +182,27 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect )
if( m_pendingRefresh ) if( m_pendingRefresh )
return; return;
m_pendingRefresh = true;
#ifdef __WXMAC__
// Timers on OS X may have a high latency (seen up to 500ms and more) which
// makes repaints jerky. No negative impact seen without throttling, so just
// do an unconditional refresh for OS X.
ForceRefresh();
#else
wxLongLong t = wxGetLocalTimeMillis(); wxLongLong t = wxGetLocalTimeMillis();
wxLongLong delta = t - m_lastRefresh; wxLongLong delta = t - m_lastRefresh;
if( delta >= MinRefreshPeriod ) if( delta >= MinRefreshPeriod )
{ {
ForceRefresh(); ForceRefresh();
m_pendingRefresh = true;
} }
else else
{ {
// One shot timer // One shot timer
m_refreshTimer.Start( ( MinRefreshPeriod - delta ).ToLong(), true ); m_refreshTimer.Start( ( MinRefreshPeriod - delta ).ToLong(), true );
m_pendingRefresh = true;
} }
#endif
} }