feat(font): add lv_font_glyph_release_draw_data api to release glyph data (#6052)
Co-authored-by: Benign X <1341398182@qq.com>
This commit is contained in:
1
.github/workflows/check_style.yml
vendored
1
.github/workflows/check_style.yml
vendored
@@ -18,6 +18,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repository: szepeviktor/astyle
|
repository: szepeviktor/astyle
|
||||||
path: astyle
|
path: astyle
|
||||||
|
ref: v3.4.10
|
||||||
- name: Install astyle
|
- name: Install astyle
|
||||||
run: |
|
run: |
|
||||||
cd astyle/build/gcc/
|
cd astyle/build/gcc/
|
||||||
|
|||||||
@@ -438,8 +438,7 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
|||||||
dsc->g = &g;
|
dsc->g = &g;
|
||||||
cb(draw_unit, dsc, NULL, NULL);
|
cb(draw_unit, dsc, NULL, NULL);
|
||||||
|
|
||||||
if(g.resolved_font && font->release_glyph) {
|
lv_font_glyph_release_draw_data(&g);
|
||||||
font->release_glyph(font, &g);
|
|
||||||
}
|
|
||||||
LV_PROFILER_END;
|
LV_PROFILER_END;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,15 @@ const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, uint32_t lett
|
|||||||
return font_p->get_glyph_bitmap(g_dsc, letter, draw_buf);
|
return font_p->get_glyph_bitmap(g_dsc, letter, draw_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc)
|
||||||
|
{
|
||||||
|
const lv_font_t * font = g_dsc->resolved_font;
|
||||||
|
|
||||||
|
if(font != NULL && font->release_glyph) {
|
||||||
|
font->release_glyph(font, g_dsc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
|
bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
|
||||||
uint32_t letter_next)
|
uint32_t letter_next)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,6 +133,13 @@ const void * lv_font_get_glyph_bitmap(lv_font_glyph_dsc_t * g_dsc, uint32_t lett
|
|||||||
bool lv_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
|
bool lv_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t letter,
|
||||||
uint32_t letter_next);
|
uint32_t letter_next);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release the bitmap of a font.
|
||||||
|
* @note You must call @lv_font_get_glyph_dsc to get @g_dsc (@lv_font_glyph_dsc_t) before you can call this function.
|
||||||
|
* @param g_dsc the glyph descriptor including which font to use, which supply the glyph_index and the format.
|
||||||
|
*/
|
||||||
|
void lv_font_glyph_release_draw_data(lv_font_glyph_dsc_t * g_dsc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the width of a glyph with kerning
|
* Get the width of a glyph with kerning
|
||||||
* @param font pointer to a font
|
* @param font pointer to a font
|
||||||
|
|||||||
Reference in New Issue
Block a user