MCPcopy Create free account
hub / github.com/FastLED/FastLED / clear

Method clear

src/fl/gfx/corkscrew.cpp.hpp:287–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287void 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
311void Corkscrew::fillInputSurface(const CRGB& color) {
312 auto target_surface = getOrCreateInputSurface();

Callers 11

drawColorMethod · 0.45
drawGradientMethod · 0.45
XYRasterU8SparseClass · 0.45
writeMethod · 0.45
XYRasterSparse_RGB8Class · 0.45
writeMethod · 0.45
onQueuingStartMethod · 0.45
clearFunction · 0.45
setCachingEnabledMethod · 0.45
readFromMethod · 0.45
readFromMultiMethod · 0.45

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected