diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-06-06 23:50:32 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-06-06 23:50:32 +0000 |
commit | 73c4dbcd8052b88ea0b46504de3c3541f49e54ec (patch) | |
tree | 3b15a586383208639b18fbe441ab1fe2ab8d8862 /guilib | |
parent | ccdde2fa1d7c946fdc9842ab5a909416a6553890 (diff) |
cleanup: Move clearing of screen into the windowmanager, and do it optionally based on each window. Currently always clears the screen except in fullscreen video
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30879 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIWindow.cpp | 1 | ||||
-rw-r--r-- | guilib/GUIWindow.h | 6 | ||||
-rw-r--r-- | guilib/GUIWindowManager.cpp | 4 | ||||
-rw-r--r-- | guilib/GUIWindowManager.h | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index f13ade167a..99c4ade243 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -65,6 +65,7 @@ CGUIWindow::CGUIWindow(int id, const CStdString &xmlFile) m_animationsEnabled = true; m_manualRunActions = false; m_exclusiveMouseControl = 0; + m_clearBackground = true; } CGUIWindow::~CGUIWindow(void) diff --git a/guilib/GUIWindow.h b/guilib/GUIWindow.h index 1e6d2123e9..ca1b28ac35 100644 --- a/guilib/GUIWindow.h +++ b/guilib/GUIWindow.h @@ -110,6 +110,11 @@ public: // and does not need to be passed further down the line (to our global action handlers) virtual bool OnAction(const CAction &action); + /*! \brief Whether the background needs clearing prior to rendering the window + \return true if the background needs clearing, false otherwise. + */ + virtual bool NeedsClearBackground() const { return m_clearBackground; }; + bool OnMove(int fromControl, int moveAction); virtual bool OnMessage(CGUIMessage& message); @@ -252,6 +257,7 @@ protected: bool m_loadOnDemand; // true if the window should be loaded only as needed bool m_isDialog; // true if we have a dialog, false otherwise. bool m_dynamicResourceAlloc; + bool m_clearBackground; // set to false if background does not need to be cleared int m_renderOrder; // for render order of dialogs diff --git a/guilib/GUIWindowManager.cpp b/guilib/GUIWindowManager.cpp index eb2c02fcef..7e82479d1d 100644 --- a/guilib/GUIWindowManager.cpp +++ b/guilib/GUIWindowManager.cpp @@ -489,7 +489,11 @@ void CGUIWindowManager::Render() CSingleLock lock(g_graphicsContext); CGUIWindow* pWindow = GetWindow(GetActiveWindow()); if (pWindow) + { + if (pWindow->NeedsClearBackground()) + g_graphicsContext.Clear(); pWindow->Render(); + } // we render the dialogs based on their render order. vector<CGUIWindow *> renderList = m_activeDialogs; diff --git a/guilib/GUIWindowManager.h b/guilib/GUIWindowManager.h index db1e94b393..2beb098846 100644 --- a/guilib/GUIWindowManager.h +++ b/guilib/GUIWindowManager.h @@ -67,7 +67,7 @@ public: // currently focused window(s). Returns true only if the message is handled. bool OnAction(const CAction &action); - /*! \brief Rendering of the current window + /*! \brief Rendering of the current window and any dialogs Render is called every frame to draw the current window and any dialogs. It should only be called from the application thread. */ |