aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guilib/GUIWindow.cpp1
-rw-r--r--guilib/GUIWindow.h6
-rw-r--r--guilib/GUIWindowManager.cpp4
-rw-r--r--guilib/GUIWindowManager.h2
-rw-r--r--xbmc/Application.cpp2
-rw-r--r--xbmc/GUIWindowFullScreen.h1
6 files changed, 13 insertions, 3 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.
*/
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 21d6b76bb6..5a3c024dc2 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -1827,8 +1827,6 @@ void CApplication::RenderNoPresent()
ResetScreenSaver();
}
- else
- g_graphicsContext.Clear();
g_windowManager.Render();
diff --git a/xbmc/GUIWindowFullScreen.h b/xbmc/GUIWindowFullScreen.h
index 3fd87098c2..ff1c3f60ea 100644
--- a/xbmc/GUIWindowFullScreen.h
+++ b/xbmc/GUIWindowFullScreen.h
@@ -40,6 +40,7 @@ public:
virtual void FrameMove();
virtual void Render();
virtual void OnWindowLoaded();
+ virtual bool NeedsClearBackground() const { return false; }; // never clear the background in fullscreen
void ChangetheTimeCode(int remote);
virtual void OnSliderChange(void *data, CGUISliderControl *slider);