aboutsummaryrefslogtreecommitdiff
path: root/src/draw/lv_draw_vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw/lv_draw_vector.c')
-rw-r--r--src/draw/lv_draw_vector.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/draw/lv_draw_vector.c b/src/draw/lv_draw_vector.c
index bcf3ced7e..d6d3cdfa7 100644
--- a/src/draw/lv_draw_vector.c
+++ b/src/draw/lv_draw_vector.c
@@ -4,9 +4,11 @@
*/
/*********************
-* INCLUDES
+ * INCLUDES
*********************/
-#include "lv_draw_vector.h"
+#include "../misc/lv_area_private.h"
+#include "lv_draw_private.h"
+#include "lv_draw_vector_private.h"
#if LV_USE_VECTOR_GRAPHIC
@@ -26,7 +28,7 @@
#define MATH_DEGREES(rad) ((rad) * RAD_TO_DEG)
/*********************
-* DEFINES
+ * DEFINES
*********************/
#ifndef M_PI
@@ -44,16 +46,16 @@
} while(0)
/**********************
-* TYPEDEFS
+ * TYPEDEFS
**********************/
typedef struct {
lv_vector_path_t * path;
lv_vector_draw_dsc_t dsc;
-} _lv_vector_draw_task;
+} lv_vector_draw_task;
/**********************
-* STATIC PROTOTYPES
+ * STATIC PROTOTYPES
**********************/
static void _copy_draw_dsc(lv_vector_draw_dsc_t * dst, const lv_vector_draw_dsc_t * src)
@@ -81,7 +83,7 @@ static void _copy_draw_dsc(lv_vector_draw_dsc_t * dst, const lv_vector_draw_dsc_
lv_area_copy(&(dst->scissor_area), &(src->scissor_area));
}
/**********************
-* GLOBAL FUNCTIONS
+ * GLOBAL FUNCTIONS
**********************/
void lv_matrix_transform_point(const lv_matrix_t * matrix, lv_fpoint_t * point)
@@ -109,7 +111,7 @@ lv_vector_path_t * lv_vector_path_create(lv_vector_path_quality_t quality)
LV_ASSERT_MALLOC(path);
lv_memzero(path, sizeof(lv_vector_path_t));
path->quality = quality;
- lv_array_init(&path->ops, 8, sizeof(uint8_t));
+ lv_array_init(&path->ops, 8, sizeof(lv_vector_path_op_t));
lv_array_init(&path->points, 8, sizeof(lv_fpoint_t));
return path;
}
@@ -138,7 +140,7 @@ void lv_vector_path_move_to(lv_vector_path_t * path, const lv_fpoint_t * p)
{
CHECK_AND_RESIZE_PATH_CONTAINER(path, 1);
- uint8_t op = LV_VECTOR_PATH_OP_MOVE_TO;
+ lv_vector_path_op_t op = LV_VECTOR_PATH_OP_MOVE_TO;
lv_array_push_back(&path->ops, &op);
lv_array_push_back(&path->points, p);
}
@@ -152,7 +154,7 @@ void lv_vector_path_line_to(lv_vector_path_t * path, const lv_fpoint_t * p)
CHECK_AND_RESIZE_PATH_CONTAINER(path, 1);
- uint8_t op = LV_VECTOR_PATH_OP_LINE_TO;
+ lv_vector_path_op_t op = LV_VECTOR_PATH_OP_LINE_TO;
lv_array_push_back(&path->ops, &op);
lv_array_push_back(&path->points, p);
}
@@ -166,7 +168,7 @@ void lv_vector_path_quad_to(lv_vector_path_t * path, const lv_fpoint_t * p1, con
CHECK_AND_RESIZE_PATH_CONTAINER(path, 2);
- uint8_t op = LV_VECTOR_PATH_OP_QUAD_TO;
+ lv_vector_path_op_t op = LV_VECTOR_PATH_OP_QUAD_TO;
lv_array_push_back(&path->ops, &op);
lv_array_push_back(&path->points, p1);
lv_array_push_back(&path->points, p2);
@@ -182,7 +184,7 @@ void lv_vector_path_cubic_to(lv_vector_path_t * path, const lv_fpoint_t * p1, co
CHECK_AND_RESIZE_PATH_CONTAINER(path, 3);
- uint8_t op = LV_VECTOR_PATH_OP_CUBIC_TO;
+ lv_vector_path_op_t op = LV_VECTOR_PATH_OP_CUBIC_TO;
lv_array_push_back(&path->ops, &op);
lv_array_push_back(&path->points, p1);
lv_array_push_back(&path->points, p2);
@@ -198,7 +200,7 @@ void lv_vector_path_close(lv_vector_path_t * path)
CHECK_AND_RESIZE_PATH_CONTAINER(path, 1);
- uint8_t op = LV_VECTOR_PATH_OP_CLOSE;
+ lv_vector_path_op_t op = LV_VECTOR_PATH_OP_CLOSE;
lv_array_push_back(&path->ops, &op);
}
@@ -500,7 +502,7 @@ void lv_vector_dsc_delete(lv_vector_dsc_t * dsc)
{
if(dsc->tasks.task_list) {
lv_ll_t * task_list = dsc->tasks.task_list;
- _lv_vector_for_each_destroy_tasks(task_list, NULL, NULL);
+ lv_vector_for_each_destroy_tasks(task_list, NULL, NULL);
dsc->tasks.task_list = NULL;
}
lv_array_deinit(&(dsc->current_dsc.stroke_dsc.dash_pattern));
@@ -688,7 +690,7 @@ void lv_vector_dsc_set_stroke_gradient_color_stops(lv_vector_dsc_t * dsc, const
void lv_vector_dsc_add_path(lv_vector_dsc_t * dsc, const lv_vector_path_t * path)
{
lv_area_t rect;
- if(!_lv_area_intersect(&rect, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) {
+ if(!lv_area_intersect(&rect, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) {
return;
}
@@ -700,11 +702,11 @@ void lv_vector_dsc_add_path(lv_vector_dsc_t * dsc, const lv_vector_path_t * path
if(!dsc->tasks.task_list) {
dsc->tasks.task_list = lv_malloc(sizeof(lv_ll_t));
LV_ASSERT_MALLOC(dsc->tasks.task_list);
- _lv_ll_init(dsc->tasks.task_list, sizeof(_lv_vector_draw_task));
+ lv_ll_init(dsc->tasks.task_list, sizeof(lv_vector_draw_task));
}
- _lv_vector_draw_task * new_task = (_lv_vector_draw_task *)_lv_ll_ins_tail(dsc->tasks.task_list);
- lv_memset(new_task, 0, sizeof(_lv_vector_draw_task));
+ lv_vector_draw_task * new_task = (lv_vector_draw_task *)lv_ll_ins_tail(dsc->tasks.task_list);
+ lv_memset(new_task, 0, sizeof(lv_vector_draw_task));
new_task->path = lv_vector_path_create(0);
@@ -716,18 +718,18 @@ void lv_vector_dsc_add_path(lv_vector_dsc_t * dsc, const lv_vector_path_t * path
void lv_vector_clear_area(lv_vector_dsc_t * dsc, const lv_area_t * rect)
{
lv_area_t r;
- if(!_lv_area_intersect(&r, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) {
+ if(!lv_area_intersect(&r, &(dsc->layer->_clip_area), &(dsc->current_dsc.scissor_area))) {
return;
}
if(!dsc->tasks.task_list) {
dsc->tasks.task_list = lv_malloc(sizeof(lv_ll_t));
LV_ASSERT_MALLOC(dsc->tasks.task_list);
- _lv_ll_init(dsc->tasks.task_list, sizeof(_lv_vector_draw_task));
+ lv_ll_init(dsc->tasks.task_list, sizeof(lv_vector_draw_task));
}
- _lv_vector_draw_task * new_task = (_lv_vector_draw_task *)_lv_ll_ins_tail(dsc->tasks.task_list);
- lv_memset(new_task, 0, sizeof(_lv_vector_draw_task));
+ lv_vector_draw_task * new_task = (lv_vector_draw_task *)lv_ll_ins_tail(dsc->tasks.task_list);
+ lv_memset(new_task, 0, sizeof(lv_vector_draw_task));
new_task->dsc.fill_dsc.color = dsc->current_dsc.fill_dsc.color;
new_task->dsc.fill_dsc.opa = dsc->current_dsc.fill_dsc.opa;
@@ -776,14 +778,14 @@ void lv_vector_dsc_skew(lv_vector_dsc_t * dsc, float skew_x, float skew_y)
lv_matrix_skew(&(dsc->current_dsc.matrix), skew_x, skew_y);
}
-void _lv_vector_for_each_destroy_tasks(lv_ll_t * task_list, vector_draw_task_cb cb, void * data)
+void lv_vector_for_each_destroy_tasks(lv_ll_t * task_list, vector_draw_task_cb cb, void * data)
{
- _lv_vector_draw_task * task = _lv_ll_get_head(task_list);
- _lv_vector_draw_task * next_task = NULL;
+ lv_vector_draw_task * task = lv_ll_get_head(task_list);
+ lv_vector_draw_task * next_task = NULL;
while(task != NULL) {
- next_task = _lv_ll_get_next(task_list, task);
- _lv_ll_remove(task_list, task);
+ next_task = lv_ll_get_next(task_list, task);
+ lv_ll_remove(task_list, task);
if(cb) {
cb(data, task->path, &(task->dsc));