mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
improve DMA2D blending dupport
This commit is contained in:
parent
b056315410
commit
19c3f9306f
@ -318,12 +318,13 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/*Software rendering*/
|
||||
for(y = 0; y < draw_area_h; y++) {
|
||||
@ -345,6 +346,26 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
if(lv_area_get_size(draw_area) >= 240) {
|
||||
static lv_color_t blend_buf[LV_HOR_RES_MAX] = {0};
|
||||
if(blend_buf[0].full != color.full) lv_color_fill(blend_buf, color, LV_HOR_RES_MAX);
|
||||
|
||||
lv_coord_t line_h = LV_HOR_RES_MAX / draw_area_w;
|
||||
for(y = 0; y <= draw_area_h - line_h; y += line_h) {
|
||||
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, blend_buf, opa, draw_area_w, draw_area_w, line_h);
|
||||
disp_buf_first += disp_w * line_h;
|
||||
}
|
||||
|
||||
if(y != draw_area_h) {
|
||||
lv_gpu_stm32_dma2d_blend(disp_buf_first, disp_w, blend_buf, opa, draw_area_w, draw_area_w, draw_area_h - y);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lv_color_t last_dest_color = LV_COLOR_BLACK;
|
||||
lv_color_t last_res_color = lv_color_mix(color, last_dest_color, opa);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user