Permalink
Browse files

X11: factor out code that reset device after lost

  • Loading branch information...
1 parent ad94545 commit 5b6caeb3df6cb64cdf893829d7f3fdf5c37b835b @elupus committed Jul 14, 2012
Showing with 15 additions and 9 deletions.
  1. +14 −9 xbmc/windowing/X11/WinSystemX11.cpp
  2. +1 −0 xbmc/windowing/X11/WinSystemX11.h
View
23 xbmc/windowing/X11/WinSystemX11.cpp
@@ -498,15 +498,7 @@ void CWinSystemX11::CheckDisplayEvents()
if (bGotEvent || bTimeout)
{
CLog::Log(LOGDEBUG, "%s - notify display reset event", __FUNCTION__);
-
- CSingleLock lock(m_resourceSection);
-
- // tell any shared resources
- for (vector<IDispResource *>::iterator i = m_resources.begin(); i != m_resources.end(); i++)
- (*i)->OnResetDevice();
-
- // reset fail safe timer
- m_dpyLostTime = 0;
+ OnResetDevice();
}
#endif
}
@@ -527,6 +519,19 @@ void CWinSystemX11::OnLostDevice()
m_dpyLostTime = CurrentHostCounter();
}
+
+void CWinSystemX11::OnResetDevice()
+{
+ CSingleLock lock(m_resourceSection);
+
+ // tell any shared resources
+ for (vector<IDispResource *>::iterator i = m_resources.begin(); i != m_resources.end(); i++)
+ (*i)->OnResetDevice();
+
+ // reset fail safe timer
+ m_dpyLostTime = 0;
+}
+
void CWinSystemX11::Register(IDispResource *resource)
{
CSingleLock lock(m_resourceSection);
View
1 xbmc/windowing/X11/WinSystemX11.h
@@ -68,6 +68,7 @@ class CWinSystemX11 : public CWinSystemBase
bool RefreshGlxContext();
void CheckDisplayEvents();
void OnLostDevice();
+ void OnResetDevice();
SDL_Surface* m_SDLSurface;
GLXContext m_glContext;

0 comments on commit 5b6caeb

Please sign in to comment.