Replies: 2 comments
-
It won't be quicker to draw to screen as the CPU needs to convert the entire GFX 'canvas' into the DMA bitstream output that is sent to the physical HUB75 panel, for each individual panel. Essentially you just move the heavy DMA buffer change processing to a one big batch. With DMA double buffering the changes to the dma buffer are made on a pixel by pixel basis as requested, and done so in the background in the secondary off-screen dma buffer. With the GFX Canvas, theoretically with a big chain of displays you might actually see it refresh/ redraw the display from top right to bottom left. With DMA buffering, 'flipping' to the other buffer happens instantaneously as everything has already been calculated. However, the DMA bitstream buffer is likely to use more memory, so you will save memory perhaps (using the GFX canvas). I hope this makes sense. |
Beta Was this translation helpful? Give feedback.
-
Can you tell me what GFXcanvas library you use |
Beta Was this translation helpful? Give feedback.
-
Hello people,
I have a project that uses double buffering. Since DB takes up quite some memory and drawpixel on dma buffer is not a simple operation, I tried to get the buffering done with the following code, which works for me:
`GFXcanvas16 *canvas = NULL;
void drawImage()
{
// create new canvas16 for buffer, if needed
if (canvas == NULL)
canvas = new GFXcanvas16(128, 32);
// just draw some silly things
uint8_t xpos = beatsin8(20, 0, 128);
uint8_t radius = beatsin8(3, 1, 15);
canvas->fillScreen(0);
canvas->drawCircle(xpos, 10, radius, dma_display->color565(255, 0, 0));
canvas->drawCircle(xpos - 5, 10, radius / 2, dma_display->color565(0, 255, 0));
canvas->drawCircle(xpos + 5, 10, radius / 3, dma_display->color565(0, 0, 255));
// put canvas to display
dma_display->drawRGBBitmap(0, 0, canvas->getBuffer(), 128, 32);
}`
This should draw faster and use less memory than using the integrated double buffering, or am I thinking wrong way here? Please share your thoughts on this.
Beta Was this translation helpful? Give feedback.
All reactions