| 285 | } |
| 286 | |
| 287 | void Corkscrew::clear() { |
| 288 | // Clear input surface if it exists |
| 289 | if (mInputSurface) { |
| 290 | mInputSurface->clear(); |
| 291 | // Don't reset the shared_ptr - the test expects the surface to remain valid |
| 292 | // The surface is cleared but the memory is not freed |
| 293 | } |
| 294 | |
| 295 | // Clear pixel storage if we own it (vector variant) |
| 296 | if (!mPixelStorage.empty()) { |
| 297 | if (mPixelStorage.template is<fl::vector_psram<CRGB>>()) { |
| 298 | auto& vec = mPixelStorage.template get<fl::vector_psram<CRGB>>(); |
| 299 | vec.clear(); |
| 300 | // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory |
| 301 | } |
| 302 | // Note: Don't clear external spans as we don't own that memory |
| 303 | } |
| 304 | |
| 305 | // Clear tile cache |
| 306 | mTileCache.clear(); |
| 307 | // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory |
| 308 | mCacheInitialized = false; |
| 309 | } |
| 310 | |
| 311 | void Corkscrew::fillInputSurface(const CRGB& color) { |
| 312 | auto target_surface = getOrCreateInputSurface(); |
no test coverage detected