Added scratch buffer and use the modifed drawFilledRect() (see libopenui#15)
This commit is contained in:
committed by
Raphael Coeffic
parent
b992cc773b
commit
06335e596d
@@ -110,12 +110,14 @@ ViewMainMenu::ViewMainMenu(Window* parent) :
|
|||||||
carousel->setFocus();
|
carousel->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t* lcdGetBackupBuffer();
|
||||||
|
|
||||||
void ViewMainMenu::paint(BitmapBuffer* dc)
|
void ViewMainMenu::paint(BitmapBuffer* dc)
|
||||||
{
|
{
|
||||||
rect_t r = carouselRect;
|
rect_t zone = carouselRect;
|
||||||
r.x -= 8; r.y -= 8;
|
zone.x -= 8; zone.y -= 8;
|
||||||
r.w += 16; r.h += 16;
|
zone.w += 16; zone.h += 16;
|
||||||
dc->drawFilledRect(r.x, r.y, r.w, r.h, SOLID, OVERLAY_COLOR, OPACITY(5));
|
dc->drawFilledRect(zone.x, zone.y, zone.w, zone.h, SOLID, OVERLAY_COLOR, OPACITY(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewMainMenu::deleteLater(bool detach, bool trash)
|
void ViewMainMenu::deleteLater(bool detach, bool trash)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
uint8_t LCD_FIRST_FRAME_BUFFER[DISPLAY_BUFFER_SIZE * sizeof(pixel_t)] __SDRAM;
|
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_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_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;
|
uint8_t currentLayer = LCD_FIRST_LAYER;
|
||||||
|
|
||||||
BitmapBuffer lcdBuffer1(BMP_RGB565, LCD_W, LCD_H, (uint16_t *)LCD_FIRST_FRAME_BUFFER);
|
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);
|
srcy = srch - (srcy + h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TRACE("------");
|
||||||
DMA2D_DeInit();
|
DMA2D_DeInit();
|
||||||
|
|
||||||
DMA2D_InitTypeDef DMA2D_InitStruct;
|
DMA2D_InitTypeDef DMA2D_InitStruct;
|
||||||
@@ -575,6 +577,11 @@ uint16_t* lcdGetBackupBuffer()
|
|||||||
return (uint16_t*)LCD_BACKUP_FRAME_BUFFER;
|
return (uint16_t*)LCD_BACKUP_FRAME_BUFFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t* lcdGetScratchBuffer()
|
||||||
|
{
|
||||||
|
return (uint16_t*)LCD_SCRATCH_FRAME_BUFFER;
|
||||||
|
}
|
||||||
|
|
||||||
void lcdRefresh()
|
void lcdRefresh()
|
||||||
{
|
{
|
||||||
if (currentLayer == LCD_FIRST_LAYER) {
|
if (currentLayer == LCD_FIRST_LAYER) {
|
||||||
|
|||||||
@@ -24,9 +24,16 @@
|
|||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
|
|
||||||
pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
|
pixel_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
|
pixel_t scratchBuf[DISPLAY_BUFFER_SIZE];
|
||||||
|
|
||||||
BitmapBuffer _lcd(BMP_RGB565, LCD_W, LCD_H, displayBuf);
|
BitmapBuffer _lcd(BMP_RGB565, LCD_W, LCD_H, displayBuf);
|
||||||
BitmapBuffer * lcd = &_lcd;
|
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)
|
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)
|
#if defined(LCD_VERTICAL_INVERT)
|
||||||
|
|||||||
Reference in New Issue
Block a user