Add LV_USE_OUTLINE/PATTERN/VALUE_STR and LV_MEMCPY_MEMSET_STD

This commit is contained in:
Gabor Kiss-Vamosi
2020-08-04 09:19:25 +02:00
parent 85d375b128
commit b58f9c6021
7 changed files with 143 additions and 15 deletions

View File

@@ -30,8 +30,10 @@
LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc);
#if LV_USE_OUTLINE
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
#endif
#if LV_USE_SHADOW
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv_area_t * clip,
lv_draw_rect_dsc_t * dsc);
@@ -39,9 +41,16 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
lv_coord_t r);
LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
#endif
#if LV_USE_PATTERN
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
#endif
#if LV_USE_VALUE_STR
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc);
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip, lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode);
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t grad_get(lv_draw_rect_dsc_t * dsc, lv_coord_t s, lv_coord_t i);
/**********************
* STATIC VARIABLES
@@ -96,10 +105,19 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect
#endif
draw_bg(coords, clip, dsc);
#if LV_USE_PATTERN
draw_pattern(coords, clip, dsc);
#endif
draw_border(coords, clip, dsc);
draw_value(coords, clip, dsc);
#if LV_USE_VALUE_STR
draw_value_str(coords, clip, dsc);
#endif
#if LV_USE_OUTLINE
draw_outline(coords, clip, dsc);
#endif
LV_ASSERT_MEM_INTEGRITY();
}
@@ -1128,6 +1146,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t
#endif
#if LV_USE_OUTLINE
static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
{
if(dsc->outline_opa <= LV_OPA_MIN) return;
@@ -1155,7 +1174,10 @@ static void draw_outline(const lv_area_t * coords, const lv_area_t * clip, lv_dr
draw_full_border(&area_inner, &area_outer, clip, dsc->radius, dsc->outline_color, dsc->outline_opa, dsc->outline_blend_mode);
}
#endif
#if LV_USE_PATTERN
static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
{
if(dsc->pattern_image == NULL) return;
@@ -1256,9 +1278,11 @@ static void draw_pattern(const lv_area_t * coords, const lv_area_t * clip, lv_dr
lv_draw_mask_remove_id(radius_mask_id);
}
}
#endif
static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
#if LV_USE_VALUE_STR
static void draw_value_str(const lv_area_t * coords, const lv_area_t * clip, lv_draw_rect_dsc_t * dsc)
{
if(dsc->value_str == NULL) return;
if(dsc->value_opa <= LV_OPA_MIN) return;
@@ -1291,6 +1315,7 @@ static void draw_value(const lv_area_t * coords, const lv_area_t * clip, lv_draw
lv_draw_label(&value_area, clip, &label_dsc, dsc->value_str, NULL);
}
#endif
static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * area_outer, const lv_area_t * clip, lv_coord_t radius, lv_color_t color, lv_opa_t opa, lv_blend_mode_t blend_mode)
{