Commit 60efc5a4 authored by ccameron@chromium.org's avatar ccameron@chromium.org

Remove use of wtf/ListHashSet from CCPrioritizedTextureManager.

We actually don't need the O(1) lookup for backings, so just use a list.

BUG=154451


Review URL: https://chromiumcodereview.appspot.com/11195015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162335 0039d316-1c4b-4281-b951-d872f2087c98
parent 21c5f67e
...@@ -165,7 +165,7 @@ bool CCPrioritizedTexture::Backing::resourceHasBeenDeleted() const ...@@ -165,7 +165,7 @@ bool CCPrioritizedTexture::Backing::resourceHasBeenDeleted() const
bool CCPrioritizedTexture::Backing::canBeRecycled() const bool CCPrioritizedTexture::Backing::canBeRecycled() const
{ {
ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); ASSERT(CCProxy::isImplThread());
return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree; return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree;
} }
......
This diff is collapsed.
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "GraphicsContext3D.h" #include "GraphicsContext3D.h"
#include "IntRect.h" #include "IntRect.h"
#include "IntSize.h" #include "IntSize.h"
#include <wtf/ListHashSet.h>
#include <wtf/Vector.h> #include <wtf/Vector.h>
#include <list>
#if defined(COMPILER_GCC) #if defined(COMPILER_GCC)
namespace BASE_HASH_NAMESPACE { namespace BASE_HASH_NAMESPACE {
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
} }
~CCPrioritizedTextureManager(); ~CCPrioritizedTextureManager();
typedef Vector<CCPrioritizedTexture::Backing*> BackingVector; typedef std::list<CCPrioritizedTexture::Backing*> BackingList;
// FIXME (http://crbug.com/137094): This 64MB default is a straggler from the // FIXME (http://crbug.com/137094): This 64MB default is a straggler from the
// old texture manager and is just to give us a default memory allocation before // old texture manager and is just to give us a default memory allocation before
...@@ -76,10 +76,10 @@ public: ...@@ -76,10 +76,10 @@ public:
bool linkedEvictedBackingsExist() const; bool linkedEvictedBackingsExist() const;
// Retrieve the list of all contents textures' backings that have been evicted, to pass to the // Retrieve the list of all contents textures' backings that have been evicted, to pass to the
// main thread to unlink them from their owning textures. // main thread to unlink them from their owning textures.
void getEvictedBackings(BackingVector& evictedBackings); void getEvictedBackings(BackingList& evictedBackings);
// Unlink the list of contents textures' backings from their owning textures on the main thread // Unlink the list of contents textures' backings from their owning textures on the main thread
// before updating layers. // before updating layers.
void unlinkEvictedBackings(const BackingVector& evictedBackings); void unlinkEvictedBackings(const BackingList& evictedBackings);
bool requestLate(CCPrioritizedTexture*); bool requestLate(CCPrioritizedTexture*);
...@@ -136,13 +136,11 @@ private: ...@@ -136,13 +136,11 @@ private:
void evictBackingsToReduceMemory(size_t limitBytes, EvictionPriorityPolicy, CCResourceProvider*); void evictBackingsToReduceMemory(size_t limitBytes, EvictionPriorityPolicy, CCResourceProvider*);
CCPrioritizedTexture::Backing* createBacking(IntSize, GC3Denum format, CCResourceProvider*); CCPrioritizedTexture::Backing* createBacking(IntSize, GC3Denum format, CCResourceProvider*);
void evictBackingResource(CCPrioritizedTexture::Backing*, CCResourceProvider*); void evictFirstBackingResource(CCResourceProvider*);
void deleteUnlinkedEvictedBackings(); void deleteUnlinkedEvictedBackings();
void sortBackings(); void sortBackings();
#if !ASSERT_DISABLED
void assertInvariants(); void assertInvariants();
#endif
size_t m_maxMemoryLimitBytes; size_t m_maxMemoryLimitBytes;
unsigned m_priorityCutoff; unsigned m_priorityCutoff;
...@@ -152,15 +150,17 @@ private: ...@@ -152,15 +150,17 @@ private:
int m_pool; int m_pool;
typedef base::hash_set<CCPrioritizedTexture*> TextureSet; typedef base::hash_set<CCPrioritizedTexture*> TextureSet;
typedef ListHashSet<CCPrioritizedTexture::Backing*> BackingSet;
typedef Vector<CCPrioritizedTexture*> TextureVector; typedef Vector<CCPrioritizedTexture*> TextureVector;
TextureSet m_textures; TextureSet m_textures;
BackingSet m_backings; // This list is always sorted in eviction order, with the exception the
BackingVector m_evictedBackings; // newly-allocated or recycled textures at the very end of the tail that
// are not sorted by priority.
BackingList m_backings;
bool m_backingsTailNotSorted;
BackingList m_evictedBackings;
TextureVector m_tempTextureVector; TextureVector m_tempTextureVector;
BackingVector m_tempBackingVector;
DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager); DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager);
}; };
......
...@@ -318,7 +318,7 @@ bool CCSingleThreadProxy::commitAndComposite() ...@@ -318,7 +318,7 @@ bool CCSingleThreadProxy::commitAndComposite()
return false; return false;
// Unlink any texture backings that were deleted // Unlink any texture backings that were deleted
CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackings; CCPrioritizedTextureManager::BackingList evictedContentsTexturesBackings;
{ {
DebugScopedSetImplThread implThread; DebugScopedSetImplThread implThread;
m_layerTreeHost->contentsTextureManager()->getEvictedBackings(evictedContentsTexturesBackings); m_layerTreeHost->contentsTextureManager()->getEvictedBackings(evictedContentsTexturesBackings);
......
...@@ -87,7 +87,7 @@ private: ...@@ -87,7 +87,7 @@ private:
double monotonicFrameBeginTime; double monotonicFrameBeginTime;
scoped_ptr<CCScrollAndScaleSet> scrollInfo; scoped_ptr<CCScrollAndScaleSet> scrollInfo;
WebKit::WebTransformationMatrix implTransform; WebKit::WebTransformationMatrix implTransform;
CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackings; CCPrioritizedTextureManager::BackingList evictedContentsTexturesBackings;
size_t memoryAllocationLimitBytes; size_t memoryAllocationLimitBytes;
}; };
scoped_ptr<BeginFrameAndCommitState> m_pendingBeginFrameRequest; scoped_ptr<BeginFrameAndCommitState> m_pendingBeginFrameRequest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment