feat(draw): add draw_bg callback to draw_ctx #2934 (#2935)

* this is for #2934
reduced usage of blend mode
introduced draw_bg for draw_ctx

* fixed formatting
This commit is contained in:
Mariotaku
2021-12-23 03:03:44 +09:00
committed by GitHub
parent 4d61f38020
commit fc25194ed5
11 changed files with 132 additions and 45 deletions

View File

@@ -46,7 +46,6 @@ static void map_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_c
static inline lv_color_t color_blend_true_color_additive(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
static inline lv_color_t color_blend_true_color_multiply(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
static inline lv_color_t color_blend_true_color_replace(lv_color_t fg, lv_color_t bg, lv_opa_t opa);
#endif /*LV_DRAW_COMPLEX*/
/**********************
@@ -384,9 +383,6 @@ static void fill_blended(lv_color_t * dest_buf, const lv_area_t * dest_area,
case LV_BLEND_MODE_MULTIPLY:
blend_fp = color_blend_true_color_multiply;
break;
case LV_BLEND_MODE_REPLACE:
blend_fp = color_blend_true_color_replace;
break;
default:
LV_LOG_WARN("fill_blended: unsupported blend mode");
return;
@@ -623,9 +619,6 @@ static void map_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_c
case LV_BLEND_MODE_MULTIPLY:
blend_fp = color_blend_true_color_multiply;
break;
case LV_BLEND_MODE_REPLACE:
blend_fp = color_blend_true_color_replace;
break;
default:
LV_LOG_WARN("fill_blended: unsupported blend mode");
return;
@@ -760,12 +753,5 @@ static inline lv_color_t color_blend_true_color_multiply(lv_color_t fg, lv_color
return lv_color_mix(fg, bg, opa);
}
static inline lv_color_t color_blend_true_color_replace(lv_color_t fg, lv_color_t bg, lv_opa_t opa)
{
LV_UNUSED(bg);
LV_UNUSED(opa);
return fg;
}
#endif