( bitmapCache: FrustumBitmapCache, imageName: string, now = Date.now )
| 40 | } |
| 41 | |
| 42 | export function getCachedFrustumBitmap( |
| 43 | bitmapCache: FrustumBitmapCache, |
| 44 | imageName: string, |
| 45 | now = Date.now |
| 46 | ): ImageBitmap | null { |
| 47 | const cached = bitmapCache.get(imageName); |
| 48 | if (!cached) return null; |
| 49 | |
| 50 | cached.lastUsed = now(); |
| 51 | return cached.bitmap; |
| 52 | } |
| 53 | |
| 54 | export async function getOrLoadFrustumBitmap( |
| 55 | url: string, |
no test coverage detected