feat(profiler): support different module divisions (#6834)
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com> Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com> Co-authored-by: liuhongchao <liuhongchao@xiaomi.com> Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
49
Kconfig
49
Kconfig
@@ -1411,11 +1411,13 @@ menu "LVGL configuration"
|
|||||||
bool "Center"
|
bool "Center"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config LV_USE_PROFILER
|
menuconfig LV_USE_PROFILER
|
||||||
bool "Runtime performance profiler"
|
bool "Runtime performance profiler"
|
||||||
|
|
||||||
|
if LV_USE_PROFILER
|
||||||
|
|
||||||
config LV_USE_PROFILER_BUILTIN
|
config LV_USE_PROFILER_BUILTIN
|
||||||
bool "Enable the built-in profiler"
|
bool "Enable the built-in profiler"
|
||||||
depends on LV_USE_PROFILER
|
|
||||||
default y
|
default y
|
||||||
config LV_PROFILER_BUILTIN_BUF_SIZE
|
config LV_PROFILER_BUILTIN_BUF_SIZE
|
||||||
int "Default profiler trace buffer size in bytes"
|
int "Default profiler trace buffer size in bytes"
|
||||||
@@ -1423,9 +1425,50 @@ menu "LVGL configuration"
|
|||||||
default 16384
|
default 16384
|
||||||
config LV_PROFILER_INCLUDE
|
config LV_PROFILER_INCLUDE
|
||||||
string "Header to include for the profiler"
|
string "Header to include for the profiler"
|
||||||
depends on LV_USE_PROFILER
|
|
||||||
default "lvgl/src/misc/lv_profiler_builtin.h"
|
default "lvgl/src/misc/lv_profiler_builtin.h"
|
||||||
|
|
||||||
|
config LV_PROFILER_LAYOUT
|
||||||
|
bool "Enable layout profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_REFR
|
||||||
|
bool "Enable disp refr profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_DRAW
|
||||||
|
bool "Enable draw profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_INDEV
|
||||||
|
bool "Enable indev profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_DECODER
|
||||||
|
bool "Enable decoder profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_FONT
|
||||||
|
bool "Enable font profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_FS
|
||||||
|
bool "Enable fs profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_STYLE
|
||||||
|
bool "Enable style profiler"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config LV_PROFILER_TIMER
|
||||||
|
bool "Enable timer profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_PROFILER_CACHE
|
||||||
|
bool "Enable cache profiler"
|
||||||
|
default y
|
||||||
|
|
||||||
|
endif # LV_USE_PROFILER
|
||||||
|
|
||||||
config LV_USE_MONKEY
|
config LV_USE_MONKEY
|
||||||
bool "Enable Monkey test"
|
bool "Enable Monkey test"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -936,6 +936,36 @@
|
|||||||
|
|
||||||
/** Profiler end point function with custom tag */
|
/** Profiler end point function with custom tag */
|
||||||
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
|
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
|
||||||
|
|
||||||
|
/*Enable layout profiler*/
|
||||||
|
#define LV_PROFILER_LAYOUT 1
|
||||||
|
|
||||||
|
/*Enable disp refr profiler*/
|
||||||
|
#define LV_PROFILER_REFR 1
|
||||||
|
|
||||||
|
/*Enable draw profiler*/
|
||||||
|
#define LV_PROFILER_DRAW 1
|
||||||
|
|
||||||
|
/*Enable indev profiler*/
|
||||||
|
#define LV_PROFILER_INDEV 1
|
||||||
|
|
||||||
|
/*Enable decoder profiler*/
|
||||||
|
#define LV_PROFILER_DECODER 1
|
||||||
|
|
||||||
|
/*Enable font profiler*/
|
||||||
|
#define LV_PROFILER_FONT 1
|
||||||
|
|
||||||
|
/*Enable fs profiler*/
|
||||||
|
#define LV_PROFILER_FS 1
|
||||||
|
|
||||||
|
/*Enable style profiler*/
|
||||||
|
#define LV_PROFILER_STYLE 0
|
||||||
|
|
||||||
|
/*Enable timer profiler*/
|
||||||
|
#define LV_PROFILER_TIMER 1
|
||||||
|
|
||||||
|
/*Enable cache profiler*/
|
||||||
|
#define LV_PROFILER_CACHE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** 1: Enable Monkey test */
|
/** 1: Enable Monkey test */
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ void lv_obj_update_layout(const lv_obj_t * obj)
|
|||||||
LV_LOG_TRACE("Already running, returning");
|
LV_LOG_TRACE("Already running, returning");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_LAYOUT_BEGIN;
|
||||||
update_layout_mutex = true;
|
update_layout_mutex = true;
|
||||||
|
|
||||||
lv_obj_t * scr = lv_obj_get_screen(obj);
|
lv_obj_t * scr = lv_obj_get_screen(obj);
|
||||||
@@ -309,7 +309,7 @@ void lv_obj_update_layout(const lv_obj_t * obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_layout_mutex = false;
|
update_layout_mutex = false;
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_LAYOUT_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_set_align(lv_obj_t * obj, lv_align_t align)
|
void lv_obj_set_align(lv_obj_t * obj, lv_align_t align)
|
||||||
|
|||||||
@@ -278,6 +278,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
|
|||||||
|
|
||||||
if(!style_refr) return;
|
if(!style_refr) return;
|
||||||
|
|
||||||
|
LV_PROFILER_STYLE_BEGIN;
|
||||||
|
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
|
|
||||||
lv_part_t part = lv_obj_style_get_selector_part(selector);
|
lv_part_t part = lv_obj_style_get_selector_part(selector);
|
||||||
@@ -316,6 +318,8 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
|
|||||||
refresh_children_style(obj);
|
refresh_children_style(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_enable_style_refresh(bool en)
|
void lv_obj_enable_style_refresh(bool en)
|
||||||
@@ -353,6 +357,7 @@ bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, l
|
|||||||
void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value,
|
void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t value,
|
||||||
lv_style_selector_t selector)
|
lv_style_selector_t selector)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_STYLE_BEGIN;
|
||||||
lv_style_t * style = get_local_style(obj, selector);
|
lv_style_t * style = get_local_style(obj, selector);
|
||||||
if(selector == LV_PART_MAIN && lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_TRANSFORM)) {
|
if(selector == LV_PART_MAIN && lv_style_prop_has_flag(prop, LV_STYLE_PROP_FLAG_TRANSFORM)) {
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
@@ -371,6 +376,7 @@ void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
lv_obj_refresh_style(obj, selector, prop);
|
lv_obj_refresh_style(obj, selector, prop);
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value,
|
lv_style_res_t lv_obj_get_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_value_t * value,
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ void lv_refr_set_disp_refreshing(lv_display_t * disp)
|
|||||||
|
|
||||||
void lv_display_refr_timer(lv_timer_t * tmr)
|
void lv_display_refr_timer(lv_timer_t * tmr)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
LV_TRACE_REFR("begin");
|
LV_TRACE_REFR("begin");
|
||||||
|
|
||||||
if(tmr) {
|
if(tmr) {
|
||||||
@@ -365,26 +365,28 @@ void lv_display_refr_timer(lv_timer_t * tmr)
|
|||||||
|
|
||||||
if(disp_refr == NULL) {
|
if(disp_refr == NULL) {
|
||||||
LV_LOG_WARN("No display registered");
|
LV_LOG_WARN("No display registered");
|
||||||
|
LV_PROFILER_REFR_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_buf_t * buf_act = disp_refr->buf_act;
|
lv_draw_buf_t * buf_act = disp_refr->buf_act;
|
||||||
if(!(buf_act && buf_act->data && buf_act->data_size)) {
|
if(!(buf_act && buf_act->data && buf_act->data_size)) {
|
||||||
LV_LOG_WARN("No draw buffer");
|
LV_LOG_WARN("No draw buffer");
|
||||||
|
LV_PROFILER_REFR_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_display_send_event(disp_refr, LV_EVENT_REFR_START, NULL);
|
lv_display_send_event(disp_refr, LV_EVENT_REFR_START, NULL);
|
||||||
|
|
||||||
/*Refresh the screen's layout if required*/
|
/*Refresh the screen's layout if required*/
|
||||||
LV_PROFILER_BEGIN_TAG("layout");
|
LV_PROFILER_LAYOUT_BEGIN_TAG("layout");
|
||||||
lv_obj_update_layout(disp_refr->act_scr);
|
lv_obj_update_layout(disp_refr->act_scr);
|
||||||
if(disp_refr->prev_scr) lv_obj_update_layout(disp_refr->prev_scr);
|
if(disp_refr->prev_scr) lv_obj_update_layout(disp_refr->prev_scr);
|
||||||
|
|
||||||
lv_obj_update_layout(disp_refr->bottom_layer);
|
lv_obj_update_layout(disp_refr->bottom_layer);
|
||||||
lv_obj_update_layout(disp_refr->top_layer);
|
lv_obj_update_layout(disp_refr->top_layer);
|
||||||
lv_obj_update_layout(disp_refr->sys_layer);
|
lv_obj_update_layout(disp_refr->sys_layer);
|
||||||
LV_PROFILER_END_TAG("layout");
|
LV_PROFILER_LAYOUT_END_TAG("layout");
|
||||||
|
|
||||||
/*Do nothing if there is no active screen*/
|
/*Do nothing if there is no active screen*/
|
||||||
if(disp_refr->act_scr == NULL) {
|
if(disp_refr->act_scr == NULL) {
|
||||||
@@ -428,7 +430,7 @@ refr_finish:
|
|||||||
lv_display_send_event(disp_refr, LV_EVENT_REFR_READY, NULL);
|
lv_display_send_event(disp_refr, LV_EVENT_REFR_READY, NULL);
|
||||||
|
|
||||||
LV_TRACE_REFR("finished");
|
LV_TRACE_REFR("finished");
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -440,7 +442,7 @@ refr_finish:
|
|||||||
*/
|
*/
|
||||||
static void lv_refr_join_area(void)
|
static void lv_refr_join_area(void)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
uint32_t join_from;
|
uint32_t join_from;
|
||||||
uint32_t join_in;
|
uint32_t join_in;
|
||||||
lv_area_t joined_area;
|
lv_area_t joined_area;
|
||||||
@@ -471,7 +473,7 @@ static void lv_refr_join_area(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -488,7 +490,7 @@ static void refr_sync_areas(void)
|
|||||||
/*Do not sync if no sync areas*/
|
/*Do not sync if no sync areas*/
|
||||||
if(lv_ll_is_empty(&disp_refr->sync_areas)) return;
|
if(lv_ll_is_empty(&disp_refr->sync_areas)) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
/*With double buffered direct mode synchronize the rendered areas to the other buffer*/
|
/*With double buffered direct mode synchronize the rendered areas to the other buffer*/
|
||||||
/*We need to wait for ready here to not mess up the active screen*/
|
/*We need to wait for ready here to not mess up the active screen*/
|
||||||
wait_for_flushing(disp_refr);
|
wait_for_flushing(disp_refr);
|
||||||
@@ -549,7 +551,7 @@ static void refr_sync_areas(void)
|
|||||||
|
|
||||||
/*Clear sync areas*/
|
/*Clear sync areas*/
|
||||||
lv_ll_clear(&disp_refr->sync_areas);
|
lv_ll_clear(&disp_refr->sync_areas);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -558,7 +560,7 @@ static void refr_sync_areas(void)
|
|||||||
static void refr_invalid_areas(void)
|
static void refr_invalid_areas(void)
|
||||||
{
|
{
|
||||||
if(disp_refr->inv_p == 0) return;
|
if(disp_refr->inv_p == 0) return;
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
|
|
||||||
/*Find the last area which will be drawn*/
|
/*Find the last area which will be drawn*/
|
||||||
int32_t i;
|
int32_t i;
|
||||||
@@ -588,7 +590,7 @@ static void refr_invalid_areas(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
disp_refr->rendering_in_progress = false;
|
disp_refr->rendering_in_progress = false;
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -613,7 +615,7 @@ static void layer_reshape_draw_buf(lv_layer_t * layer, uint32_t stride)
|
|||||||
*/
|
*/
|
||||||
static void refr_area(const lv_area_t * area_p)
|
static void refr_area(const lv_area_t * area_p)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
lv_layer_t * layer = disp_refr->layer_head;
|
lv_layer_t * layer = disp_refr->layer_head;
|
||||||
layer->draw_buf = disp_refr->buf_act;
|
layer->draw_buf = disp_refr->buf_act;
|
||||||
|
|
||||||
@@ -646,7 +648,7 @@ static void refr_area(const lv_area_t * area_p)
|
|||||||
layer->phy_clip_area = *area_p;
|
layer->phy_clip_area = *area_p;
|
||||||
refr_area_part(layer);
|
refr_area_part(layer);
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,12 +696,12 @@ static void refr_area(const lv_area_t * area_p)
|
|||||||
disp_refr->last_part = 1;
|
disp_refr->last_part = 1;
|
||||||
refr_area_part(layer);
|
refr_area_part(layer);
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void refr_area_part(lv_layer_t * layer)
|
static void refr_area_part(lv_layer_t * layer)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
disp_refr->refreshed_area = layer->_clip_area;
|
disp_refr->refreshed_area = layer->_clip_area;
|
||||||
|
|
||||||
/* In single buffered mode wait here until the buffer is freed.
|
/* In single buffered mode wait here until the buffer is freed.
|
||||||
@@ -758,7 +760,7 @@ static void refr_area_part(lv_layer_t * layer)
|
|||||||
refr_obj_and_children(layer, lv_display_get_layer_sys(disp_refr));
|
refr_obj_and_children(layer, lv_display_get_layer_sys(disp_refr));
|
||||||
|
|
||||||
draw_buf_flush(disp_refr);
|
draw_buf_flush(disp_refr);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -815,7 +817,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
|
|||||||
if(top_obj == NULL) top_obj = lv_display_get_screen_active(disp_refr);
|
if(top_obj == NULL) top_obj = lv_display_get_screen_active(disp_refr);
|
||||||
if(top_obj == NULL) return; /*Shouldn't happen*/
|
if(top_obj == NULL) return; /*Shouldn't happen*/
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
/*Refresh the top object and its children*/
|
/*Refresh the top object and its children*/
|
||||||
refr_obj(layer, top_obj);
|
refr_obj(layer, top_obj);
|
||||||
|
|
||||||
@@ -852,7 +854,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
|
|||||||
/*Go a level deeper*/
|
/*Go a level deeper*/
|
||||||
parent = lv_obj_get_parent(parent);
|
parent = lv_obj_get_parent(parent);
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static lv_result_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type,
|
static lv_result_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type,
|
||||||
@@ -1190,7 +1192,7 @@ static void draw_buf_flush(lv_display_t * disp)
|
|||||||
|
|
||||||
static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
|
static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
LV_TRACE_REFR("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer",
|
LV_TRACE_REFR("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer",
|
||||||
(int)area->x1, (int)area->y1, (int)area->x2, (int)area->y2, (void *)px_map);
|
(int)area->x1, (int)area->y1, (int)area->x2, (int)area->y2, (void *)px_map);
|
||||||
|
|
||||||
@@ -1211,12 +1213,12 @@ static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t *
|
|||||||
disp->flush_cb(disp, &offset_area, px_map);
|
disp->flush_cb(disp, &offset_area, px_map);
|
||||||
lv_display_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area);
|
lv_display_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wait_for_flushing(lv_display_t * disp)
|
static void wait_for_flushing(lv_display_t * disp)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_REFR_BEGIN;
|
||||||
LV_LOG_TRACE("begin");
|
LV_LOG_TRACE("begin");
|
||||||
|
|
||||||
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_START, NULL);
|
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_START, NULL);
|
||||||
@@ -1235,5 +1237,5 @@ static void wait_for_flushing(lv_display_t * disp)
|
|||||||
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_FINISH, NULL);
|
lv_display_send_event(disp, LV_EVENT_FLUSH_WAIT_FINISH, NULL);
|
||||||
|
|
||||||
LV_LOG_TRACE("end");
|
LV_LOG_TRACE("end");
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_REFR_END;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ void * lv_draw_create_unit(size_t size)
|
|||||||
|
|
||||||
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
|
lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_task_t * new_task = lv_malloc_zeroed(sizeof(lv_draw_task_t));
|
lv_draw_task_t * new_task = lv_malloc_zeroed(sizeof(lv_draw_task_t));
|
||||||
|
|
||||||
new_task->area = *coords;
|
new_task->area = *coords;
|
||||||
@@ -111,13 +111,13 @@ lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
|
|||||||
tail->next = new_task;
|
tail->next = new_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return new_task;
|
return new_task;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
|
void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
|
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
|
||||||
base_dsc->layer = layer;
|
base_dsc->layer = layer;
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
|
|||||||
u = u->next;
|
u = u->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_wait_for_finish(void)
|
void lv_draw_wait_for_finish(void)
|
||||||
@@ -173,7 +173,7 @@ void lv_draw_wait_for_finish(void)
|
|||||||
|
|
||||||
void lv_draw_dispatch(void)
|
void lv_draw_dispatch(void)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
bool task_dispatched = false;
|
bool task_dispatched = false;
|
||||||
lv_display_t * disp = lv_display_get_next(NULL);
|
lv_display_t * disp = lv_display_get_next(NULL);
|
||||||
while(disp) {
|
while(disp) {
|
||||||
@@ -189,12 +189,12 @@ void lv_draw_dispatch(void)
|
|||||||
}
|
}
|
||||||
disp = lv_display_get_next(disp);
|
disp = lv_display_get_next(disp);
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
|
bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
/*Remove the finished tasks first*/
|
/*Remove the finished tasks first*/
|
||||||
lv_draw_task_t * t_prev = NULL;
|
lv_draw_task_t * t_prev = NULL;
|
||||||
lv_draw_task_t * t = layer->draw_task_head;
|
lv_draw_task_t * t = layer->draw_task_head;
|
||||||
@@ -279,7 +279,7 @@ bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return task_dispatched;
|
return task_dispatched;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ uint32_t lv_draw_get_unit_count(void)
|
|||||||
|
|
||||||
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
|
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
/* If there is only 1 draw unit the task can be consumed linearly as
|
/* If there is only 1 draw unit the task can be consumed linearly as
|
||||||
* they are added in the correct order. However, it can happen that
|
* they are added in the correct order. However, it can happen that
|
||||||
@@ -339,7 +339,7 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
|
|||||||
}
|
}
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
|
|||||||
if(t->state != LV_DRAW_TASK_STATE_QUEUED &&
|
if(t->state != LV_DRAW_TASK_STATE_QUEUED &&
|
||||||
t->area.x1 <= 0 && t->area.x2 >= hor_res - 1 &&
|
t->area.x1 <= 0 && t->area.x2 >= hor_res - 1 &&
|
||||||
t->area.y1 <= 0 && t->area.y2 >= ver_res - 1) {
|
t->area.y1 <= 0 && t->area.y2 >= ver_res - 1) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,13 +364,13 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
|
|||||||
if(t->state == LV_DRAW_TASK_STATE_QUEUED &&
|
if(t->state == LV_DRAW_TASK_STATE_QUEUED &&
|
||||||
(t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE || t->preferred_draw_unit_id == draw_unit_id) &&
|
(t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE || t->preferred_draw_unit_id == draw_unit_id) &&
|
||||||
is_independent(layer, t)) {
|
is_independent(layer, t)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check)
|
|||||||
if(t_check == NULL) return 0;
|
if(t_check == NULL) return 0;
|
||||||
if(t_check->next == NULL) return 0;
|
if(t_check->next == NULL) return 0;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
|
|
||||||
lv_draw_task_t * t = t_check->next;
|
lv_draw_task_t * t = t_check->next;
|
||||||
@@ -391,16 +391,20 @@ uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check)
|
|||||||
|
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
|
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_display_t * disp = lv_refr_get_disp_refreshing();
|
lv_display_t * disp = lv_refr_get_disp_refreshing();
|
||||||
lv_layer_t * new_layer = lv_malloc_zeroed(sizeof(lv_layer_t));
|
lv_layer_t * new_layer = lv_malloc_zeroed(sizeof(lv_layer_t));
|
||||||
LV_ASSERT_MALLOC(new_layer);
|
LV_ASSERT_MALLOC(new_layer);
|
||||||
if(new_layer == NULL) return NULL;
|
if(new_layer == NULL) {
|
||||||
|
LV_PROFILER_DRAW_END;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
new_layer->parent = parent_layer;
|
new_layer->parent = parent_layer;
|
||||||
new_layer->_clip_area = *area;
|
new_layer->_clip_area = *area;
|
||||||
@@ -421,6 +425,7 @@ lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t c
|
|||||||
disp->layer_head = new_layer;
|
disp->layer_head = new_layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_PROFILER_DRAW_END;
|
||||||
return new_layer;
|
return new_layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,7 +490,7 @@ void lv_draw_task_get_area(const lv_draw_task_t * t, lv_area_t * area)
|
|||||||
*/
|
*/
|
||||||
static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
|
static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_task_t * t = layer->draw_task_head;
|
lv_draw_task_t * t = layer->draw_task_head;
|
||||||
|
|
||||||
/*If t_check is outside of the older tasks then it's independent*/
|
/*If t_check is outside of the older tasks then it's independent*/
|
||||||
@@ -493,13 +498,13 @@ static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
|
|||||||
if(t->state != LV_DRAW_TASK_STATE_READY) {
|
if(t->state != LV_DRAW_TASK_STATE_READY) {
|
||||||
lv_area_t a;
|
lv_area_t a;
|
||||||
if(lv_area_intersect(&a, &t->_real_area, &t_check->_real_area)) {
|
if(lv_area_intersect(&a, &t->_real_area, &t_check->_real_area)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc)
|
|||||||
if(dsc->width == 0) return;
|
if(dsc->width == 0) return;
|
||||||
if(dsc->start_angle == dsc->end_angle) return;
|
if(dsc->start_angle == dsc->end_angle) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_area_t a;
|
lv_area_t a;
|
||||||
a.x1 = dsc->center.x - dsc->radius;
|
a.x1 = dsc->center.x - dsc->radius;
|
||||||
a.y1 = dsc->center.y - dsc->radius;
|
a.y1 = dsc->center.y - dsc->radius;
|
||||||
@@ -70,7 +70,7 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc)
|
|||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle,
|
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle,
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
||||||
|
|
||||||
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
||||||
@@ -85,6 +87,8 @@ void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
layer_to_draw->all_tasks_added = true;
|
layer_to_draw->all_tasks_added = true;
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
|
|
||||||
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
||||||
@@ -100,7 +104,7 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
|
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
|
||||||
lv_memcpy(new_image_dsc, dsc, sizeof(*dsc));
|
lv_memcpy(new_image_dsc, dsc, sizeof(*dsc));
|
||||||
@@ -108,6 +112,7 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
if(res != LV_RESULT_OK) {
|
if(res != LV_RESULT_OK) {
|
||||||
LV_LOG_WARN("Couldn't get info about the image");
|
LV_LOG_WARN("Couldn't get info about the image");
|
||||||
lv_free(new_image_dsc);
|
lv_free(new_image_dsc);
|
||||||
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +125,7 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
lv_area_move(&t->_real_area, coords->x1, coords->y1);
|
lv_area_move(&t->_real_area, coords->x1, coords->y1);
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_image_src_t lv_image_src_get_type(const void * src)
|
lv_image_src_t lv_image_src_get_type(const void * src)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_layer_t * layer, const lv_draw_label
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
||||||
|
|
||||||
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
||||||
@@ -103,7 +103,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_layer_t * layer, const lv_draw_label
|
|||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc,
|
void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_dsc_t * dsc,
|
||||||
@@ -117,7 +117,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_d
|
|||||||
|
|
||||||
if(lv_text_is_marker(unicode_letter)) return;
|
if(lv_text_is_marker(unicode_letter)) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_font_glyph_dsc_t g;
|
lv_font_glyph_dsc_t g;
|
||||||
lv_font_get_glyph_dsc(dsc->font, &g, unicode_letter, 0);
|
lv_font_get_glyph_dsc(dsc->font, &g, unicode_letter, 0);
|
||||||
@@ -143,7 +143,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_character(lv_layer_t * layer, lv_draw_label_d
|
|||||||
dsc->text_local = 1;
|
dsc->text_local = 1;
|
||||||
|
|
||||||
lv_draw_label(layer, dsc, &a);
|
lv_draw_label(layer, dsc, &a);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
|
void lv_draw_label_iterate_characters(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
|
||||||
@@ -386,7 +386,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
|||||||
if(lv_text_is_marker(letter)) /*Markers are valid letters but should not be rendered.*/
|
if(lv_text_is_marker(letter)) /*Markers are valid letters but should not be rendered.*/
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
bool g_ret = lv_font_get_glyph_dsc(font, &g, letter, '\0');
|
bool g_ret = lv_font_get_glyph_dsc(font, &g, letter, '\0');
|
||||||
if(g_ret == false) {
|
if(g_ret == false) {
|
||||||
/*Add warning if the dsc is not found*/
|
/*Add warning if the dsc is not found*/
|
||||||
@@ -395,7 +395,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
|||||||
|
|
||||||
/*Don't draw anything if the character is empty. E.g. space*/
|
/*Don't draw anything if the character is empty. E.g. space*/
|
||||||
if((g.box_h == 0) || (g.box_w == 0)) {
|
if((g.box_h == 0) || (g.box_w == 0)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,7 +408,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
|||||||
/*If the letter is completely out of mask don't draw it*/
|
/*If the letter is completely out of mask don't draw it*/
|
||||||
if(lv_area_is_out(&letter_coords, draw_unit->clip_area, 0) &&
|
if(lv_area_is_out(&letter_coords, draw_unit->clip_area, 0) &&
|
||||||
lv_area_is_out(dsc->bg_coords, draw_unit->clip_area, 0)) {
|
lv_area_is_out(dsc->bg_coords, draw_unit->clip_area, 0)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,5 +442,5 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
|||||||
|
|
||||||
lv_font_glyph_release_draw_data(&g);
|
lv_font_glyph_release_draw_data(&g);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_line(lv_layer_t * layer, const lv_draw_line_d
|
|||||||
if(dsc->width == 0) return;
|
if(dsc->width == 0) return;
|
||||||
if(dsc->opa <= LV_OPA_MIN) return;
|
if(dsc->opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_area_t a;
|
lv_area_t a;
|
||||||
a.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width;
|
a.x1 = (int32_t)LV_MIN(dsc->p1.x, dsc->p2.x) - dsc->width;
|
||||||
a.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width;
|
a.x2 = (int32_t)LV_MAX(dsc->p1.x, dsc->p2.x) + dsc->width;
|
||||||
@@ -69,7 +70,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_line(lv_layer_t * layer, const lv_draw_line_d
|
|||||||
t->type = LV_DRAW_TASK_TYPE_LINE;
|
t->type = LV_DRAW_TASK_TYPE_LINE;
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_m
|
|||||||
LV_LOG_WARN("Only layers with alpha channel can be masked");
|
LV_LOG_WARN("Only layers with alpha channel can be masked");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_task_t * t = lv_draw_add_task(layer, &layer->buf_area);
|
lv_draw_task_t * t = lv_draw_add_task(layer, &layer->buf_area);
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_mask_rect(lv_layer_t * layer, const lv_draw_m
|
|||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t * task
|
|||||||
void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
|
void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
|
||||||
{
|
{
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
bool has_shadow;
|
bool has_shadow;
|
||||||
bool has_fill;
|
bool has_fill;
|
||||||
bool has_border;
|
bool has_border;
|
||||||
@@ -294,7 +294,7 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
|
|||||||
|
|
||||||
LV_ASSERT_MEM_INTEGRITY();
|
LV_ASSERT_MEM_INTEGRITY();
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc)
|
void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_memzero(dsc, sizeof(lv_draw_triangle_dsc_t));
|
lv_memzero(dsc, sizeof(lv_draw_triangle_dsc_t));
|
||||||
dsc->bg_color = lv_color_white();
|
dsc->bg_color = lv_color_white();
|
||||||
dsc->bg_grad.stops[0].color = lv_color_white();
|
dsc->bg_grad.stops[0].color = lv_color_white();
|
||||||
@@ -49,7 +49,7 @@ void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc)
|
|||||||
dsc->bg_grad.stops_count = 2;
|
dsc->bg_grad.stops_count = 2;
|
||||||
dsc->bg_opa = LV_OPA_COVER;
|
dsc->bg_opa = LV_OPA_COVER;
|
||||||
dsc->base.dsc_size = sizeof(lv_draw_triangle_dsc_t);
|
dsc->base.dsc_size = sizeof(lv_draw_triangle_dsc_t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task)
|
lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task)
|
||||||
@@ -61,7 +61,8 @@ void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * dsc)
|
|||||||
{
|
{
|
||||||
if(dsc->bg_opa <= LV_OPA_MIN) return;
|
if(dsc->bg_opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_area_t a;
|
lv_area_t a;
|
||||||
a.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
|
a.x1 = (int32_t)LV_MIN3(dsc->p[0].x, dsc->p[1].x, dsc->p[2].x);
|
||||||
a.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
|
a.y1 = (int32_t)LV_MIN3(dsc->p[0].y, dsc->p[1].y, dsc->p[2].y);
|
||||||
@@ -75,7 +76,7 @@ void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * dsc)
|
|||||||
t->type = LV_DRAW_TASK_TYPE_TRIANGLE;
|
t->type = LV_DRAW_TASK_TYPE_TRIANGLE;
|
||||||
|
|
||||||
lv_draw_finalize_task_creation(layer, t);
|
lv_draw_finalize_task_creation(layer, t);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
|
|||||||
lv_area_t blend_area;
|
lv_area_t blend_area;
|
||||||
if(!lv_area_intersect(&blend_area, blend_dsc->blend_area, draw_unit->clip_area)) return;
|
if(!lv_area_intersect(&blend_area, blend_dsc->blend_area, draw_unit->clip_area)) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_layer_t * layer = draw_unit->target_layer;
|
lv_layer_t * layer = draw_unit->target_layer;
|
||||||
uint32_t layer_stride_byte = layer->draw_buf->header.stride;
|
uint32_t layer_stride_byte = layer->draw_buf->header.stride;
|
||||||
|
|
||||||
@@ -131,12 +131,12 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!lv_area_intersect(&blend_area, &blend_area, blend_dsc->src_area)) {
|
if(!lv_area_intersect(&blend_area, &blend_area, blend_dsc->src_area)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(blend_dsc->mask_area && !lv_area_intersect(&blend_area, &blend_area, blend_dsc->mask_area)) {
|
if(blend_dsc->mask_area && !lv_area_intersect(&blend_area, &blend_area, blend_dsc->mask_area)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ void lv_draw_sw_blend(lv_draw_unit_t * draw_unit, const lv_draw_sw_blend_dsc_t *
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -429,25 +429,25 @@ static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task)
|
|||||||
|
|
||||||
static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_sw_unit_t * draw_sw_unit = (lv_draw_sw_unit_t *) draw_unit;
|
lv_draw_sw_unit_t * draw_sw_unit = (lv_draw_sw_unit_t *) draw_unit;
|
||||||
|
|
||||||
/*Return immediately if it's busy with draw task*/
|
/*Return immediately if it's busy with draw task*/
|
||||||
if(draw_sw_unit->task_act) {
|
if(draw_sw_unit->task_act) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_task_t * t = NULL;
|
lv_draw_task_t * t = NULL;
|
||||||
t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_SW);
|
t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_SW);
|
||||||
if(t == NULL) {
|
if(t == NULL) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||||
if(buf == NULL) {
|
if(buf == NULL) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,7 +462,7 @@ static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
|||||||
#else
|
#else
|
||||||
execute_drawing_unit(draw_sw_unit);
|
execute_drawing_unit(draw_sw_unit);
|
||||||
#endif
|
#endif
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,7 +498,7 @@ static void render_thread_cb(void * ptr)
|
|||||||
|
|
||||||
static void execute_drawing(lv_draw_sw_unit_t * u)
|
static void execute_drawing(lv_draw_sw_unit_t * u)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
/*Render the draw task*/
|
/*Render the draw task*/
|
||||||
lv_draw_task_t * t = u->task_act;
|
lv_draw_task_t * t = u->task_act;
|
||||||
switch(t->type) {
|
switch(t->type) {
|
||||||
@@ -584,7 +584,7 @@ static void execute_drawing(lv_draw_sw_unit_t * u)
|
|||||||
lv_draw_sw_label((lv_draw_unit_t *)u, &label_dsc, &txt_area);
|
lv_draw_sw_label((lv_draw_unit_t *)u, &label_dsc, &txt_area);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_DRAW_SW_SUPPORT_ARGB8888
|
#if LV_DRAW_SW_SUPPORT_ARGB8888
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ void lv_draw_sw_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * ds
|
|||||||
{
|
{
|
||||||
if(dsc->opa <= LV_OPA_MIN) return;
|
if(dsc->opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
|
lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void lv_draw_sw_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc)
|
|||||||
is_common = lv_area_intersect(&clip_line, &clip_line, draw_unit->clip_area);
|
is_common = lv_area_intersect(&clip_line, &clip_line, draw_unit->clip_area);
|
||||||
if(!is_common) return;
|
if(!is_common) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
if(dsc->p1.y == dsc->p2.y) draw_line_hor(draw_unit, dsc);
|
if(dsc->p1.y == dsc->p2.y) draw_line_hor(draw_unit, dsc);
|
||||||
else if(dsc->p1.x == dsc->p2.x) draw_line_ver(draw_unit, dsc);
|
else if(dsc->p1.x == dsc->p2.x) draw_line_ver(draw_unit, dsc);
|
||||||
else draw_line_skew(draw_unit, dsc);
|
else draw_line_skew(draw_unit, dsc);
|
||||||
@@ -96,7 +96,7 @@ void lv_draw_sw_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t * dsc)
|
|||||||
lv_draw_sw_fill(draw_unit, &cir_dsc, &cir_area);
|
lv_draw_sw_fill(draw_unit, &cir_dsc, &cir_area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32);
|
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32);
|
||||||
lv_vg_lite_path_set_quality(path, VG_LITE_HIGH);
|
lv_vg_lite_path_set_quality(path, VG_LITE_HIGH);
|
||||||
@@ -159,7 +159,7 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d
|
|||||||
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -167,7 +167,7 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color));
|
color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
|
|
||||||
if(dsc->img_src) {
|
if(dsc->img_src) {
|
||||||
vg_lite_buffer_t src_buf;
|
vg_lite_buffer_t src_buf;
|
||||||
@@ -180,7 +180,7 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d
|
|||||||
|
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_pattern");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -193,13 +193,13 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d
|
|||||||
0,
|
0,
|
||||||
color,
|
color,
|
||||||
VG_LITE_FILTER_BI_LINEAR));
|
VG_LITE_FILTER_BI_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_pattern");
|
||||||
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
int32_t w = lv_area_get_width(coords);
|
int32_t w = lv_area_get_width(coords);
|
||||||
int32_t h = lv_area_get_height(coords);
|
int32_t h = lv_area_get_height(coords);
|
||||||
@@ -95,7 +95,7 @@ void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc
|
|||||||
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -103,10 +103,10 @@ void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color));
|
color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -118,7 +118,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
int32_t x, int32_t y, int32_t w, int32_t h,
|
int32_t x, int32_t y, int32_t w, int32_t h,
|
||||||
float r)
|
float r)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
const float half_w = w / 2.0f;
|
const float half_w = w / 2.0f;
|
||||||
const float half_h = h / 2.0f;
|
const float half_h = h / 2.0f;
|
||||||
@@ -127,7 +127,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
|
|
||||||
/* normal fill, no inner rect */
|
/* normal fill, no inner rect */
|
||||||
if(border_w >= border_w_max) {
|
if(border_w >= border_w_max) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return VG_LITE_FILL_EVEN_ODD;
|
return VG_LITE_FILL_EVEN_ODD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
x + border_w, y + border_w,
|
x + border_w, y + border_w,
|
||||||
w - border_w * 2, h - border_w * 2,
|
w - border_w * 2, h - border_w * 2,
|
||||||
r_in < 0 ? 0 : r_in);
|
r_in < 0 ? 0 : r_in);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return VG_LITE_FILL_EVEN_ODD;
|
return VG_LITE_FILL_EVEN_ODD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
w_inner,
|
w_inner,
|
||||||
h_inner,
|
h_inner,
|
||||||
0);
|
0);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return VG_LITE_FILL_EVEN_ODD;
|
return VG_LITE_FILL_EVEN_ODD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return VG_LITE_FILL_NON_ZERO;
|
return VG_LITE_FILL_NON_ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +394,7 @@ static vg_lite_fill_t path_append_inner_rect(lv_vg_lite_path_t * path,
|
|||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return VG_LITE_FILL_NON_ZERO;
|
return VG_LITE_FILL_NON_ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void lv_draw_vg_lite_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_sh
|
|||||||
lv_area_t draw_area;
|
lv_area_t draw_area;
|
||||||
if(!lv_area_intersect(&draw_area, &shadow_area, draw_unit->clip_area)) return;
|
if(!lv_area_intersect(&draw_area, &shadow_area, draw_unit->clip_area)) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_border_dsc_t border_dsc;
|
lv_draw_border_dsc_t border_dsc;
|
||||||
lv_draw_border_dsc_init(&border_dsc);
|
lv_draw_border_dsc_init(&border_dsc);
|
||||||
@@ -88,7 +88,7 @@ void lv_draw_vg_lite_box_shadow(lv_draw_unit_t * draw_unit, const lv_draw_box_sh
|
|||||||
lv_draw_vg_lite_fill(draw_unit, &fill_dsc, &core_area);
|
lv_draw_vg_lite_fill(draw_unit, &fill_dsc, &core_area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
vg_lite_matrix_t matrix = u->global_matrix;
|
vg_lite_matrix_t matrix = u->global_matrix;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t *
|
|||||||
}
|
}
|
||||||
else { /* normal fill */
|
else { /* normal fill */
|
||||||
vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true);
|
vg_lite_color_t color = lv_vg_lite_color(dsc->color, dsc->opa, true);
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -99,12 +99,12 @@ void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t *
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color));
|
color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
vg_lite_buffer_t src_buf;
|
vg_lite_buffer_t src_buf;
|
||||||
lv_image_decoder_dsc_t decoder_dsc;
|
lv_image_decoder_dsc_t decoder_dsc;
|
||||||
@@ -78,7 +78,7 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
/* if not support blend normal, premultiply alpha */
|
/* if not support blend normal, premultiply alpha */
|
||||||
bool premultiply = !lv_vg_lite_support_blend_normal();
|
bool premultiply = !lv_vg_lite_support_blend_normal();
|
||||||
if(!lv_vg_lite_buffer_open_image(&src_buf, &decoder_dsc, dsc->src, no_cache, premultiply)) {
|
if(!lv_vg_lite_buffer_open_image(&src_buf, &decoder_dsc, dsc->src, no_cache, premultiply)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
vg_lite_rectangle_t rect;
|
vg_lite_rectangle_t rect;
|
||||||
lv_vg_lite_rect(&rect, &src_area);
|
lv_vg_lite_rect(&rect, &src_area);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_blit_rect");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_blit_rect");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
&src_buf,
|
&src_buf,
|
||||||
@@ -133,7 +133,7 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
blend,
|
blend,
|
||||||
color,
|
color,
|
||||||
filter));
|
filter));
|
||||||
LV_PROFILER_END_TAG("vg_lite_blit_rect");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_blit_rect");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32);
|
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_FP32);
|
||||||
@@ -170,7 +170,7 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
vg_lite_matrix_t path_matrix = u->global_matrix;
|
vg_lite_matrix_t path_matrix = u->global_matrix;
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_pattern");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -183,13 +183,13 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
|
|||||||
0,
|
0,
|
||||||
color,
|
color,
|
||||||
filter));
|
filter));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_pattern");
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
|
void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
|
||||||
const lv_area_t * coords)
|
const lv_area_t * coords)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
#if LV_USE_FREETYPE
|
#if LV_USE_FREETYPE
|
||||||
static bool is_init = false;
|
static bool is_init = false;
|
||||||
@@ -85,7 +85,7 @@ void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t
|
|||||||
#endif /* LV_USE_FREETYPE */
|
#endif /* LV_USE_FREETYPE */
|
||||||
|
|
||||||
lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
|
lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -160,7 +160,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_area_t image_area = *dsc->letter_coords;
|
lv_area_t image_area = *dsc->letter_coords;
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
/* rect is used to crop the pixel-aligned padding area */
|
/* rect is used to crop the pixel-aligned padding area */
|
||||||
vg_lite_rectangle_t rect;
|
vg_lite_rectangle_t rect;
|
||||||
lv_vg_lite_rect(&rect, &src_area);
|
lv_vg_lite_rect(&rect, &src_area);
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_blit_rect");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_blit_rect");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
&src_buf,
|
&src_buf,
|
||||||
@@ -195,7 +195,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color,
|
color,
|
||||||
VG_LITE_FILTER_LINEAR));
|
VG_LITE_FILTER_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_blit_rect");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_blit_rect");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_S16);
|
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_S16);
|
||||||
@@ -213,7 +213,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
vg_lite_matrix_t path_matrix = u->global_matrix;
|
vg_lite_matrix_t path_matrix = u->global_matrix;
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&path_matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_pattern");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -226,7 +226,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
0,
|
0,
|
||||||
color,
|
color,
|
||||||
VG_LITE_FILTER_LINEAR));
|
VG_LITE_FILTER_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_pattern");
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
* Later, use the font cache for management to improve efficiency.
|
* Later, use the font cache for management to improve efficiency.
|
||||||
*/
|
*/
|
||||||
lv_vg_lite_finish(u);
|
lv_vg_lite_finish(u);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_USE_FREETYPE
|
#if LV_USE_FREETYPE
|
||||||
@@ -249,7 +249,7 @@ static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
/* vg-lite bounding_box will crop the pixels on the edge, so +1px is needed here */
|
/* vg-lite bounding_box will crop the pixels on the edge, so +1px is needed here */
|
||||||
path_clip_area.x2++;
|
path_clip_area.x2++;
|
||||||
@@ -278,7 +278,7 @@ static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_
|
|||||||
vg_lite_matrix_t result;
|
vg_lite_matrix_t result;
|
||||||
if(!lv_vg_lite_matrix_inverse(&result, &matrix)) {
|
if(!lv_vg_lite_matrix_inverse(&result, &matrix)) {
|
||||||
LV_LOG_ERROR("no inverse matrix");
|
LV_LOG_ERROR("no inverse matrix");
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,18 +297,18 @@ static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_
|
|||||||
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&draw_matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&draw_matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer, vg_lite_path, VG_LITE_FILL_NON_ZERO,
|
&u->target_buffer, vg_lite_path, VG_LITE_FILL_NON_ZERO,
|
||||||
&draw_matrix, VG_LITE_BLEND_SRC_OVER, lv_vg_lite_color(dsc->color, dsc->opa, true)));
|
&draw_matrix, VG_LITE_BLEND_SRC_OVER, lv_vg_lite_color(dsc->color, dsc->opa, true)));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vg_lite_outline_push(const lv_freetype_outline_event_param_t * param)
|
static void vg_lite_outline_push(const lv_freetype_outline_event_param_t * param)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_vg_lite_path_t * outline = param->outline;
|
lv_vg_lite_path_t * outline = param->outline;
|
||||||
LV_ASSERT_NULL(outline);
|
LV_ASSERT_NULL(outline);
|
||||||
|
|
||||||
@@ -342,12 +342,12 @@ static void vg_lite_outline_push(const lv_freetype_outline_event_param_t * param
|
|||||||
LV_ASSERT(false);
|
LV_ASSERT(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void freetype_outline_event_cb(lv_event_t * e)
|
static void freetype_outline_event_cb(lv_event_t * e)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_event_code_t code = lv_event_get_code(e);
|
lv_event_code_t code = lv_event_get_code(e);
|
||||||
lv_freetype_outline_event_param_t * param = lv_event_get_param(e);
|
lv_freetype_outline_event_param_t * param = lv_event_get_param(e);
|
||||||
switch(code) {
|
switch(code) {
|
||||||
@@ -365,7 +365,7 @@ static void freetype_outline_event_cb(lv_event_t * e)
|
|||||||
LV_LOG_WARN("unknown event code: %d", code);
|
LV_LOG_WARN("unknown event code: %d", code);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LV_USE_FREETYPE */
|
#endif /* LV_USE_FREETYPE */
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void lv_draw_vg_lite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t
|
|||||||
if(layer->draw_buf == NULL)
|
if(layer->draw_buf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
/* The GPU output should already be premultiplied RGB */
|
/* The GPU output should already be premultiplied RGB */
|
||||||
if(!lv_draw_buf_has_flag(layer->draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED)) {
|
if(!lv_draw_buf_has_flag(layer->draw_buf, LV_IMAGE_FLAGS_PREMULTIPLIED)) {
|
||||||
@@ -64,7 +64,7 @@ void lv_draw_vg_lite_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t
|
|||||||
* otherwise it may cause the drawing to fail. */
|
* otherwise it may cause the drawing to fail. */
|
||||||
lv_vg_lite_finish(u);
|
lv_vg_lite_finish(u);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void lv_draw_vg_lite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t *
|
|||||||
return; /*Fully clipped, nothing to do*/
|
return; /*Fully clipped, nothing to do*/
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit;
|
lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit;
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ void lv_draw_vg_lite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t *
|
|||||||
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
LV_VG_LITE_ASSERT_PATH(vg_lite_path);
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -198,11 +198,11 @@ void lv_draw_vg_lite_line(lv_draw_unit_t * draw_unit, const lv_draw_line_dsc_t *
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color));
|
color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void lv_draw_vg_lite_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_re
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
#if LV_USE_VG_LITE_THORVG
|
#if LV_USE_VG_LITE_THORVG
|
||||||
/**
|
/**
|
||||||
@@ -121,7 +121,7 @@ void lv_draw_vg_lite_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_re
|
|||||||
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&matrix);
|
||||||
|
|
||||||
/* Use VG_LITE_BLEND_DST_IN (Sa * D) blending mode to make the corners transparent */
|
/* Use VG_LITE_BLEND_DST_IN (Sa * D) blending mode to make the corners transparent */
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -129,12 +129,12 @@ void lv_draw_vg_lite_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_re
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_DST_IN,
|
VG_LITE_BLEND_DST_IN,
|
||||||
0));
|
0));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
#endif /*LV_USE_VG_LITE_THORVG*/
|
#endif /*LV_USE_VG_LITE_THORVG*/
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void lv_draw_vg_lite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle
|
|||||||
is_common = lv_area_intersect(&clip_area, &tri_area, draw_unit->clip_area);
|
is_common = lv_area_intersect(&clip_area, &tri_area, draw_unit->clip_area);
|
||||||
if(!is_common) return;
|
if(!is_common) return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit;
|
lv_draw_vg_lite_unit_t * u = (lv_draw_vg_lite_unit_t *)draw_unit;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ void lv_draw_vg_lite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle
|
|||||||
}
|
}
|
||||||
else { /* normal fill */
|
else { /* normal fill */
|
||||||
vg_lite_color_t color = lv_vg_lite_color(dsc->bg_color, dsc->bg_opa, true);
|
vg_lite_color_t color = lv_vg_lite_color(dsc->bg_color, dsc->bg_opa, true);
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_lite_path,
|
vg_lite_path,
|
||||||
@@ -99,12 +99,12 @@ void lv_draw_vg_lite_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle
|
|||||||
&matrix,
|
&matrix,
|
||||||
VG_LITE_BLEND_SRC_OVER,
|
VG_LITE_BLEND_SRC_OVER,
|
||||||
color));
|
color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_path_drop(u, path);
|
lv_vg_lite_path_drop(u, path);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ void lv_draw_vg_lite_vector(lv_draw_unit_t * draw_unit, const lv_draw_vector_tas
|
|||||||
if(layer->draw_buf == NULL)
|
if(layer->draw_buf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_vector_for_each_destroy_tasks(dsc->task_list, task_draw_cb, draw_unit);
|
lv_vector_for_each_destroy_tasks(dsc->task_list, task_draw_cb, draw_unit);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@@ -85,7 +85,7 @@ static vg_lite_color_t lv_color32_to_vg(lv_color32_t color, lv_opa_t opa)
|
|||||||
|
|
||||||
static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc)
|
static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vector_draw_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_draw_vg_lite_unit_t * u = ctx;
|
lv_draw_vg_lite_unit_t * u = ctx;
|
||||||
LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer);
|
LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer);
|
||||||
|
|
||||||
@@ -95,10 +95,10 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
vg_lite_color_t c = lv_color32_to_vg(dsc->fill_dsc.color, LV_OPA_COVER);
|
vg_lite_color_t c = lv_color32_to_vg(dsc->fill_dsc.color, LV_OPA_COVER);
|
||||||
vg_lite_rectangle_t rect;
|
vg_lite_rectangle_t rect;
|
||||||
lv_vg_lite_rect(&rect, &dsc->scissor_area);
|
lv_vg_lite_rect(&rect, &dsc->scissor_area);
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_clear");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_clear");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_clear(&u->target_buffer, &rect, c));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_clear(&u->target_buffer, &rect, c));
|
||||||
LV_PROFILER_END_TAG("vg_lite_clear");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_clear");
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +146,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
|
|
||||||
/* drop original path */
|
/* drop original path */
|
||||||
lv_vg_lite_path_drop(u, lv_vg_path);
|
lv_vg_lite_path_drop(u, lv_vg_path);
|
||||||
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +185,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
if(!lv_vg_lite_matrix_inverse(&result, &matrix)) {
|
if(!lv_vg_lite_matrix_inverse(&result, &matrix)) {
|
||||||
LV_LOG_ERROR("no inverse matrix");
|
LV_LOG_ERROR("no inverse matrix");
|
||||||
path_drop_func(u, path_drop_data);
|
path_drop_func(u, path_drop_data);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
switch(dsc->fill_dsc.style) {
|
switch(dsc->fill_dsc.style) {
|
||||||
case LV_VECTOR_DRAW_STYLE_SOLID: {
|
case LV_VECTOR_DRAW_STYLE_SOLID: {
|
||||||
/* normal draw shape */
|
/* normal draw shape */
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_path,
|
vg_path,
|
||||||
@@ -210,7 +211,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
&matrix,
|
&matrix,
|
||||||
blend,
|
blend,
|
||||||
vg_color));
|
vg_color));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LV_VECTOR_DRAW_STYLE_PATTERN: {
|
case LV_VECTOR_DRAW_STYLE_PATTERN: {
|
||||||
@@ -230,7 +231,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
|
|
||||||
LV_VG_LITE_ASSERT_MATRIX(&pattern_matrix);
|
LV_VG_LITE_ASSERT_MATRIX(&pattern_matrix);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_pattern");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_pattern(
|
||||||
&u->target_buffer,
|
&u->target_buffer,
|
||||||
vg_path,
|
vg_path,
|
||||||
@@ -243,7 +244,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
vg_color,
|
vg_color,
|
||||||
recolor,
|
recolor,
|
||||||
VG_LITE_FILTER_BI_LINEAR));
|
VG_LITE_FILTER_BI_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_pattern");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_pattern");
|
||||||
|
|
||||||
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
lv_vg_lite_pending_add(u->image_dsc_pending, &decoder_dsc);
|
||||||
}
|
}
|
||||||
@@ -288,7 +289,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
|
|||||||
lv_vg_lite_disable_scissor();
|
lv_vg_lite_disable_scissor();
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static vg_lite_quality_t lv_quality_to_vg(lv_vector_path_quality_t quality)
|
static vg_lite_quality_t lv_quality_to_vg(lv_vector_path_quality_t quality)
|
||||||
@@ -307,7 +308,7 @@ static vg_lite_quality_t lv_quality_to_vg(lv_vector_path_quality_t quality)
|
|||||||
|
|
||||||
static void lv_path_to_vg(lv_vg_lite_path_t * dest, const lv_vector_path_t * src)
|
static void lv_path_to_vg(lv_vg_lite_path_t * dest, const lv_vector_path_t * src)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_vg_lite_path_set_quality(dest, lv_quality_to_vg(src->quality));
|
lv_vg_lite_path_set_quality(dest, lv_quality_to_vg(src->quality));
|
||||||
|
|
||||||
/* init bounds */
|
/* init bounds */
|
||||||
@@ -371,7 +372,7 @@ static void lv_path_to_vg(lv_vg_lite_path_t * dest, const lv_vector_path_t * src
|
|||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_path_set_bonding_box(dest, min_x, min_y, max_x, max_y);
|
lv_vg_lite_path_set_bonding_box(dest, min_x, min_y, max_x, max_y);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
static vg_lite_path_type_t lv_path_opa_to_path_type(const lv_vector_draw_dsc_t * dsc)
|
static vg_lite_path_type_t lv_path_opa_to_path_type(const lv_vector_draw_dsc_t * dsc)
|
||||||
|
|||||||
@@ -140,9 +140,9 @@ bool lv_vg_lite_draw_grad(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("grad_get");
|
LV_PROFILER_DRAW_BEGIN_TAG("grad_get");
|
||||||
grad_item_t * grad_item = grad_get(u, grad);
|
grad_item_t * grad_item = grad_get(u, grad);
|
||||||
LV_PROFILER_END_TAG("grad_get");
|
LV_PROFILER_DRAW_END_TAG("grad_get");
|
||||||
if(!grad_item) {
|
if(!grad_item) {
|
||||||
LV_LOG_WARN("Failed to get gradient, style: %d", grad->style);
|
LV_LOG_WARN("Failed to get gradient, style: %d", grad->style);
|
||||||
return false;
|
return false;
|
||||||
@@ -160,7 +160,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
|
|
||||||
LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image);
|
LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_grad(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_grad(
|
||||||
buffer,
|
buffer,
|
||||||
path,
|
path,
|
||||||
@@ -168,7 +168,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
(vg_lite_matrix_t *)matrix,
|
(vg_lite_matrix_t *)matrix,
|
||||||
linear_grad,
|
linear_grad,
|
||||||
blend));
|
blend));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_grad");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GRAD_TYPE_LINEAR_EXT: {
|
case GRAD_TYPE_LINEAR_EXT: {
|
||||||
@@ -179,7 +179,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
|
|
||||||
LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image);
|
LV_VG_LITE_ASSERT_SRC_BUFFER(&linear_grad->image);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_linear_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_linear_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_linear_grad(
|
LV_VG_LITE_CHECK_ERROR(vg_lite_draw_linear_grad(
|
||||||
buffer,
|
buffer,
|
||||||
path,
|
path,
|
||||||
@@ -189,7 +189,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
0,
|
0,
|
||||||
blend,
|
blend,
|
||||||
VG_LITE_FILTER_LINEAR));
|
VG_LITE_FILTER_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_linear_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_linear_grad");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
|
|
||||||
LV_VG_LITE_ASSERT_SRC_BUFFER(&grad_item->vg.radial.image);
|
LV_VG_LITE_ASSERT_SRC_BUFFER(&grad_item->vg.radial.image);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_draw_radial_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_draw_radial_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(
|
LV_VG_LITE_CHECK_ERROR(
|
||||||
vg_lite_draw_radial_grad(
|
vg_lite_draw_radial_grad(
|
||||||
buffer,
|
buffer,
|
||||||
@@ -212,7 +212,7 @@ bool lv_vg_lite_draw_grad(
|
|||||||
0,
|
0,
|
||||||
blend,
|
blend,
|
||||||
VG_LITE_FILTER_LINEAR));
|
VG_LITE_FILTER_LINEAR));
|
||||||
LV_PROFILER_END_TAG("vg_lite_draw_radial_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_draw_radial_grad");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -387,11 +387,11 @@ static vg_lite_color_ramp_t * grad_create_color_ramp(const lv_vector_gradient_t
|
|||||||
|
|
||||||
static bool linear_grad_create(grad_item_t * item)
|
static bool linear_grad_create(grad_item_t * item)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
vg_lite_error_t err = vg_lite_init_grad(&item->vg.linear);
|
vg_lite_error_t err = vg_lite_init_grad(&item->vg.linear);
|
||||||
if(err != VG_LITE_SUCCESS) {
|
if(err != VG_LITE_SUCCESS) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
LV_LOG_ERROR("init grad error(%d): %s", (int)err, lv_vg_lite_error_string(err));
|
LV_LOG_ERROR("init grad error(%d): %s", (int)err, lv_vg_lite_error_string(err));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -417,17 +417,17 @@ static bool linear_grad_create(grad_item_t * item)
|
|||||||
|
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_set_grad(&item->vg.linear, item->lv.stops_count, colors, stops));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_set_grad(&item->vg.linear, item->lv.stops_count, colors, stops));
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_update_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_update_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_update_grad(&item->vg.linear));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_update_grad(&item->vg.linear));
|
||||||
LV_PROFILER_END_TAG("vg_lite_update_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_update_grad");
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool linear_ext_grad_create(grad_item_t * item)
|
static bool linear_ext_grad_create(grad_item_t * item)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) {
|
if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) {
|
||||||
LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS);
|
LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS);
|
||||||
@@ -436,7 +436,7 @@ static bool linear_ext_grad_create(grad_item_t * item)
|
|||||||
|
|
||||||
vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv);
|
vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv);
|
||||||
if(!color_ramp) {
|
if(!color_ramp) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ static bool linear_ext_grad_create(grad_item_t * item)
|
|||||||
vg_lite_ext_linear_gradient_t linear_grad;
|
vg_lite_ext_linear_gradient_t linear_grad;
|
||||||
lv_memzero(&linear_grad, sizeof(linear_grad));
|
lv_memzero(&linear_grad, sizeof(linear_grad));
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_set_linear_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_set_linear_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(
|
LV_VG_LITE_CHECK_ERROR(
|
||||||
vg_lite_set_linear_grad(
|
vg_lite_set_linear_grad(
|
||||||
&linear_grad,
|
&linear_grad,
|
||||||
@@ -459,11 +459,11 @@ static bool linear_ext_grad_create(grad_item_t * item)
|
|||||||
grad_param,
|
grad_param,
|
||||||
lv_spread_to_vg(item->lv.spread),
|
lv_spread_to_vg(item->lv.spread),
|
||||||
1));
|
1));
|
||||||
LV_PROFILER_END_TAG("vg_lite_set_linear_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_set_linear_grad");
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_update_linear_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_update_linear_grad");
|
||||||
vg_lite_error_t err = vg_lite_update_linear_grad(&linear_grad);
|
vg_lite_error_t err = vg_lite_update_linear_grad(&linear_grad);
|
||||||
LV_PROFILER_END_TAG("vg_lite_update_linear_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_update_linear_grad");
|
||||||
if(err == VG_LITE_SUCCESS) {
|
if(err == VG_LITE_SUCCESS) {
|
||||||
item->vg.linear_ext = linear_grad;
|
item->vg.linear_ext = linear_grad;
|
||||||
}
|
}
|
||||||
@@ -473,13 +473,13 @@ static bool linear_ext_grad_create(grad_item_t * item)
|
|||||||
|
|
||||||
lv_free(color_ramp);
|
lv_free(color_ramp);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return err == VG_LITE_SUCCESS;
|
return err == VG_LITE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool radial_grad_create(grad_item_t * item)
|
static bool radial_grad_create(grad_item_t * item)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) {
|
if(item->lv.stops_count > VLC_MAX_COLOR_RAMP_STOPS) {
|
||||||
LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS);
|
LV_LOG_WARN("Gradient stops limited: %d, max: %d", item->lv.stops_count, VLC_MAX_GRADIENT_STOPS);
|
||||||
@@ -488,7 +488,7 @@ static bool radial_grad_create(grad_item_t * item)
|
|||||||
|
|
||||||
vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv);
|
vg_lite_color_ramp_t * color_ramp = grad_create_color_ramp(&item->lv);
|
||||||
if(!color_ramp) {
|
if(!color_ramp) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,7 +503,7 @@ static bool radial_grad_create(grad_item_t * item)
|
|||||||
vg_lite_radial_gradient_t radial_grad;
|
vg_lite_radial_gradient_t radial_grad;
|
||||||
lv_memzero(&radial_grad, sizeof(radial_grad));
|
lv_memzero(&radial_grad, sizeof(radial_grad));
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_set_radial_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_set_radial_grad");
|
||||||
LV_VG_LITE_CHECK_ERROR(
|
LV_VG_LITE_CHECK_ERROR(
|
||||||
vg_lite_set_radial_grad(
|
vg_lite_set_radial_grad(
|
||||||
&radial_grad,
|
&radial_grad,
|
||||||
@@ -512,11 +512,11 @@ static bool radial_grad_create(grad_item_t * item)
|
|||||||
grad_param,
|
grad_param,
|
||||||
lv_spread_to_vg(item->lv.spread),
|
lv_spread_to_vg(item->lv.spread),
|
||||||
1));
|
1));
|
||||||
LV_PROFILER_END_TAG("vg_lite_set_radial_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_set_radial_grad");
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_update_radial_grad");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_update_radial_grad");
|
||||||
vg_lite_error_t err = vg_lite_update_radial_grad(&radial_grad);
|
vg_lite_error_t err = vg_lite_update_radial_grad(&radial_grad);
|
||||||
LV_PROFILER_END_TAG("vg_lite_update_radial_grad");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_update_radial_grad");
|
||||||
if(err == VG_LITE_SUCCESS) {
|
if(err == VG_LITE_SUCCESS) {
|
||||||
item->vg.radial = radial_grad;
|
item->vg.radial = radial_grad;
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ static bool radial_grad_create(grad_item_t * item)
|
|||||||
|
|
||||||
lv_free(color_ramp);
|
lv_free(color_ramp);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return err == VG_LITE_SUCCESS;
|
return err == VG_LITE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ void lv_vg_lite_path_deinit(struct _lv_draw_vg_lite_unit_t * unit)
|
|||||||
|
|
||||||
lv_vg_lite_path_t * lv_vg_lite_path_create(vg_lite_format_t data_format)
|
lv_vg_lite_path_t * lv_vg_lite_path_create(vg_lite_format_t data_format)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
lv_vg_lite_path_t * path = lv_malloc_zeroed(sizeof(lv_vg_lite_path_t));
|
lv_vg_lite_path_t * path = lv_malloc_zeroed(sizeof(lv_vg_lite_path_t));
|
||||||
LV_ASSERT_MALLOC(path);
|
LV_ASSERT_MALLOC(path);
|
||||||
path->format_len = lv_vg_lite_path_format_len(data_format);
|
path->format_len = lv_vg_lite_path_format_len(data_format);
|
||||||
@@ -96,13 +96,13 @@ lv_vg_lite_path_t * lv_vg_lite_path_create(vg_lite_format_t data_format)
|
|||||||
NULL,
|
NULL,
|
||||||
0, 0, 0, 0)
|
0, 0, 0, 0)
|
||||||
== VG_LITE_SUCCESS);
|
== VG_LITE_SUCCESS);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_vg_lite_path_destroy(lv_vg_lite_path_t * path)
|
void lv_vg_lite_path_destroy(lv_vg_lite_path_t * path)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
LV_ASSERT_NULL(path);
|
LV_ASSERT_NULL(path);
|
||||||
if(path->base.path != NULL) {
|
if(path->base.path != NULL) {
|
||||||
lv_free(path->base.path);
|
lv_free(path->base.path);
|
||||||
@@ -112,7 +112,7 @@ void lv_vg_lite_path_destroy(lv_vg_lite_path_t * path)
|
|||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_clear_path(&path->base));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_clear_path(&path->base));
|
||||||
}
|
}
|
||||||
lv_free(path);
|
lv_free(path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_path_t * lv_vg_lite_path_get(struct _lv_draw_vg_lite_unit_t * unit, vg_lite_format_t data_format)
|
lv_vg_lite_path_t * lv_vg_lite_path_get(struct _lv_draw_vg_lite_unit_t * unit, vg_lite_format_t data_format)
|
||||||
@@ -218,7 +218,7 @@ bool lv_vg_lite_path_update_bonding_box(lv_vg_lite_path_t * path)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
lv_vg_lite_path_bounds_t bounds;
|
lv_vg_lite_path_bounds_t bounds;
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ bool lv_vg_lite_path_update_bonding_box(lv_vg_lite_path_t * path)
|
|||||||
/* set bounds */
|
/* set bounds */
|
||||||
lv_vg_lite_path_set_bonding_box(path, bounds.min_x, bounds.min_y, bounds.max_x, bounds.max_y);
|
lv_vg_lite_path_set_bonding_box(path, bounds.min_x, bounds.min_y, bounds.max_x, bounds.max_y);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -361,7 +361,7 @@ void lv_vg_lite_path_append_rect(
|
|||||||
float w, float h,
|
float w, float h,
|
||||||
float r)
|
float r)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
const float half_w = w / 2.0f;
|
const float half_w = w / 2.0f;
|
||||||
const float half_h = h / 2.0f;
|
const float half_h = h / 2.0f;
|
||||||
|
|
||||||
@@ -377,14 +377,14 @@ void lv_vg_lite_path_append_rect(
|
|||||||
lv_vg_lite_path_line_to(path, x + w, y + h);
|
lv_vg_lite_path_line_to(path, x + w, y + h);
|
||||||
lv_vg_lite_path_line_to(path, x, y + h);
|
lv_vg_lite_path_line_to(path, x, y + h);
|
||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*circle*/
|
/*circle*/
|
||||||
if(math_equal(r, half_w) && math_equal(r, half_h)) {
|
if(math_equal(r, half_w) && math_equal(r, half_h)) {
|
||||||
lv_vg_lite_path_append_circle(path, x + half_w, y + half_h, r, r);
|
lv_vg_lite_path_append_circle(path, x + half_w, y + half_h, r, r);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ void lv_vg_lite_path_append_rect(
|
|||||||
|
|
||||||
/* Ending point */
|
/* Ending point */
|
||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_vg_lite_path_append_circle(
|
void lv_vg_lite_path_append_circle(
|
||||||
@@ -429,7 +429,7 @@ void lv_vg_lite_path_append_circle(
|
|||||||
float cx, float cy,
|
float cx, float cy,
|
||||||
float rx, float ry)
|
float rx, float ry)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
/* https://learn.microsoft.com/zh-cn/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/beziers */
|
/* https://learn.microsoft.com/zh-cn/xamarin/xamarin-forms/user-interface/graphics/skiasharp/curves/beziers */
|
||||||
float rx_kappa = rx * PATH_KAPPA;
|
float rx_kappa = rx * PATH_KAPPA;
|
||||||
float ry_kappa = ry * PATH_KAPPA;
|
float ry_kappa = ry * PATH_KAPPA;
|
||||||
@@ -440,7 +440,7 @@ void lv_vg_lite_path_append_circle(
|
|||||||
lv_vg_lite_path_cubic_to(path, cx - rx_kappa, cy + ry, cx - rx, cy + ry_kappa, cx - rx, cy);
|
lv_vg_lite_path_cubic_to(path, cx - rx_kappa, cy + ry, cx - rx, cy + ry_kappa, cx - rx, cy);
|
||||||
lv_vg_lite_path_cubic_to(path, cx - rx, cy - ry_kappa, cx - rx_kappa, cy - ry, cx, cy - ry);
|
lv_vg_lite_path_cubic_to(path, cx - rx, cy - ry_kappa, cx - rx_kappa, cy - ry, cx, cy - ry);
|
||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path,
|
void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path,
|
||||||
@@ -448,7 +448,7 @@ void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path,
|
|||||||
float center_x, float center_y,
|
float center_x, float center_y,
|
||||||
float end_x, float end_y)
|
float end_x, float end_y)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
float dx1 = center_x - start_x;
|
float dx1 = center_x - start_x;
|
||||||
float dy1 = center_y - start_y;
|
float dy1 = center_y - start_y;
|
||||||
float dx2 = end_x - center_x;
|
float dx2 = end_x - center_x;
|
||||||
@@ -460,7 +460,7 @@ void lv_vg_lite_path_append_arc_right_angle(lv_vg_lite_path_t * path,
|
|||||||
start_x - c * dy1, start_y + c * dx1,
|
start_x - c * dy1, start_y + c * dx1,
|
||||||
end_x - c * dy2, end_y + c * dx2,
|
end_x - c * dy2, end_y + c * dx2,
|
||||||
end_x, end_y);
|
end_x, end_y);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path,
|
void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path,
|
||||||
@@ -470,11 +470,11 @@ void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path,
|
|||||||
float sweep,
|
float sweep,
|
||||||
bool pie)
|
bool pie)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
/* just circle */
|
/* just circle */
|
||||||
if(sweep >= 360.0f || sweep <= -360.0f) {
|
if(sweep >= 360.0f || sweep <= -360.0f) {
|
||||||
lv_vg_lite_path_append_circle(path, cx, cy, radius, radius);
|
lv_vg_lite_path_append_circle(path, cx, cy, radius, radius);
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path,
|
|||||||
lv_vg_lite_path_close(path);
|
lv_vg_lite_path_close(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t lv_vg_lite_vlc_op_arg_len(uint8_t vlc_op)
|
uint8_t lv_vg_lite_vlc_op_arg_len(uint8_t vlc_op)
|
||||||
|
|||||||
@@ -218,9 +218,9 @@ static bool stroke_create_cb(stroke_item_t * item, void * user_data)
|
|||||||
const vg_lite_pointer * ori_path = vg_path->path;
|
const vg_lite_pointer * ori_path = vg_path->path;
|
||||||
const vg_lite_uint32_t ori_path_length = vg_path->path_length;
|
const vg_lite_uint32_t ori_path_length = vg_path->path_length;
|
||||||
|
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_update_stroke");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_update_stroke");
|
||||||
error = vg_lite_update_stroke(vg_path);
|
error = vg_lite_update_stroke(vg_path);
|
||||||
LV_PROFILER_END_TAG("vg_lite_update_stroke");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_update_stroke");
|
||||||
|
|
||||||
/* check if path is changed */
|
/* check if path is changed */
|
||||||
LV_ASSERT_MSG(vg_path->path_length == ori_path_length, "vg_path->path_length should not change");
|
LV_ASSERT_MSG(vg_path->path_length == ori_path_length, "vg_path->path_length should not change");
|
||||||
|
|||||||
@@ -749,9 +749,9 @@ bool lv_vg_lite_buffer_open_image(vg_lite_buffer_t * buffer, lv_image_decoder_ds
|
|||||||
|
|
||||||
if(LV_COLOR_FORMAT_IS_INDEXED(decoded->header.cf)) {
|
if(LV_COLOR_FORMAT_IS_INDEXED(decoded->header.cf)) {
|
||||||
uint32_t palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(decoded->header.cf);
|
uint32_t palette_size = LV_COLOR_INDEXED_PALETTE_SIZE(decoded->header.cf);
|
||||||
LV_PROFILER_BEGIN_TAG("vg_lite_set_CLUT");
|
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_set_CLUT");
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_set_CLUT(palette_size, (vg_lite_uint32_t *)decoded->data));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_set_CLUT(palette_size, (vg_lite_uint32_t *)decoded->data));
|
||||||
LV_PROFILER_END_TAG("vg_lite_set_CLUT");
|
LV_PROFILER_DRAW_END_TAG("vg_lite_set_CLUT");
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_vg_lite_buffer_from_draw_buf(buffer, decoded);
|
lv_vg_lite_buffer_from_draw_buf(buffer, decoded);
|
||||||
@@ -1172,7 +1172,7 @@ void lv_vg_lite_disable_scissor(void)
|
|||||||
void lv_vg_lite_flush(struct _lv_draw_vg_lite_unit_t * u)
|
void lv_vg_lite_flush(struct _lv_draw_vg_lite_unit_t * u)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(u);
|
LV_ASSERT_NULL(u);
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
u->flush_count++;
|
u->flush_count++;
|
||||||
u->letter_count = 0;
|
u->letter_count = 0;
|
||||||
@@ -1180,7 +1180,7 @@ void lv_vg_lite_flush(struct _lv_draw_vg_lite_unit_t * u)
|
|||||||
#if LV_VG_LITE_FLUSH_MAX_COUNT
|
#if LV_VG_LITE_FLUSH_MAX_COUNT
|
||||||
if(u->flush_count < LV_VG_LITE_FLUSH_MAX_COUNT) {
|
if(u->flush_count < LV_VG_LITE_FLUSH_MAX_COUNT) {
|
||||||
/* Do not flush too often */
|
/* Do not flush too often */
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -1188,20 +1188,20 @@ void lv_vg_lite_flush(struct _lv_draw_vg_lite_unit_t * u)
|
|||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_get_parameter(VG_LITE_GPU_IDLE_STATE, 1, (vg_lite_pointer)&is_gpu_idle));
|
LV_VG_LITE_CHECK_ERROR(vg_lite_get_parameter(VG_LITE_GPU_IDLE_STATE, 1, (vg_lite_pointer)&is_gpu_idle));
|
||||||
if(!is_gpu_idle) {
|
if(!is_gpu_idle) {
|
||||||
/* Do not flush if GPU is busy */
|
/* Do not flush if GPU is busy */
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_flush());
|
LV_VG_LITE_CHECK_ERROR(vg_lite_flush());
|
||||||
u->flush_count = 0;
|
u->flush_count = 0;
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_vg_lite_finish(struct _lv_draw_vg_lite_unit_t * u)
|
void lv_vg_lite_finish(struct _lv_draw_vg_lite_unit_t * u)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(u);
|
LV_ASSERT_NULL(u);
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_DRAW_BEGIN;
|
||||||
|
|
||||||
LV_VG_LITE_CHECK_ERROR(vg_lite_finish());
|
LV_VG_LITE_CHECK_ERROR(vg_lite_finish());
|
||||||
|
|
||||||
@@ -1214,7 +1214,7 @@ void lv_vg_lite_finish(struct _lv_draw_vg_lite_unit_t * u)
|
|||||||
lv_vg_lite_pending_remove_all(u->image_dsc_pending);
|
lv_vg_lite_pending_remove_all(u->image_dsc_pending);
|
||||||
u->flush_count = 0;
|
u->flush_count = 0;
|
||||||
u->letter_count = 0;
|
u->letter_count = 0;
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ lv_indev_t * lv_indev_get_next(lv_indev_t * indev)
|
|||||||
|
|
||||||
void indev_read_core(lv_indev_t * indev, lv_indev_data_t * data)
|
void indev_read_core(lv_indev_t * indev, lv_indev_data_t * data)
|
||||||
{
|
{
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_INDEV_BEGIN;
|
||||||
lv_memzero(data, sizeof(lv_indev_data_t));
|
lv_memzero(data, sizeof(lv_indev_data_t));
|
||||||
|
|
||||||
/* For touchpad sometimes users don't set the last pressed coordinate on release.
|
/* For touchpad sometimes users don't set the last pressed coordinate on release.
|
||||||
@@ -194,7 +194,8 @@ void indev_read_core(lv_indev_t * indev, lv_indev_data_t * data)
|
|||||||
else {
|
else {
|
||||||
LV_LOG_WARN("indev_read_cb is not registered");
|
LV_LOG_WARN("indev_read_cb is not registered");
|
||||||
}
|
}
|
||||||
LV_PROFILER_END;
|
|
||||||
|
LV_PROFILER_INDEV_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_indev_read_timer_cb(lv_timer_t * timer)
|
void lv_indev_read_timer_cb(lv_timer_t * timer)
|
||||||
@@ -222,7 +223,7 @@ void lv_indev_read(lv_indev_t * indev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_INDEV_BEGIN;
|
||||||
|
|
||||||
bool continue_reading;
|
bool continue_reading;
|
||||||
lv_indev_data_t data;
|
lv_indev_data_t data;
|
||||||
@@ -267,7 +268,7 @@ void lv_indev_read(lv_indev_t * indev)
|
|||||||
indev_obj_act = NULL;
|
indev_obj_act = NULL;
|
||||||
|
|
||||||
LV_TRACE_INDEV("finished");
|
LV_TRACE_INDEV("finished");
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_INDEV_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_indev_enable(lv_indev_t * indev, bool enable)
|
void lv_indev_enable(lv_indev_t * indev, bool enable)
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
{
|
{
|
||||||
LV_ASSERT_NULL(font);
|
LV_ASSERT_NULL(font);
|
||||||
LV_ASSERT_NULL(g_dsc);
|
LV_ASSERT_NULL(g_dsc);
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
|
|
||||||
if(unicode_letter < 0x20) {
|
if(unicode_letter < 0x20) {
|
||||||
g_dsc->adv_w = 0;
|
g_dsc->adv_w = 0;
|
||||||
@@ -89,6 +90,7 @@ static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
g_dsc->ofs_x = 0;
|
g_dsc->ofs_x = 0;
|
||||||
g_dsc->ofs_y = 0;
|
g_dsc->ofs_y = 0;
|
||||||
g_dsc->format = LV_FONT_GLYPH_FORMAT_NONE;
|
g_dsc->format = LV_FONT_GLYPH_FORMAT_NONE;
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +107,7 @@ static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
lv_cache_entry_t * entry = lv_cache_acquire_or_create(glyph_cache, &search_key, dsc);
|
lv_cache_entry_t * entry = lv_cache_acquire_or_create(glyph_cache, &search_key, dsc);
|
||||||
if(entry == NULL) {
|
if(entry == NULL) {
|
||||||
LV_LOG_ERROR("glyph lookup failed for unicode = 0x%" LV_PRIx32, unicode_letter);
|
LV_LOG_ERROR("glyph lookup failed for unicode = 0x%" LV_PRIx32, unicode_letter);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
lv_freetype_glyph_cache_data_t * data = lv_cache_entry_get_data(entry);
|
lv_freetype_glyph_cache_data_t * data = lv_cache_entry_get_data(entry);
|
||||||
@@ -117,6 +120,7 @@ static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
g_dsc->entry = NULL;
|
g_dsc->entry = NULL;
|
||||||
|
|
||||||
lv_cache_release(glyph_cache, entry, NULL);
|
lv_cache_release(glyph_cache, entry, NULL);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +130,7 @@ static bool freetype_get_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
|
|
||||||
static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void * user_data)
|
static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void * user_data)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data;
|
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data;
|
||||||
|
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
@@ -157,6 +162,7 @@ static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void
|
|||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Load_Glyph", error);
|
FT_ERROR_MSG("FT_Load_Glyph", error);
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +204,7 @@ static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void
|
|||||||
|
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static void freetype_glyph_free_cb(lv_freetype_glyph_cache_data_t * data, void * user_data)
|
static void freetype_glyph_free_cb(lv_freetype_glyph_cache_data_t * data, void * user_data)
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ void lv_freetype_set_cbs_image_font(lv_freetype_font_dsc_t * dsc)
|
|||||||
static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf)
|
static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv_draw_buf_t * draw_buf)
|
||||||
{
|
{
|
||||||
LV_UNUSED(draw_buf);
|
LV_UNUSED(draw_buf);
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
const lv_font_t * font = g_dsc->resolved_font;
|
const lv_font_t * font = g_dsc->resolved_font;
|
||||||
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc;
|
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)font->dsc;
|
||||||
LV_ASSERT_FREETYPE_FONT_DSC(dsc);
|
LV_ASSERT_FREETYPE_FONT_DSC(dsc);
|
||||||
@@ -103,6 +104,7 @@ static const void * freetype_get_glyph_bitmap_cb(lv_font_glyph_dsc_t * g_dsc, lv
|
|||||||
g_dsc->entry = entry;
|
g_dsc->entry = entry;
|
||||||
lv_freetype_image_cache_data_t * cache_node = lv_cache_entry_get_data(entry);
|
lv_freetype_image_cache_data_t * cache_node = lv_cache_entry_get_data(entry);
|
||||||
|
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return cache_node->draw_buf;
|
return cache_node->draw_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +122,8 @@ static void freetype_image_release_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
|
|
||||||
static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void * user_data)
|
static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void * user_data)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
|
|
||||||
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data;
|
lv_freetype_font_dsc_t * dsc = (lv_freetype_font_dsc_t *)user_data;
|
||||||
|
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
@@ -143,12 +147,14 @@ static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void
|
|||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Load_Glyph", error);
|
FT_ERROR_MSG("FT_Load_Glyph", error);
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
|
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
|
||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Render_Glyph", error);
|
FT_ERROR_MSG("FT_Render_Glyph", error);
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +163,7 @@ static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void
|
|||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Get_Glyph", error);
|
FT_ERROR_MSG("FT_Get_Glyph", error);
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,9 +189,8 @@ static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
FT_Done_Glyph(glyph);
|
FT_Done_Glyph(glyph);
|
||||||
|
|
||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static void freetype_image_free_cb(lv_freetype_image_cache_data_t * data, void * user_data)
|
static void freetype_image_free_cb(lv_freetype_image_cache_data_t * data, void * user_data)
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ bool lv_freetype_is_outline_font(const lv_font_t * font)
|
|||||||
|
|
||||||
static bool freetype_glyph_outline_create_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc)
|
static bool freetype_glyph_outline_create_cb(lv_freetype_outline_node_t * node, lv_freetype_font_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
lv_freetype_outline_t outline;
|
lv_freetype_outline_t outline;
|
||||||
|
|
||||||
lv_mutex_lock(&dsc->cache_node->face_lock);
|
lv_mutex_lock(&dsc->cache_node->face_lock);
|
||||||
@@ -131,12 +132,14 @@ static bool freetype_glyph_outline_create_cb(lv_freetype_outline_node_t * node,
|
|||||||
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
lv_mutex_unlock(&dsc->cache_node->face_lock);
|
||||||
|
|
||||||
if(!outline) {
|
if(!outline) {
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("glyph_index = 0x%" LV_PRIx32, (uint32_t)node->glyph_index);
|
LV_LOG_INFO("glyph_index = 0x%" LV_PRIx32, (uint32_t)node->glyph_index);
|
||||||
|
|
||||||
node->outline = outline;
|
node->outline = outline;
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +193,7 @@ static void freetype_release_glyph_cb(const lv_font_t * font, lv_font_glyph_dsc_
|
|||||||
|
|
||||||
static lv_cache_entry_t * lv_freetype_outline_lookup(lv_freetype_font_dsc_t * dsc, FT_UInt glyph_index)
|
static lv_cache_entry_t * lv_freetype_outline_lookup(lv_freetype_font_dsc_t * dsc, FT_UInt glyph_index)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
lv_freetype_cache_node_t * cache_node = dsc->cache_node;
|
lv_freetype_cache_node_t * cache_node = dsc->cache_node;
|
||||||
|
|
||||||
lv_freetype_outline_node_t tmp_node;
|
lv_freetype_outline_node_t tmp_node;
|
||||||
@@ -198,8 +202,10 @@ static lv_cache_entry_t * lv_freetype_outline_lookup(lv_freetype_font_dsc_t * ds
|
|||||||
lv_cache_entry_t * entry = lv_cache_acquire_or_create(cache_node->draw_data_cache, &tmp_node, dsc);
|
lv_cache_entry_t * entry = lv_cache_acquire_or_create(cache_node->draw_data_cache, &tmp_node, dsc);
|
||||||
if(!entry) {
|
if(!entry) {
|
||||||
LV_LOG_ERROR("glyph outline lookup failed for glyph_index = 0x%" LV_PRIx32, (uint32_t)glyph_index);
|
LV_LOG_ERROR("glyph outline lookup failed for glyph_index = 0x%" LV_PRIx32, (uint32_t)glyph_index);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,6 +241,7 @@ static lv_result_t outline_push_point(
|
|||||||
const FT_Vector * control2,
|
const FT_Vector * control2,
|
||||||
const FT_Vector * to)
|
const FT_Vector * to)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
lv_freetype_context_t * ctx = lv_freetype_get_context();
|
lv_freetype_context_t * ctx = lv_freetype_get_context();
|
||||||
|
|
||||||
lv_freetype_outline_event_param_t param;
|
lv_freetype_outline_event_param_t param;
|
||||||
@@ -245,6 +252,7 @@ static lv_result_t outline_push_point(
|
|||||||
ft_vector_to_lv_vector(¶m.control2, control2);
|
ft_vector_to_lv_vector(¶m.control2, control2);
|
||||||
ft_vector_to_lv_vector(¶m.to, to);
|
ft_vector_to_lv_vector(¶m.to, to);
|
||||||
|
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return outline_send_event(ctx, LV_EVENT_INSERT, ¶m);
|
return outline_send_event(ctx, LV_EVENT_INSERT, ¶m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,12 +302,14 @@ static lv_freetype_outline_t outline_create(
|
|||||||
uint32_t size,
|
uint32_t size,
|
||||||
uint32_t strength)
|
uint32_t strength)
|
||||||
{
|
{
|
||||||
|
LV_PROFILER_FONT_BEGIN;
|
||||||
LV_ASSERT_NULL(ctx);
|
LV_ASSERT_NULL(ctx);
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
error = FT_Set_Pixel_Sizes(face, 0, size);
|
error = FT_Set_Pixel_Sizes(face, 0, size);
|
||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Set_Char_Size", error);
|
FT_ERROR_MSG("FT_Set_Char_Size", error);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,6 +320,7 @@ static lv_freetype_outline_t outline_create(
|
|||||||
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT);
|
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT);
|
||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Load_Glyph", error);
|
FT_ERROR_MSG("FT_Load_Glyph", error);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,6 +341,7 @@ static lv_freetype_outline_t outline_create(
|
|||||||
|
|
||||||
if(res != LV_RESULT_OK || !outline) {
|
if(res != LV_RESULT_OK || !outline) {
|
||||||
LV_LOG_ERROR("Outline object create failed");
|
LV_LOG_ERROR("Outline object create failed");
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,6 +359,7 @@ static lv_freetype_outline_t outline_create(
|
|||||||
if(error) {
|
if(error) {
|
||||||
FT_ERROR_MSG("FT_Outline_Decompose", error);
|
FT_ERROR_MSG("FT_Outline_Decompose", error);
|
||||||
outline_delete(ctx, outline);
|
outline_delete(ctx, outline);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,9 +368,11 @@ static lv_freetype_outline_t outline_create(
|
|||||||
if(res != LV_RESULT_OK) {
|
if(res != LV_RESULT_OK) {
|
||||||
LV_LOG_ERROR("Outline object close failed");
|
LV_LOG_ERROR("Outline object close failed");
|
||||||
outline_delete(ctx, outline);
|
outline_delete(ctx, outline);
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_PROFILER_FONT_END;
|
||||||
return outline;
|
return outline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,16 +138,21 @@ static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
|
static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
LV_UNUSED(decoder); /*Unused*/
|
LV_UNUSED(decoder); /*Unused*/
|
||||||
|
|
||||||
|
LV_PROFILER_DECODER_BEGIN_TAG("lv_libpng_decoder_open");
|
||||||
|
|
||||||
lv_draw_buf_t * decoded;
|
lv_draw_buf_t * decoded;
|
||||||
decoded = decode_png(dsc);
|
decoded = decode_png(dsc);
|
||||||
|
|
||||||
if(decoded == NULL) {
|
if(decoded == NULL) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded);
|
lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded);
|
||||||
if(adjusted == NULL) {
|
if(adjusted == NULL) {
|
||||||
lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded);
|
lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded);
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,10 +164,16 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
dsc->decoded = decoded;
|
dsc->decoded = decoded;
|
||||||
|
|
||||||
if(dsc->args.no_cache) return LV_RESULT_OK;
|
if(dsc->args.no_cache) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
|
return LV_RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*If the image cache is disabled, just return the decoded image*/
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
if(!lv_image_cache_is_enabled()) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
|
return LV_RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*Add the decoded image to the cache*/
|
/*Add the decoded image to the cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
@@ -174,10 +185,12 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(entry == NULL) {
|
if(entry == NULL) {
|
||||||
lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded);
|
lv_draw_buf_destroy_user(image_cache_draw_buf_handlers, decoded);
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
|
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_libpng_decoder_open");
|
||||||
return LV_RESULT_OK; /*The image is fully decoded. Return with its pointer*/
|
return LV_RESULT_OK; /*The image is fully decoded. Return with its pointer*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ static lv_result_t decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
|
static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
LV_UNUSED(decoder);
|
LV_UNUSED(decoder);
|
||||||
|
LV_PROFILER_DECODER_BEGIN_TAG("lv_lodepng_decoder_open");
|
||||||
|
|
||||||
const uint8_t * png_data = NULL;
|
const uint8_t * png_data = NULL;
|
||||||
size_t png_data_size = 0;
|
size_t png_data_size = 0;
|
||||||
@@ -152,6 +153,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
lv_free((void *)png_data);
|
lv_free((void *)png_data);
|
||||||
}
|
}
|
||||||
LV_LOG_WARN("error %u: %s\n", error, lodepng_error_text(error));
|
LV_LOG_WARN("error %u: %s\n", error, lodepng_error_text(error));
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,6 +164,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
png_data_size = img_dsc->data_size;
|
png_data_size = img_dsc->data_size;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,12 +174,14 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(!decoded) {
|
if(!decoded) {
|
||||||
LV_LOG_WARN("Error decoding PNG");
|
LV_LOG_WARN("Error decoding PNG");
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded);
|
lv_draw_buf_t * adjusted = lv_image_decoder_post_process(dsc, decoded);
|
||||||
if(adjusted == NULL) {
|
if(adjusted == NULL) {
|
||||||
lv_draw_buf_destroy(decoded);
|
lv_draw_buf_destroy(decoded);
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,10 +193,16 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
dsc->decoded = decoded;
|
dsc->decoded = decoded;
|
||||||
|
|
||||||
if(dsc->args.no_cache) return LV_RESULT_OK;
|
if(dsc->args.no_cache) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
|
return LV_RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*If the image cache is disabled, just return the decoded image*/
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
if(!lv_image_cache_is_enabled()) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
|
return LV_RESULT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*Add the decoded image to the cache*/
|
/*Add the decoded image to the cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
@@ -202,10 +213,12 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, decoded, NULL);
|
lv_cache_entry_t * entry = lv_image_decoder_add_to_cache(decoder, &search_key, decoded, NULL);
|
||||||
|
|
||||||
if(entry == NULL) {
|
if(entry == NULL) {
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
|
|
||||||
|
LV_PROFILER_DECODER_END_TAG("lv_lodepng_decoder_open");
|
||||||
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2973,6 +2973,132 @@
|
|||||||
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
|
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*Enable layout profiler*/
|
||||||
|
#ifndef LV_PROFILER_LAYOUT
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_LAYOUT
|
||||||
|
#define LV_PROFILER_LAYOUT CONFIG_LV_PROFILER_LAYOUT
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_LAYOUT 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_LAYOUT 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable disp refr profiler*/
|
||||||
|
#ifndef LV_PROFILER_REFR
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_REFR
|
||||||
|
#define LV_PROFILER_REFR CONFIG_LV_PROFILER_REFR
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_REFR 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_REFR 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable draw profiler*/
|
||||||
|
#ifndef LV_PROFILER_DRAW
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_DRAW
|
||||||
|
#define LV_PROFILER_DRAW CONFIG_LV_PROFILER_DRAW
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DRAW 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DRAW 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable indev profiler*/
|
||||||
|
#ifndef LV_PROFILER_INDEV
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_INDEV
|
||||||
|
#define LV_PROFILER_INDEV CONFIG_LV_PROFILER_INDEV
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_INDEV 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_INDEV 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable decoder profiler*/
|
||||||
|
#ifndef LV_PROFILER_DECODER
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_DECODER
|
||||||
|
#define LV_PROFILER_DECODER CONFIG_LV_PROFILER_DECODER
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DECODER 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DECODER 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable font profiler*/
|
||||||
|
#ifndef LV_PROFILER_FONT
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_FONT
|
||||||
|
#define LV_PROFILER_FONT CONFIG_LV_PROFILER_FONT
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FONT 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FONT 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable fs profiler*/
|
||||||
|
#ifndef LV_PROFILER_FS
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_FS
|
||||||
|
#define LV_PROFILER_FS CONFIG_LV_PROFILER_FS
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FS 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FS 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable style profiler*/
|
||||||
|
#ifndef LV_PROFILER_STYLE
|
||||||
|
#ifdef CONFIG_LV_PROFILER_STYLE
|
||||||
|
#define LV_PROFILER_STYLE CONFIG_LV_PROFILER_STYLE
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_STYLE 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable timer profiler*/
|
||||||
|
#ifndef LV_PROFILER_TIMER
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_TIMER
|
||||||
|
#define LV_PROFILER_TIMER CONFIG_LV_PROFILER_TIMER
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_TIMER 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_TIMER 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*Enable cache profiler*/
|
||||||
|
#ifndef LV_PROFILER_CACHE
|
||||||
|
#ifdef LV_KCONFIG_PRESENT
|
||||||
|
#ifdef CONFIG_LV_PROFILER_CACHE
|
||||||
|
#define LV_PROFILER_CACHE CONFIG_LV_PROFILER_CACHE
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_CACHE 0
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_CACHE 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** 1: Enable Monkey test */
|
/** 1: Enable Monkey test */
|
||||||
|
|||||||
42
src/misc/cache/lv_cache.c
vendored
42
src/misc/cache/lv_cache.c
vendored
@@ -81,14 +81,14 @@ lv_cache_entry_t * lv_cache_acquire(lv_cache_t * cache, const void * key, void *
|
|||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
|
|
||||||
if(cache->size == 0) {
|
if(cache->size == 0) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,14 +98,14 @@ lv_cache_entry_t * lv_cache_acquire(lv_cache_t * cache, const void * key, void *
|
|||||||
}
|
}
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
void lv_cache_release(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data)
|
void lv_cache_release(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(entry);
|
LV_ASSERT_NULL(entry);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
lv_cache_entry_release_data(entry, user_data);
|
lv_cache_entry_release_data(entry, user_data);
|
||||||
@@ -116,20 +116,20 @@ void lv_cache_release(lv_cache_t * cache, lv_cache_entry_t * entry, void * user_
|
|||||||
}
|
}
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
}
|
}
|
||||||
lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * user_data)
|
lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
if(cache->max_size == 0) {
|
if(cache->max_size == 0) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * use
|
|||||||
}
|
}
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * key, void * user_data)
|
lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * key, void * user_data)
|
||||||
@@ -147,7 +147,7 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
lv_cache_entry_t * entry = NULL;
|
lv_cache_entry_t * entry = NULL;
|
||||||
@@ -158,7 +158,7 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
lv_cache_entry_acquire_data(entry);
|
lv_cache_entry_acquire_data(entry);
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
if(cache->max_size == 0) {
|
if(cache->max_size == 0) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
if(entry == NULL) {
|
if(entry == NULL) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
bool create_res = cache->ops.create_cb(lv_cache_entry_get_data(entry), user_data);
|
bool create_res = cache->ops.create_cb(lv_cache_entry_get_data(entry), user_data);
|
||||||
@@ -188,59 +188,59 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
}
|
}
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
void lv_cache_reserve(lv_cache_t * cache, uint32_t reserved_size, void * user_data)
|
void lv_cache_reserve(lv_cache_t * cache, uint32_t reserved_size, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
for(lv_cache_reserve_cond_res_t reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data);
|
for(lv_cache_reserve_cond_res_t reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data);
|
||||||
reserve_cond_res == LV_CACHE_RESERVE_COND_NEED_VICTIM;
|
reserve_cond_res == LV_CACHE_RESERVE_COND_NEED_VICTIM;
|
||||||
reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data))
|
reserve_cond_res = cache->clz->reserve_cond_cb(cache, NULL, reserved_size, user_data))
|
||||||
cache_evict_one_internal_no_lock(cache, user_data);
|
cache_evict_one_internal_no_lock(cache, user_data);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
}
|
}
|
||||||
void lv_cache_drop(lv_cache_t * cache, const void * key, void * user_data)
|
void lv_cache_drop(lv_cache_t * cache, const void * key, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
cache_drop_internal_no_lock(cache, key, user_data);
|
cache_drop_internal_no_lock(cache, key, user_data);
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
}
|
}
|
||||||
bool lv_cache_evict_one(lv_cache_t * cache, void * user_data)
|
bool lv_cache_evict_one(lv_cache_t * cache, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
bool res = cache_evict_one_internal_no_lock(cache, user_data);
|
bool res = cache_evict_one_internal_no_lock(cache, user_data);
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
void lv_cache_drop_all(lv_cache_t * cache, void * user_data)
|
void lv_cache_drop_all(lv_cache_t * cache, void * user_data)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(cache);
|
LV_ASSERT_NULL(cache);
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_CACHE_BEGIN;
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
cache->clz->drop_all_cb(cache, user_data);
|
cache->clz->drop_all_cb(cache, user_data);
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_CACHE_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_cache_set_max_size(lv_cache_t * cache, size_t max_size, void * user_data)
|
void lv_cache_set_max_size(lv_cache_t * cache, size_t max_size, void * user_data)
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
file_p->drv = drv;
|
file_p->drv = drv;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo
|
|||||||
else {
|
else {
|
||||||
void * file_d = drv->open_cb(drv, resolved_path.real_path, mode);
|
void * file_d = drv->open_cb(drv, resolved_path.real_path, mode);
|
||||||
if(file_d == NULL || file_d == (void *)(-1)) {
|
if(file_d == NULL || file_d == (void *)(-1)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
return LV_FS_RES_UNKNOWN;
|
return LV_FS_RES_UNKNOWN;
|
||||||
}
|
}
|
||||||
file_p->file_d = file_d;
|
file_p->file_d = file_d;
|
||||||
@@ -137,7 +137,7 @@ lv_fs_res_t lv_fs_open(lv_fs_file_t * file_p, const char * path, lv_fs_mode_t mo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return LV_FS_RES_OK;
|
return LV_FS_RES_OK;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p)
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res = file_p->drv->close_cb(file_p->drv, file_p->file_d);
|
lv_fs_res_t res = file_p->drv->close_cb(file_p->drv, file_p->file_d);
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ lv_fs_res_t lv_fs_close(lv_fs_file_t * file_p)
|
|||||||
file_p->drv = NULL;
|
file_p->drv = NULL;
|
||||||
file_p->cache = NULL;
|
file_p->cache = NULL;
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t
|
|||||||
if(file_p->drv->read_cb == NULL) return LV_FS_RES_NOT_IMP;
|
if(file_p->drv->read_cb == NULL) return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
uint32_t br_tmp = 0;
|
uint32_t br_tmp = 0;
|
||||||
lv_fs_res_t res;
|
lv_fs_res_t res;
|
||||||
@@ -209,7 +209,7 @@ lv_fs_res_t lv_fs_read(lv_fs_file_t * file_p, void * buf, uint32_t btr, uint32_t
|
|||||||
|
|
||||||
if(br != NULL) *br = br_tmp;
|
if(br != NULL) *br = br_tmp;
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -229,7 +229,7 @@ lv_fs_res_t lv_fs_write(lv_fs_file_t * file_p, const void * buf, uint32_t btw, u
|
|||||||
if(file_p->drv->write_cb == NULL) return LV_FS_RES_NOT_IMP;
|
if(file_p->drv->write_cb == NULL) return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res;
|
lv_fs_res_t res;
|
||||||
uint32_t bw_tmp = 0;
|
uint32_t bw_tmp = 0;
|
||||||
@@ -241,8 +241,7 @@ lv_fs_res_t lv_fs_write(lv_fs_file_t * file_p, const void * buf, uint32_t btw, u
|
|||||||
}
|
}
|
||||||
if(bw != NULL) *bw = bw_tmp;
|
if(bw != NULL) *bw = bw_tmp;
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,7 +258,7 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whenc
|
|||||||
if(file_p->drv->seek_cb == NULL) return LV_FS_RES_NOT_IMP;
|
if(file_p->drv->seek_cb == NULL) return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res;
|
lv_fs_res_t res;
|
||||||
if(file_p->drv->cache_size) {
|
if(file_p->drv->cache_size) {
|
||||||
@@ -269,7 +268,7 @@ lv_fs_res_t lv_fs_seek(lv_fs_file_t * file_p, uint32_t pos, lv_fs_whence_t whenc
|
|||||||
res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence);
|
res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, pos, whence);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -286,7 +285,7 @@ lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos)
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res;
|
lv_fs_res_t res;
|
||||||
if(file_p->drv->cache_size) {
|
if(file_p->drv->cache_size) {
|
||||||
@@ -297,7 +296,7 @@ lv_fs_res_t lv_fs_tell(lv_fs_file_t * file_p, uint32_t * pos)
|
|||||||
res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, pos);
|
res = file_p->drv->tell_cb(file_p->drv, file_p->file_d, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -324,19 +323,19 @@ lv_fs_res_t lv_fs_dir_open(lv_fs_dir_t * rddir_p, const char * path)
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
void * dir_d = drv->dir_open_cb(drv, resolved_path.real_path);
|
void * dir_d = drv->dir_open_cb(drv, resolved_path.real_path);
|
||||||
|
|
||||||
if(dir_d == NULL || dir_d == (void *)(-1)) {
|
if(dir_d == NULL || dir_d == (void *)(-1)) {
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
return LV_FS_RES_UNKNOWN;
|
return LV_FS_RES_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
rddir_p->drv = drv;
|
rddir_p->drv = drv;
|
||||||
rddir_p->dir_d = dir_d;
|
rddir_p->dir_d = dir_d;
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return LV_FS_RES_OK;
|
return LV_FS_RES_OK;
|
||||||
}
|
}
|
||||||
@@ -357,11 +356,11 @@ lv_fs_res_t lv_fs_dir_read(lv_fs_dir_t * rddir_p, char * fn, uint32_t fn_len)
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res = rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn, fn_len);
|
lv_fs_res_t res = rddir_p->drv->dir_read_cb(rddir_p->drv, rddir_p->dir_d, fn, fn_len);
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -376,14 +375,14 @@ lv_fs_res_t lv_fs_dir_close(lv_fs_dir_t * rddir_p)
|
|||||||
return LV_FS_RES_NOT_IMP;
|
return LV_FS_RES_NOT_IMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_FS_BEGIN;
|
||||||
|
|
||||||
lv_fs_res_t res = rddir_p->drv->dir_close_cb(rddir_p->drv, rddir_p->dir_d);
|
lv_fs_res_t res = rddir_p->drv->dir_close_cb(rddir_p->drv, rddir_p->dir_d);
|
||||||
|
|
||||||
rddir_p->dir_d = NULL;
|
rddir_p->dir_d = NULL;
|
||||||
rddir_p->drv = NULL;
|
rddir_p->drv = NULL;
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_FS_END;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,126 @@ extern "C" {
|
|||||||
|
|
||||||
#endif /*LV_USE_PROFILER*/
|
#endif /*LV_USE_PROFILER*/
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_LAYOUT
|
||||||
|
#define LV_PROFILER_LAYOUT_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_LAYOUT_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_LAYOUT_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_LAYOUT_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_LAYOUT_BEGIN
|
||||||
|
#define LV_PROFILER_LAYOUT_END
|
||||||
|
#define LV_PROFILER_LAYOUT_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_LAYOUT_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_STYLE
|
||||||
|
#define LV_PROFILER_STYLE_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_STYLE_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_STYLE_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_STYLE_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_STYLE_BEGIN
|
||||||
|
#define LV_PROFILER_STYLE_END
|
||||||
|
#define LV_PROFILER_STYLE_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_STYLE_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_DRAW
|
||||||
|
#define LV_PROFILER_DRAW_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_DRAW_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_DRAW_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_DRAW_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DRAW_BEGIN
|
||||||
|
#define LV_PROFILER_DRAW_END
|
||||||
|
#define LV_PROFILER_DRAW_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_DRAW_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_DECODER
|
||||||
|
#define LV_PROFILER_DECODER_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_DECODER_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_DECODER_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_DECODER_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_DECODER_BEGIN
|
||||||
|
#define LV_PROFILER_DECODER_END
|
||||||
|
#define LV_PROFILER_DECODER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_DECODER_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_REFR
|
||||||
|
#define LV_PROFILER_REFR_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_REFR_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_REFR_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_REFR_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_REFR_BEGIN
|
||||||
|
#define LV_PROFILER_REFR_END
|
||||||
|
#define LV_PROFILER_REFR_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_REFR_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_INDEV
|
||||||
|
#define LV_PROFILER_INDEV_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_INDEV_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_INDEV_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_INDEV_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_INDEV_BEGIN
|
||||||
|
#define LV_PROFILER_INDEV_END
|
||||||
|
#define LV_PROFILER_INDEV_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_INDEV_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_FONT
|
||||||
|
#define LV_PROFILER_FONT_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_FONT_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_FONT_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_FONT_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FONT_BEGIN
|
||||||
|
#define LV_PROFILER_FONT_END
|
||||||
|
#define LV_PROFILER_FONT_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_FONT_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_CACHE
|
||||||
|
#define LV_PROFILER_CACHE_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_CACHE_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_CACHE_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_CACHE_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_CACHE_BEGIN
|
||||||
|
#define LV_PROFILER_CACHE_END
|
||||||
|
#define LV_PROFILER_CACHE_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_CACHE_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_FS
|
||||||
|
#define LV_PROFILER_FS_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_FS_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_FS_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_FS_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_FS_BEGIN
|
||||||
|
#define LV_PROFILER_FS_END
|
||||||
|
#define LV_PROFILER_FS_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_FS_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_PROFILER && LV_PROFILER_TIMER
|
||||||
|
#define LV_PROFILER_TIMER_BEGIN LV_PROFILER_BEGIN
|
||||||
|
#define LV_PROFILER_TIMER_END LV_PROFILER_END
|
||||||
|
#define LV_PROFILER_TIMER_BEGIN_TAG(tag) LV_PROFILER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_TIMER_END_TAG(tag) LV_PROFILER_END_TAG(tag)
|
||||||
|
#else
|
||||||
|
#define LV_PROFILER_TIMER_BEGIN
|
||||||
|
#define LV_PROFILER_TIMER_END
|
||||||
|
#define LV_PROFILER_TIMER_BEGIN_TAG(tag)
|
||||||
|
#define LV_PROFILER_TIMER_END_TAG(tag)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /*extern "C"*/
|
} /*extern "C"*/
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
|||||||
|
|
||||||
if(style->prop_cnt == 0) return false;
|
if(style->prop_cnt == 0) return false;
|
||||||
|
|
||||||
|
LV_PROFILER_STYLE_BEGIN;
|
||||||
|
|
||||||
uint8_t * tmp = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
uint8_t * tmp = (lv_style_prop_t *)style->values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
||||||
uint8_t * old_props = (uint8_t *)tmp;
|
uint8_t * old_props = (uint8_t *)tmp;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
@@ -259,7 +261,11 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
|||||||
|
|
||||||
size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t));
|
size_t size = (style->prop_cnt - 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t));
|
||||||
uint8_t * new_values_and_props = lv_malloc(size);
|
uint8_t * new_values_and_props = lv_malloc(size);
|
||||||
if(new_values_and_props == NULL) return false;
|
if(new_values_and_props == NULL) {
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
style->values_and_props = new_values_and_props;
|
style->values_and_props = new_values_and_props;
|
||||||
style->prop_cnt--;
|
style->prop_cnt--;
|
||||||
|
|
||||||
@@ -277,10 +283,12 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
|
|||||||
}
|
}
|
||||||
|
|
||||||
lv_free(old_values);
|
lv_free(old_values);
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +302,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
|||||||
}
|
}
|
||||||
|
|
||||||
LV_ASSERT(prop != LV_STYLE_PROP_INV);
|
LV_ASSERT(prop != LV_STYLE_PROP_INV);
|
||||||
|
LV_PROFILER_STYLE_BEGIN;
|
||||||
lv_style_prop_t * props;
|
lv_style_prop_t * props;
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
||||||
@@ -304,6 +312,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
|||||||
if(props[i] == prop) {
|
if(props[i] == prop) {
|
||||||
lv_style_value_t * values = (lv_style_value_t *)style->values_and_props;
|
lv_style_value_t * values = (lv_style_value_t *)style->values_and_props;
|
||||||
values[i] = value;
|
values[i] = value;
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,7 +320,11 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
|||||||
|
|
||||||
size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t));
|
size_t size = (style->prop_cnt + 1) * (sizeof(lv_style_value_t) + sizeof(lv_style_prop_t));
|
||||||
uint8_t * values_and_props = lv_realloc(style->values_and_props, size);
|
uint8_t * values_and_props = lv_realloc(style->values_and_props, size);
|
||||||
if(values_and_props == NULL) return;
|
if(values_and_props == NULL) {
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
style->values_and_props = values_and_props;
|
style->values_and_props = values_and_props;
|
||||||
|
|
||||||
props = values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
props = values_and_props + style->prop_cnt * sizeof(lv_style_value_t);
|
||||||
@@ -331,6 +344,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
|
|||||||
|
|
||||||
uint32_t group = lv_style_get_prop_group(prop);
|
uint32_t group = lv_style_get_prop_group(prop);
|
||||||
style->has_group |= (uint32_t)1 << group;
|
style->has_group |= (uint32_t)1 << group;
|
||||||
|
LV_PROFILER_STYLE_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)
|
lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_TIMER_BEGIN;
|
||||||
lv_lock();
|
lv_lock();
|
||||||
|
|
||||||
uint32_t handler_start = lv_tick_get();
|
uint32_t handler_start = lv_tick_get();
|
||||||
@@ -143,8 +143,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
|||||||
LV_TRACE_TIMER("finished (%" LV_PRIu32 " ms until the next timer call)", time_until_next);
|
LV_TRACE_TIMER("finished (%" LV_PRIu32 " ms until the next timer call)", time_until_next);
|
||||||
lv_unlock();
|
lv_unlock();
|
||||||
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_TIMER_END;
|
||||||
|
|
||||||
return time_until_next;
|
return time_until_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user