Page MenuHomePhabricator

Glyph cache garbage collector which collect during rendering
Open, NormalPublic

Description

Free unused or rarely used glyph caches, in GC

We will start calculating memory allocated for font glyphs textures in EFL.

we will provide two public functions to set and get limitation for texture cache:

/**
 * Set the limit in bytes for texture allocated by font glyphs for evas (in case of accelerated rendering)
 * @param[in] bytes cache size in bytes, pass 0 to ignore the limit.
 *
 * @since 1.24
 */
EAPI void                    evas_font_texture_cache_set(int bytes);

/**
 * @}
 */

/**
 * Get the limit in bytes for texture allocated by font glyphs for evas (in case of accelerated rendering)
 * @return Returns font allocated texture cache limit.
 * @since 1.24
 */
EAPI int                    evas_font_texture_cache_get();

When the limit is reached (actually 95%), we will request the GC to free up to 33% of the cache, in the next post-render cycle.

discussing this in IRC:
1- This could be added in **post-render** after **_cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);**
2- The better way to do this by moving the gc to a thread. but this needs the font/glyphs to be thread-safe (locked)
ali.alzyod triaged this task as Normal priority.
ali.alzyod renamed this task from Glyph cache garbage collector to Glyph cache garbage collector which collect during rendering.Jun 2 2020, 7:39 AM
ali.alzyod updated the task description. (Show Details)Jun 8 2020, 12:53 AM
raster added a comment.Jun 9 2020, 3:18 AM

can we not cal it texture_cache? as this also applies to software also not long but int will do like the other caches. if people need > 2gb of cache for this... they have problems :) so maybe evas_font_data_cache_set/get(). ?

can we not cal it texture_cache? as this also applies to software also not long but int will do like the other caches. if people need > 2gb of cache for this... they have problems :) so maybe evas_font_data_cache_set/get(). ?

these function does not effect SW render, only gl renderer

ali.alzyod updated the task description. (Show Details)Jun 11 2020, 1:04 AM