improve lcd

This commit is contained in:
xianjimli 2020-06-15 11:14:39 +08:00
parent 5e5bcf0a3b
commit 9cf373963f
3 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,7 @@
* 2020/06/15
* 完善toast (感谢培煌提供补丁)
* 修复旋转后online\_fb的line\_length不正确的问(感谢智明提供补丁)。
* 2020/06/14
* 完善 scroll view增加滚动相关事件。
@ -19,7 +20,7 @@
* 增加 app\_conf\_set\_wstr/app\_conf\_get\_wstr
* 完善 window\_manager\_back\_to\_home 对软键盘窗口的处理。
* 增加 object\_locker 对 object 进行装饰,提供互斥的功能。
* 用 app_conf 重新实现 object\_locker。
* 用 object\_locker 重新实现 app\_conf
* 2020/06/11
* 完善 conf\_io支持#name/#size

View File

@ -34,6 +34,7 @@ typedef struct _lcd_mem_t {
uint8_t* next_fb;
vgcanvas_t* vgcanvas;
uint32_t online_line_length;
uint32_t line_length;
bitmap_format_t format;
bool_t own_offline_fb;
@ -43,7 +44,7 @@ typedef struct _lcd_mem_t {
} lcd_mem_t;
#define lcd_mem_set_line_length(lcd, value) ((lcd_mem_t*)lcd)->line_length = value;
#define lcd_mem_set_line_length(lcd, value) ((lcd_mem_t*)lcd)->line_length = ((lcd_mem_t*)lcd)->offline_line_length = value;
END_C_DECLS

View File

@ -53,6 +53,7 @@ static bitmap_t* lcd_mem_init_online_fb(lcd_t* lcd, bitmap_t* fb, lcd_orientatio
uint32_t w = 0;
uint32_t h = 0;
lcd_mem_t* mem = (lcd_mem_t*)lcd;
uint32_t bpp = bitmap_get_bpp_of_format(LCD_FORMAT);
if (o == LCD_ORIENTATION_0 || o == LCD_ORIENTATION_180) {
w = lcd->w;
@ -68,7 +69,7 @@ static bitmap_t* lcd_mem_init_online_fb(lcd_t* lcd, bitmap_t* fb, lcd_orientatio
fb->buffer = mem->online_gb;
fb->format = mem->format;
graphic_buffer_attach(mem->online_gb, mem->online_fb);
bitmap_set_line_length(fb, lcd_mem_get_line_length(mem));
bitmap_set_line_length(fb, tk_max(fb->w * bpp, mem->online_line_length));
return fb;
}
@ -384,6 +385,7 @@ static lcd_t* lcd_mem_create(wh_t w, wh_t h, bool_t alloc) {
lcd->format = LCD_FORMAT;
lcd->line_length = w * bpp;
lcd->online_line_length = lcd->line_length;
lcd->online_gb = graphic_buffer_create_with_data(NULL, w, h, LCD_FORMAT);
lcd->offline_gb = graphic_buffer_create_with_data(NULL, w, h, LCD_FORMAT);