Browse files

Revert "use IN_PROGRESS to indicate the allocated state of a texture …

…in progress, and split out the removal of inprogress from allocated or failed textures"

This reverts commit 76a1193.
  • Loading branch information...
1 parent ab5885f commit 2dddc4573d17972be506e355ace9be1ed0e827dd Jonathan Marshall committed Jul 4, 2012
Showing with 5 additions and 15 deletions.
  1. +0 −6 xbmc/GUILargeTextureManager.cpp
  2. +1 −2 xbmc/GUILargeTextureManager.h
  3. +3 −6 xbmc/guilib/GUITexture.cpp
  4. +1 −1 xbmc/guilib/GUITexture.h
View
6 xbmc/GUILargeTextureManager.cpp
@@ -190,12 +190,6 @@ void CGUILargeTextureManager::ReleaseImage(const CStdString &path, bool immediat
return;
}
}
- assert(false);
-}
-
-void CGUILargeTextureManager::ReleaseQueuedImage(const CStdString &path)
-{
- CSingleLock lock(m_listSection);
for (queueIterator it = m_queued.begin(); it != m_queued.end(); ++it)
{
unsigned int id = it->first;
View
3 xbmc/GUILargeTextureManager.h
@@ -93,14 +93,13 @@ class CGUILargeTextureManager : public IJobCallback
When textures are finished with, this function should be called. This decrements the texture's
reference count, and schedules it to be unloaded once the reference count reaches zero. If the
- texture is still queued for loading, or is in the process of loading, use ReleaseQueuedImage instead
+ texture is still queued for loading, or is in the process of loading, the image load is cancelled.
\param path path of the image to release.
\param immediately if set true the image is immediately unloaded once its reference count reaches zero
rather than being unloaded after a delay.
*/
void ReleaseImage(const CStdString &path, bool immediately = false);
- void ReleaseQueuedImage(const CStdString &path);
/*!
\brief Cleanup images that are no longer in use.
View
9 xbmc/guilib/GUITexture.cpp
@@ -130,7 +130,7 @@ bool CGUITextureBase::AllocateOnDemand()
{
if (m_visible)
{ // visible, so make sure we're allocated
- if (!IsAllocated() || (m_isAllocated == IN_PROGRESS))
+ if (!IsAllocated() || (m_isAllocated == LARGE && !m_texture.size()))
return AllocResources();
}
else
@@ -315,12 +315,11 @@ bool CGUITextureBase::AllocResources()
CTextureArray texture;
if (g_largeTextureManager.GetImage(m_info.filename, texture, !IsAllocated()))
{
- m_isAllocated = IN_PROGRESS;
+ m_isAllocated = LARGE;
if (!texture.size()) // not ready as yet
return false;
- m_isAllocated = LARGE;
m_texture = texture;
changed = true;
}
@@ -456,9 +455,7 @@ bool CGUITextureBase::CalculateSize()
void CGUITextureBase::FreeResources(bool immediately /* = false */)
{
- if (m_isAllocated == IN_PROGRESS)
- g_largeTextureManager.ReleaseQueuedImage(m_info.filename);
- else if (m_isAllocated == LARGE || m_isAllocated == LARGE_FAILED)
+ if (m_isAllocated == LARGE || m_isAllocated == LARGE_FAILED)
g_largeTextureManager.ReleaseImage(m_info.filename, immediately || (m_isAllocated == LARGE_FAILED));
else if (m_isAllocated == NORMAL && m_texture.size())
g_TextureManager.ReleaseTexture(m_info.filename);
View
2 xbmc/guilib/GUITexture.h
@@ -161,7 +161,7 @@ class CGUITextureBase
CPoint m_diffuseOffset; // offset into the diffuse frame (it's not always the origin)
bool m_allocateDynamically;
- enum ALLOCATE_TYPE { NO = 0, NORMAL, IN_PROGRESS, LARGE, NORMAL_FAILED, LARGE_FAILED };
+ enum ALLOCATE_TYPE { NO = 0, NORMAL, LARGE, NORMAL_FAILED, LARGE_FAILED };
ALLOCATE_TYPE m_isAllocated;
CTextureInfo m_info;

0 comments on commit 2dddc45

Please sign in to comment.