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

◆ onQueuingDone()

bool fl::RectangularDrawBuffer::onQueuingDone ( )

Definition at line 48 of file rectangular_draw_buffer.cpp.

48 {
49 if (mQueueState == QUEUE_DONE) {
50 return false;
51 }
54 // iterator through the current draw objects and calculate the total
55 // number of bytes (representing RGB or RGBW) that will be drawn this frame.
56 uint32_t total_bytes = 0;
57 uint32_t max_bytes_in_strip = 0;
58 uint32_t num_strips = 0;
59 getBlockInfo(&num_strips, &max_bytes_in_strip, &total_bytes);
60 if (total_bytes > mAllLedsBufferUint8Size) {
61 uint8_t* old_ptr = mAllLedsBufferUint8.release();
63 uint8_t* ptr = fl::LargeBlockAllocator<uint8_t>::Alloc(total_bytes);
64 mAllLedsBufferUint8.reset(ptr);
65 }
66 mAllLedsBufferUint8Size = total_bytes;
67 uint32_t offset = 0;
68 for (auto it = mDrawList.begin(); it != mDrawList.end(); ++it) {
69 uint8_t pin = it->mPin;
70 Slice<uint8_t> slice(mAllLedsBufferUint8.get() + offset,
71 max_bytes_in_strip);
72 mPinToLedSegment[pin] = slice;
73 offset += max_bytes_in_strip;
74 }
75 return true;
76}
static T * Alloc(size_t n)
Definition allocator.h:18
static void Free(T *p)
Definition allocator.h:23
void getBlockInfo(uint32_t *num_strips, uint32_t *bytes_per_strip, uint32_t *total_bytes) const
fl::FixedMap< uint8_t, fl::Slice< uint8_t >, 50 > mPinToLedSegment
scoped_array< uint8_t > mAllLedsBufferUint8

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

+ Here is the call graph for this function: