FastLED 3.10.8
Loading...
Searching...
No Matches

◆ onQueuingDone()

bool fl::RectangularDrawBuffer::onQueuingDone ( )

Definition at line 51 of file rectangular_draw_buffer.cpp.hpp.

51 {
52 if (mQueueState == QUEUE_DONE) {
53 return false;
54 }
57 // iterator through the current draw objects and calculate the total
58 // number of bytes (representing RGB or RGBW) that will be drawn this frame.
59 u32 total_bytes = 0;
60 u32 max_bytes_in_strip = 0;
61 u32 num_strips = 0;
62 getBlockInfo(&num_strips, &max_bytes_in_strip, &total_bytes);
63 if (total_bytes > mAllLedsBufferUint8Size) {
64 u8 *old_ptr = mAllLedsBufferUint8.release();
66 u8 *ptr = fl::PSRamAllocator<u8>::Alloc(total_bytes);
67 mAllLedsBufferUint8.reset(ptr);
68 }
69 mAllLedsBufferUint8Size = total_bytes;
70 u32 offset = 0;
71 for (auto it = mDrawList.begin(); it != mDrawList.end(); ++it) {
72 u8 pin = it->mPin;
73 span<u8> slice(mAllLedsBufferUint8.get() + offset,
74 max_bytes_in_strip);
75 mPinToLedSegment[pin] = slice;
76 offset += max_bytes_in_strip;
77 }
78 return true;
79}
static T * Alloc(fl::size n) FL_NO_EXCEPT
Definition allocator.h:120
static void Free(T *p) FL_NO_EXCEPT
Definition allocator.h:125
void getBlockInfo(u32 *num_strips, u32 *bytes_per_strip, u32 *total_bytes) const FL_NO_EXCEPT
fl::flat_map< u8, fl::span< u8 > > mPinToLedSegment
unique_ptr< u8[], PSRamDeleter< u8 > > mAllLedsBufferUint8
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
unsigned char u8
Definition stdint.h:131

References fl::PSRamAllocator< T >::Alloc(), fl::FL_NO_EXCEPT, fl::PSRamAllocator< T >::Free(), getBlockInfo(), mAllLedsBufferUint8, mAllLedsBufferUint8Size, mDrawList, mDrawListChangedThisFrame, mPinToLedSegment, mPrevDrawList, mQueueState, offset(), and QUEUE_DONE.

Referenced by ~RectangularDrawBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: