| 268 | } |
| 269 | |
| 270 | void Atlas::removeExpiredKeys() { |
| 271 | constexpr size_t kMaxKeys = 20000; |
| 272 | if (cellLocators.size() < kMaxKeys || expiredKeys.empty()) { |
| 273 | return; |
| 274 | } |
| 275 | for (auto it = cellLocators.begin(); it != cellLocators.end();) { |
| 276 | if (expiredKeys.find(it->first) != expiredKeys.end()) { |
| 277 | it = cellLocators.erase(it); |
| 278 | } else { |
| 279 | ++it; |
| 280 | } |
| 281 | } |
| 282 | expiredKeys.clear(); |
| 283 | } |
| 284 | |
| 285 | AtlasConfig::AtlasConfig(int maxTextureSize) { |
| 286 | RGBADimensions.set(std::min(MaxTextureSize, maxTextureSize), |