/* Draw a polygon from triangles. Only convex polygons are supported  */
void lv_draw_polygon(const lv_point_t *points, uint32_t point_cnt, const lv_area_t *mask, const lv_style_t *style, lv_opa_t opa_scale)
/* Draw a polygon from triangles. Only convex polygons are supported  */
void lv_draw_polygon(const lv_point_t *points, uint32_t point_cnt, const lv_area_t *mask, const lv_style_t *style, lv_opa_t opa_scale)
{
    if(point_cnt < 3) return;
    if(points == NULL) return;
    uint32_t i;
    lv_point_t tri[3];
    tri[0].x = points[0].x;
    tri[0].y = points[0].y;
    for(i = 0; i < point_cnt - 1; i++) {
        tri[1].x = points[i].x;
        tri[1].y = points[i].y;
        tri[2].x = points[i + 1].x;
        tri[2].y = points[i + 1].y;
        lv_draw_triangle(tri, mask, style, opa_scale);
    }
}