fix(init): adjust the freetype initial order (#7363)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX
2024-11-28 07:25:27 +08:00
committed by GitHub
parent 6275520603
commit a4d70c9217
4 changed files with 20 additions and 14 deletions
+1
View File
@@ -80,6 +80,7 @@ void lv_draw_vg_lite_init(void)
#endif
lv_vg_lite_path_init(unit);
lv_vg_lite_decoder_init();
lv_draw_vg_lite_label_init(&unit->base_unit);
}
void lv_draw_vg_lite_deinit(void)
+2
View File
@@ -60,6 +60,8 @@ void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t *
void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc,
const lv_area_t * coords, bool no_cache);
void lv_draw_vg_lite_label_init(lv_draw_unit_t * draw_unit);
void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords);
+10 -9
View File
@@ -71,19 +71,20 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
* GLOBAL FUNCTIONS
**********************/
void lv_draw_vg_lite_label_init(lv_draw_unit_t * draw_unit)
{
#if LV_USE_FREETYPE
/*Set up the freetype outline event*/
lv_freetype_outline_add_event(freetype_outline_event_cb, LV_EVENT_ALL, draw_unit);
#else
LV_UNUSED(draw_unit);
#endif /* LV_USE_FREETYPE */
}
void lv_draw_vg_lite_label(lv_draw_unit_t * draw_unit, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords)
{
LV_PROFILER_DRAW_BEGIN;
#if LV_USE_FREETYPE
static bool is_init = false;
if(!is_init) {
lv_freetype_outline_add_event(freetype_outline_event_cb, LV_EVENT_ALL, draw_unit);
is_init = true;
}
#endif /* LV_USE_FREETYPE */
lv_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
LV_PROFILER_DRAW_END;
}
+7 -5
View File
@@ -199,6 +199,13 @@ void lv_init(void)
lv_group_init();
#if LV_USE_FREETYPE
/* Since the drawing unit needs to register the freetype event,
* initialize the freetype module first
*/
lv_freetype_init(LV_FREETYPE_CACHE_FT_GLYPH_CNT);
#endif
lv_draw_init();
#if LV_USE_DRAW_SW
@@ -350,11 +357,6 @@ void lv_init(void)
lv_ffmpeg_init();
#endif
#if LV_USE_FREETYPE
/*Init freetype library*/
lv_freetype_init(LV_FREETYPE_CACHE_FT_GLYPH_CNT);
#endif
lv_initialized = true;
LV_LOG_TRACE("finished");