| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CCPrioritizedTextureManager_h | 5 #ifndef CCPrioritizedTextureManager_h |
| 6 #define CCPrioritizedTextureManager_h | 6 #define CCPrioritizedTextureManager_h |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return a < b; | 118 return a < b; |
| 119 } | 119 } |
| 120 | 120 |
| 121 CCPrioritizedTextureManager(size_t maxMemoryLimitBytes, int maxTextureSize,
int pool); | 121 CCPrioritizedTextureManager(size_t maxMemoryLimitBytes, int maxTextureSize,
int pool); |
| 122 | 122 |
| 123 void updateBackingsPriorities(); | 123 void updateBackingsPriorities(); |
| 124 void evictBackingsToReduceMemory(size_t limitBytes, EvictionPriorityPolicy,
CCResourceProvider*); | 124 void evictBackingsToReduceMemory(size_t limitBytes, EvictionPriorityPolicy,
CCResourceProvider*); |
| 125 CCPrioritizedTexture::Backing* createBacking(IntSize, GC3Denum format, CCRes
ourceProvider*); | 125 CCPrioritizedTexture::Backing* createBacking(IntSize, GC3Denum format, CCRes
ourceProvider*); |
| 126 void evictBackingResource(CCPrioritizedTexture::Backing*, CCResourceProvider
*); | 126 void evictBackingResource(CCPrioritizedTexture::Backing*, CCResourceProvider
*); |
| 127 | 127 |
| 128 #if !ASSERT_DISABLED | |
| 129 void assertInvariants(); | 128 void assertInvariants(); |
| 130 #endif | |
| 131 | 129 |
| 132 size_t m_maxMemoryLimitBytes; | 130 size_t m_maxMemoryLimitBytes; |
| 133 unsigned m_priorityCutoff; | 131 unsigned m_priorityCutoff; |
| 134 size_t m_memoryUseBytes; | 132 size_t m_memoryUseBytes; |
| 135 size_t m_memoryAboveCutoffBytes; | 133 size_t m_memoryAboveCutoffBytes; |
| 136 size_t m_memoryAvailableBytes; | 134 size_t m_memoryAvailableBytes; |
| 137 int m_pool; | 135 int m_pool; |
| 138 | 136 |
| 139 typedef base::hash_set<CCPrioritizedTexture*> TextureSet; | 137 typedef base::hash_set<CCPrioritizedTexture*> TextureSet; |
| 140 typedef ListHashSet<CCPrioritizedTexture::Backing*> BackingSet; | 138 typedef ListHashSet<CCPrioritizedTexture::Backing*> BackingSet; |
| 141 typedef Vector<CCPrioritizedTexture*> TextureVector; | 139 typedef Vector<CCPrioritizedTexture*> TextureVector; |
| 142 | 140 |
| 143 TextureSet m_textures; | 141 TextureSet m_textures; |
| 144 BackingSet m_backings; | 142 BackingSet m_backings; |
| 145 BackingVector m_evictedBackings; | 143 BackingVector m_evictedBackings; |
| 146 | 144 |
| 147 TextureVector m_tempTextureVector; | 145 TextureVector m_tempTextureVector; |
| 148 BackingVector m_tempBackingVector; | 146 BackingVector m_tempBackingVector; |
| 149 | 147 |
| 150 // Set by the main thread when it adjust priorities in such a way that | 148 // Set by the main thread when it adjust priorities in such a way that |
| 151 // the m_backings array's view of priorities is now out of date. | 149 // the m_backings array's view of priorities is now out of date. |
| 152 bool m_needsUpdateBackingsPrioritites; | 150 bool m_needsUpdateBackingsPrioritites; |
| 153 | 151 |
| 154 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager); | 152 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager); |
| 155 }; | 153 }; |
| 156 | 154 |
| 157 } // namespace cc | 155 } // namespace cc |
| 158 | 156 |
| 159 #endif | 157 #endif |
| OLD | NEW |