| 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 CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ | 5 #ifndef CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ |
| 6 #define CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ | 6 #define CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 ~PrioritizedResourceManager(); | 46 ~PrioritizedResourceManager(); |
| 47 | 47 |
| 48 typedef std::list<PrioritizedResource::Backing*> BackingList; | 48 typedef std::list<PrioritizedResource::Backing*> BackingList; |
| 49 | 49 |
| 50 // TODO(epenner): (http://crbug.com/137094) This 64MB default is a straggler | 50 // TODO(epenner): (http://crbug.com/137094) This 64MB default is a straggler |
| 51 // from the old texture manager and is just to give us a default memory | 51 // from the old texture manager and is just to give us a default memory |
| 52 // allocation before we get a callback from the GPU memory manager. We | 52 // allocation before we get a callback from the GPU memory manager. We |
| 53 // should probaby either: | 53 // should probaby either: |
| 54 // - wait for the callback before rendering anything instead | 54 // - wait for the callback before rendering anything instead |
| 55 // - push this into the GPU memory manager somehow. | 55 // - push this into the GPU memory manager somehow. |
| 56 static size_t DefaultMemoryAllocationLimit() { return 64 * 1024 * 1024; } | 56 static size_t DefaultMemoryAllocationLimit() { return 128 * 1024 * 1024; } |
| 57 | 57 |
| 58 // MemoryUseBytes() describes the number of bytes used by existing allocated | 58 // MemoryUseBytes() describes the number of bytes used by existing allocated |
| 59 // textures. | 59 // textures. |
| 60 size_t MemoryUseBytes() const { return memory_use_bytes_; } | 60 size_t MemoryUseBytes() const { return memory_use_bytes_; } |
| 61 // MemoryAboveCutoffBytes() describes the number of bytes that | 61 // MemoryAboveCutoffBytes() describes the number of bytes that |
| 62 // would be used if all textures that are above the cutoff were allocated. | 62 // would be used if all textures that are above the cutoff were allocated. |
| 63 // MemoryUseBytes() <= MemoryAboveCutoffBytes() should always be true. | 63 // MemoryUseBytes() <= MemoryAboveCutoffBytes() should always be true. |
| 64 size_t MemoryAboveCutoffBytes() const { return memory_above_cutoff_bytes_; } | 64 size_t MemoryAboveCutoffBytes() const { return memory_above_cutoff_bytes_; } |
| 65 // MaxMemoryNeededBytes() describes the number of bytes that would be used | 65 // MaxMemoryNeededBytes() describes the number of bytes that would be used |
| 66 // by textures if there were no limit on memory usage. | 66 // by textures if there were no limit on memory usage. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // Statistics copied at the time of PushTexturePrioritiesToBackings. | 232 // Statistics copied at the time of PushTexturePrioritiesToBackings. |
| 233 size_t memory_visible_last_pushed_bytes_; | 233 size_t memory_visible_last_pushed_bytes_; |
| 234 size_t memory_visible_and_nearby_last_pushed_bytes_; | 234 size_t memory_visible_and_nearby_last_pushed_bytes_; |
| 235 | 235 |
| 236 DISALLOW_COPY_AND_ASSIGN(PrioritizedResourceManager); | 236 DISALLOW_COPY_AND_ASSIGN(PrioritizedResourceManager); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 } // namespace cc | 239 } // namespace cc |
| 240 | 240 |
| 241 #endif // CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ | 241 #endif // CC_RESOURCES_PRIORITIZED_RESOURCE_MANAGER_H_ |
| OLD | NEW |