mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 23:51:54 +08:00
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:
@@ -80,6 +80,7 @@ void lv_draw_vg_lite_init(void)
|
|||||||
#endif
|
#endif
|
||||||
lv_vg_lite_path_init(unit);
|
lv_vg_lite_path_init(unit);
|
||||||
lv_vg_lite_decoder_init();
|
lv_vg_lite_decoder_init();
|
||||||
|
lv_draw_vg_lite_label_init(&unit->base_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_vg_lite_deinit(void)
|
void lv_draw_vg_lite_deinit(void)
|
||||||
|
|||||||
@@ -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,
|
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);
|
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,
|
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);
|
||||||
|
|
||||||
|
|||||||
@@ -71,19 +71,20 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
|
|||||||
* GLOBAL FUNCTIONS
|
* 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,
|
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_DRAW_BEGIN;
|
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_draw_label_iterate_characters(draw_unit, dsc, coords, draw_letter_cb);
|
||||||
LV_PROFILER_DRAW_END;
|
LV_PROFILER_DRAW_END;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-5
@@ -199,6 +199,13 @@ void lv_init(void)
|
|||||||
|
|
||||||
lv_group_init();
|
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();
|
lv_draw_init();
|
||||||
|
|
||||||
#if LV_USE_DRAW_SW
|
#if LV_USE_DRAW_SW
|
||||||
@@ -350,11 +357,6 @@ void lv_init(void)
|
|||||||
lv_ffmpeg_init();
|
lv_ffmpeg_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LV_USE_FREETYPE
|
|
||||||
/*Init freetype library*/
|
|
||||||
lv_freetype_init(LV_FREETYPE_CACHE_FT_GLYPH_CNT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lv_initialized = true;
|
lv_initialized = true;
|
||||||
|
|
||||||
LV_LOG_TRACE("finished");
|
LV_LOG_TRACE("finished");
|
||||||
|
|||||||
Reference in New Issue
Block a user