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

Method onQueuingDone

src/fl/gfx/rectangular_draw_buffer.cpp.hpp:50–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50bool RectangularDrawBuffer::onQueuingDone() {
51 if (mQueueState == QUEUE_DONE) {
52 return false;
53 }
54 mQueueState = QUEUE_DONE;
55 mDrawListChangedThisFrame = mDrawList != mPrevDrawList;
56 // iterator through the current draw objects and calculate the total
57 // number of bytes (representing RGB or RGBW) that will be drawn this frame.
58 u32 total_bytes = 0;
59 u32 max_bytes_in_strip = 0;
60 u32 num_strips = 0;
61 getBlockInfo(&num_strips, &max_bytes_in_strip, &total_bytes);
62 if (total_bytes > mAllLedsBufferUint8Size) {
63 u8 *old_ptr = mAllLedsBufferUint8.release();
64 fl::PSRamAllocator<u8>::Free(old_ptr);
65 u8 *ptr = fl::PSRamAllocator<u8>::Alloc(total_bytes);
66 mAllLedsBufferUint8.reset(ptr);
67 }
68 mAllLedsBufferUint8Size = total_bytes;
69 u32 offset = 0;
70 for (auto it = mDrawList.begin(); it != mDrawList.end(); ++it) {
71 u8 pin = it->mPin;
72 span<u8> slice(mAllLedsBufferUint8.get() + offset,
73 max_bytes_in_strip);
74 mPinToLedSegment[pin] = slice;
75 offset += max_bytes_in_strip;
76 }
77 return true;
78}
79
80u32 RectangularDrawBuffer::getMaxBytesInStrip() const {
81 u32 max_bytes = 0;

Callers 1

FL_TEST_FILEFunction · 0.45

Calls 6

FreeFunction · 0.85
releaseMethod · 0.45
resetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected