FastLED 3.9.15
Loading...
Searching...
No Matches

◆ onQueuingDone()

bool fl::RectangularDrawBuffer::onQueuingDone ( )

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

50 {
51 if (mQueueState == QUEUE_DONE) {
52 return false;
53 }
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();
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}
static void Free(T *p) FL_NOEXCEPT
Definition allocator.h:124
static T * Alloc(fl::size n) FL_NOEXCEPT
Definition allocator.h:119
fl::flat_map< u8, fl::span< u8 > > mPinToLedSegment
unique_ptr< u8[], PSRamDeleter< u8 > > mAllLedsBufferUint8
void getBlockInfo(u32 *num_strips, u32 *bytes_per_strip, u32 *total_bytes) const
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::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: