Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1700)

Unified Diff: cc/prioritized_texture_manager.h

Issue 11195015: Remove use of wtf/ListHashSet from CCPrioritizedTextureManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Track tail sorting and add more asserts Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/prioritized_texture.cc ('k') | cc/prioritized_texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/prioritized_texture_manager.h
diff --git a/cc/prioritized_texture_manager.h b/cc/prioritized_texture_manager.h
index e8998b03d93e6855226d59dbab63bbcdc86b5ab6..e27e8f28a873783f31837f00b2fd0320b6031828 100644
--- a/cc/prioritized_texture_manager.h
+++ b/cc/prioritized_texture_manager.h
@@ -14,8 +14,8 @@
#include "GraphicsContext3D.h"
#include "IntRect.h"
#include "IntSize.h"
-#include <wtf/ListHashSet.h>
#include <wtf/Vector.h>
+#include <list>
#if defined(COMPILER_GCC)
namespace BASE_HASH_NAMESPACE {
@@ -44,7 +44,7 @@ public:
}
~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
// old texture manager and is just to give us a default memory allocation before
@@ -76,10 +76,10 @@ public:
bool linkedEvictedBackingsExist() const;
// 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.
- void getEvictedBackings(BackingVector& evictedBackings);
+ void getEvictedBackings(BackingList& evictedBackings);
// Unlink the list of contents textures' backings from their owning textures on the main thread
// before updating layers.
- void unlinkEvictedBackings(const BackingVector& evictedBackings);
+ void unlinkEvictedBackings(const BackingList& evictedBackings);
bool requestLate(CCPrioritizedTexture*);
@@ -136,13 +136,11 @@ private:
void evictBackingsToReduceMemory(size_t limitBytes, EvictionPriorityPolicy, CCResourceProvider*);
CCPrioritizedTexture::Backing* createBacking(IntSize, GC3Denum format, CCResourceProvider*);
- void evictBackingResource(CCPrioritizedTexture::Backing*, CCResourceProvider*);
+ void evictFirstBackingResource(CCResourceProvider*);
void deleteUnlinkedEvictedBackings();
void sortBackings();
-#if !ASSERT_DISABLED
void assertInvariants();
-#endif
size_t m_maxMemoryLimitBytes;
unsigned m_priorityCutoff;
@@ -152,15 +150,17 @@ private:
int m_pool;
typedef base::hash_set<CCPrioritizedTexture*> TextureSet;
- typedef ListHashSet<CCPrioritizedTexture::Backing*> BackingSet;
typedef Vector<CCPrioritizedTexture*> TextureVector;
TextureSet m_textures;
- BackingSet m_backings;
- BackingVector m_evictedBackings;
+ // This list is always sorted in eviction order, with the exception the
+ // 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;
- BackingVector m_tempBackingVector;
DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager);
};
« no previous file with comments | « cc/prioritized_texture.cc ('k') | cc/prioritized_texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698