Added scratch buffer and use the modifed drawFilledRect() (see libopenui#15)

This commit is contained in:
Raphael Coeffic
2021-05-06 12:55:59 +02:00
committed by Raphael Coeffic
parent b992cc773b
commit 06335e596d
3 changed files with 20 additions and 4 deletions
+6 -4
View File
@@ -110,12 +110,14 @@ ViewMainMenu::ViewMainMenu(Window* parent) :
carousel->setFocus();
}
uint16_t* lcdGetBackupBuffer();
void ViewMainMenu::paint(BitmapBuffer* dc)
{
rect_t r = carouselRect;
r.x -= 8; r.y -= 8;
r.w += 16; r.h += 16;
dc->drawFilledRect(r.x, r.y, r.w, r.h, SOLID, OVERLAY_COLOR, OPACITY(5));
rect_t zone = carouselRect;
zone.x -= 8; zone.y -= 8;
zone.w += 16; zone.h += 16;
dc->drawFilledRect(zone.x, zone.y, zone.w, zone.h, SOLID, OVERLAY_COLOR, OPACITY(5));
}
void ViewMainMenu::deleteLater(bool detach, bool trash)
+7
View File
@@ -46,6 +46,7 @@
uint8_t LCD_FIRST_FRAME_BUFFER[DISPLAY_BUFFER_SIZE * sizeof(pixel_t)] __SDRAM;
uint8_t LCD_SECOND_FRAME_BUFFER[DISPLAY_BUFFER_SIZE * sizeof(pixel_t)] __SDRAM;
uint8_t LCD_BACKUP_FRAME_BUFFER[DISPLAY_BUFFER_SIZE * sizeof(pixel_t)] __SDRAM;
uint8_t LCD_SCRATCH_FRAME_BUFFER[DISPLAY_BUFFER_SIZE * sizeof(pixel_t)] __SDRAM;
uint8_t currentLayer = LCD_FIRST_LAYER;
BitmapBuffer lcdBuffer1(BMP_RGB565, LCD_W, LCD_H, (uint16_t *)LCD_FIRST_FRAME_BUFFER);
@@ -453,6 +454,7 @@ void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_
srcy = srch - (srcy + h);
#endif
TRACE("------");
DMA2D_DeInit();
DMA2D_InitTypeDef DMA2D_InitStruct;
@@ -575,6 +577,11 @@ uint16_t* lcdGetBackupBuffer()
return (uint16_t*)LCD_BACKUP_FRAME_BUFFER;
}
uint16_t* lcdGetScratchBuffer()
{
return (uint16_t*)LCD_SCRATCH_FRAME_BUFFER;
}
void lcdRefresh()
{
if (currentLayer == LCD_FIRST_LAYER) {
+7
View File
@@ -24,9 +24,16 @@
#if defined(COLORLCD)
pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
pixel_t scratchBuf[DISPLAY_BUFFER_SIZE];
BitmapBuffer _lcd(BMP_RGB565, LCD_W, LCD_H, displayBuf);
BitmapBuffer * lcd = &_lcd;
uint16_t * lcdGetScratchBuffer()
{
return static_cast<uint16_t *>(scratchBuf);
}
void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color)
{
#if defined(LCD_VERTICAL_INVERT)