| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 static PassOwnPtr<TextureManager> create(size_t maxMemoryLimitBytes, size_t
preferredMemoryLimitBytes, int maxTextureSize) | 55 static PassOwnPtr<TextureManager> create(size_t maxMemoryLimitBytes, size_t
preferredMemoryLimitBytes, int maxTextureSize) |
| 56 { | 56 { |
| 57 return adoptPtr(new TextureManager(maxMemoryLimitBytes, preferredMemoryL
imitBytes, maxTextureSize)); | 57 return adoptPtr(new TextureManager(maxMemoryLimitBytes, preferredMemoryL
imitBytes, maxTextureSize)); |
| 58 } | 58 } |
| 59 ~TextureManager(); | 59 ~TextureManager(); |
| 60 | 60 |
| 61 // Absolute maximum limit for texture allocations for this instance. | 61 // Absolute maximum limit for texture allocations for this instance. |
| 62 static size_t highLimitBytes(const IntSize& viewportSize); | 62 static size_t highLimitBytes(const IntSize& viewportSize); |
| 63 // Preferred texture size limit given the viewport size. | 63 // Preferred texture size limit given the viewport size. |
| 64 static size_t reclaimLimitBytes(const IntSize& viewportSize); | 64 static size_t reclaimLimitBytes(const IntSize& viewportSize); |
| 65 // The maximum texture memory usage when asked to release textures. | |
| 66 static size_t lowLimitBytes(const IntSize& viewport); | |
| 67 | 65 |
| 68 static size_t memoryUseBytes(const IntSize&, GC3Denum format); | 66 static size_t memoryUseBytes(const IntSize&, GC3Denum format); |
| 69 | 67 |
| 70 void setMaxMemoryLimitBytes(size_t); | 68 void setMaxMemoryLimitBytes(size_t); |
| 71 size_t maxMemoryLimitBytes() { return m_maxMemoryLimitBytes; } | 69 size_t maxMemoryLimitBytes() { return m_maxMemoryLimitBytes; } |
| 72 void setPreferredMemoryLimitBytes(size_t); | 70 void setPreferredMemoryLimitBytes(size_t); |
| 73 size_t preferredMemoryLimitBytes() { return m_preferredMemoryLimitBytes; } | 71 size_t preferredMemoryLimitBytes() { return m_preferredMemoryLimitBytes; } |
| 74 | 72 |
| 75 void registerTexture(ManagedTexture*); | 73 void registerTexture(ManagedTexture*); |
| 76 void unregisterTexture(ManagedTexture*); | 74 void unregisterTexture(ManagedTexture*); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 TextureAllocator* allocator; | 129 TextureAllocator* allocator; |
| 132 #endif | 130 #endif |
| 133 }; | 131 }; |
| 134 | 132 |
| 135 Vector<EvictionEntry> m_evictedTextures; | 133 Vector<EvictionEntry> m_evictedTextures; |
| 136 }; | 134 }; |
| 137 | 135 |
| 138 } | 136 } |
| 139 | 137 |
| 140 #endif | 138 #endif |
| OLD | NEW |