Skip to content

Commit

Permalink
Merge pull request #63 from fritsch/xvba-eden
Browse files Browse the repository at this point in the history
Backport some fixes
  • Loading branch information
FernetMenta committed Aug 4, 2012
2 parents 8278a6c + 73867cf commit 3e73af8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2124,8 +2124,6 @@ void CApplication::Render()

g_Windowing.EndRender();

g_TextureManager.FreeUnusedTextures();

// reset our info cache - we do this at the end of Render so that it is
// fresh for the next process(), or after a windowclose animation (where process()
// isn't called)
Expand Down Expand Up @@ -2164,6 +2162,8 @@ void CApplication::Render()
}
CTimeUtils::UpdateFrameTime(flip);

g_TextureManager.FreeUnusedTextures();

g_renderManager.UpdateResolution();
g_renderManager.ManageCaptures();
}
Expand Down
2 changes: 1 addition & 1 deletion xbmc/filesystem/PluginDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ bool CPluginDirectory::WaitOnScriptResult(const CStdString &scriptPath, const CS
}

// check whether we should pop up the progress dialog
if (!progressBar && XbmcThreads::SystemClockMillis() - startTime > timeBeforeProgressBar)
if (!progressBar && XbmcThreads::SystemClockMillis() - startTime > timeBeforeProgressBar && !g_windowManager.HasModalDialog())
{ // loading takes more then 1.5 secs, show a progress dialog
progressBar = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);

Expand Down
3 changes: 2 additions & 1 deletion xbmc/guilib/GUIFontTTFGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "GUIFontTTFGL.h"
#include "GUIFontManager.h"
#include "Texture.h"
#include "TextureManager.h"
#include "GraphicContext.h"
#include "gui3d.h"
#include "utils/log.h"
Expand Down Expand Up @@ -234,7 +235,7 @@ void CGUIFontTTFGL::DeleteHardwareTexture()
if (m_bTextureLoaded)
{
if (glIsTexture(m_nTexture))
glDeleteTextures(1, (GLuint*) &m_nTexture);
g_TextureManager.ReleaseHwTexture(m_nTexture);
m_bTextureLoaded = false;
}
}
Expand Down
13 changes: 13 additions & 0 deletions xbmc/guilib/TextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,19 @@ void CGUITextureManager::FreeUnusedTextures()
for (ivecTextures i = m_unusedTextures.begin(); i != m_unusedTextures.end(); ++i)
delete *i;
m_unusedTextures.clear();

#if defined(HAS_GL) || defined(HAS_GLES)
for (unsigned int i = 0; i < m_unusedHwTextures.size(); ++i)
{
glDeleteTextures(1, (GLuint*) &m_unusedHwTextures[i]);
}
#endif
m_unusedHwTextures.clear();
}

void CGUITextureManager::ReleaseHwTexture(unsigned int texture)
{
m_unusedHwTextures.push_back(texture);
}

void CGUITextureManager::Cleanup()
Expand Down
2 changes: 2 additions & 0 deletions xbmc/guilib/TextureManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ class CGUITextureManager
void RemoveTexturePath(const CStdString &texturePath); ///< Remove a path from the paths to check when loading media

void FreeUnusedTextures(); ///< Free textures (called from app thread only)
void ReleaseHwTexture(unsigned int texture);
protected:
std::vector<CTextureMap*> m_vecTextures;
std::vector<CTextureMap*> m_unusedTextures;
std::vector<unsigned int> m_unusedHwTextures;
typedef std::vector<CTextureMap*>::iterator ivecTextures;
// we have 2 texture bundles (one for the base textures, one for the theme)
CTextureBundle m_TexBundle[2];
Expand Down
3 changes: 3 additions & 0 deletions xbmc/interfaces/python/xbmcmodule/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ namespace PYXBMC

if (!PyArg_ParseTuple(args, (char*)"|i", &autoClose)) return NULL;

if (g_windowManager.IsWindowActive(WINDOW_DIALOG_PROGRESS))
g_windowManager.CloseDialogs();

PyXBMCGUILock();
pKeyboard->Initialize();
pKeyboard->SetHeading(self->strHeading);
Expand Down

0 comments on commit 3e73af8

Please sign in to comment.