| 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 "CCPrioritizedTexture.h" | 8 #include "CCPrioritizedTexture.h" |
| 9 #include "CCPriorityCalculator.h" | 9 #include "CCPriorityCalculator.h" |
| 10 #include "CCTexture.h" | 10 #include "CCTexture.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 size_t memoryAboveCutoffBytes() const { return m_memoryAboveCutoffBytes; } | 50 size_t memoryAboveCutoffBytes() const { return m_memoryAboveCutoffBytes; } |
| 51 size_t memoryForSelfManagedTextures() const { return m_maxMemoryLimitBytes -
m_memoryAvailableBytes; } | 51 size_t memoryForSelfManagedTextures() const { return m_maxMemoryLimitBytes -
m_memoryAvailableBytes; } |
| 52 | 52 |
| 53 void setMaxMemoryLimitBytes(size_t bytes) { m_maxMemoryLimitBytes = bytes; } | 53 void setMaxMemoryLimitBytes(size_t bytes) { m_maxMemoryLimitBytes = bytes; } |
| 54 size_t maxMemoryLimitBytes() const { return m_maxMemoryLimitBytes; } | 54 size_t maxMemoryLimitBytes() const { return m_maxMemoryLimitBytes; } |
| 55 | 55 |
| 56 void prioritizeTextures(); | 56 void prioritizeTextures(); |
| 57 void clearPriorities(); | 57 void clearPriorities(); |
| 58 | 58 |
| 59 void reduceMemoryOnImplThread(size_t limitBytes, CCResourceProvider*); | 59 void reduceMemoryOnImplThread(size_t limitBytes, CCResourceProvider*); |
| 60 bool evictedBackingsExist() const { return !m_evictedBackings.isEmpty(); } |
| 60 void getEvictedBackings(BackingVector& evictedBackings); | 61 void getEvictedBackings(BackingVector& evictedBackings); |
| 61 void unlinkEvictedBackings(const BackingVector& evictedBackings); | 62 void unlinkEvictedBackings(const BackingVector& evictedBackings); |
| 62 // Deletes all evicted backings, unlinking them from their owning textures i
f needed. | 63 // Deletes all evicted backings, unlinking them from their owning textures i
f needed. |
| 63 // Returns true if this function to unlinked any backings from their owning
texture while | 64 // Returns true if this function unlinked any backings from their owning tex
ture while |
| 64 // destroying them. | 65 // destroying them. |
| 65 bool deleteEvictedBackings(); | 66 bool deleteEvictedBackings(); |
| 66 | 67 |
| 67 bool requestLate(CCPrioritizedTexture*); | 68 bool requestLate(CCPrioritizedTexture*); |
| 68 | 69 |
| 69 void reduceMemory(CCResourceProvider*); | 70 void reduceMemory(CCResourceProvider*); |
| 70 void clearAllMemory(CCResourceProvider*); | 71 void clearAllMemory(CCResourceProvider*); |
| 71 | 72 |
| 72 void acquireBackingTextureIfNeeded(CCPrioritizedTexture*, CCResourceProvider
*); | 73 void acquireBackingTextureIfNeeded(CCPrioritizedTexture*, CCResourceProvider
*); |
| 73 | 74 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 BackingVector m_tempBackingVector; | 137 BackingVector m_tempBackingVector; |
| 137 | 138 |
| 138 // Set by the main thread when it adjust priorities in such a way that | 139 // Set by the main thread when it adjust priorities in such a way that |
| 139 // the m_backings array's view of priorities is now out of date. | 140 // the m_backings array's view of priorities is now out of date. |
| 140 bool m_needsUpdateBackingsPrioritites; | 141 bool m_needsUpdateBackingsPrioritites; |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 } // cc | 144 } // cc |
| 144 | 145 |
| 145 #endif | 146 #endif |
| OLD | NEW |