How to use off screen rendering of a textarea in a ARGB8888 bitmap
Working on a STM32H7B3I-DK with a LCD16 (565) frame buffer. I would like to render a text field in an offscreen bitmap to be able to show it in a ScalableImage. For this I will use the drawToDynamicBitmap function. It works if the dynamic bitmap is created as Bitmap::RGB565
but then the text is drawn on a solid background.
If I want a transparent background I need to create the dynamic bitmap with ARGB8888. After some search and tries I found that I had to register a LCD32bpp class and set it as Auxiliary LCD in the hal. The first problem is that the 32bits pixels are not handled by the STM32DMA.cpp code provided (only RGB565 and RGB888 are supported). After some tweak in the SetupDataCopy(blitOp) function in this source file, I managed to have the DMA2D to write correctly in the dynamic bitmap with 32 bits pixels.... but this only works when I run the code in the debugger with a breakpoint in the SetupDataCopy. If I let it run full speed I only get the first 3 letters properly rendered (using 32 bits pixels) but the remaining letters are rendered with 16 bits pixels (the format used for the framebuffer LCD16).
The problem comes from the line 'uint8_t bitDepth = HAL::lcd().bitDepth();' in the beginning of the SetupDataCopy that should provide the LCD class to be used for the blit operation. When calling drawToDynamicBitmap, the bitDepth is reported correctly as 32 for the first 3 calls to SetupDataCopy but after that the bitDepth is 16 !! It looks like the variable useAuxiliaryLCD was changed at a wrong time
'
