Module graphics
Expand description
Global Skia graphics state: initialization and font cache configuration.
Functions§
- font_
cache_ count_ limit - Return the current limit to the number of entries in the font cache. A cache “entry” is associated with each typeface + point size + matrix.
- font_
cache_ count_ used - Return the number of entries in the font cache. A cache “entry” is associated with each typeface + point size + matrix.
- font_
cache_ limit - Return the max number of bytes that should be used by the font cache. If the cache needs to
allocate more, it will purge previous entries. This max can be changed by calling
set_font_cache_limit. - font_
cache_ used - Return the number of bytes currently used by the font cache.
- init
- Call this at process initialization time if your environment does not permit static global
initializers that execute code.
initis thread-safe and idempotent. - purge_
all_ caches - Free as much globally cached memory as possible. This will purge all private caches in Skia, including font and image caches.
- purge_
font_ cache - For debugging purposes, this will attempt to purge the font cache. It does not change the limit, but will cause subsequent font measures and draws to be recreated, since they will no longer be in the cache.
- purge_
pinned_ font_ cache - If the strike cache is above the cache limit, attempt to purge strikes with pinners. This should be called after clients release locks on pinned strikes.
- purge_
resource_ cache - For debugging purposes, this will attempt to purge the resource cache. It does not change the limit.
- resource_
cache_ single_ allocation_ byte_ limit - When the cacheable entry is very large, adding it to the cache can cause most or all of the existing entries to be purged. To avoid this, a client can set a limit for a single allocation. If a cacheable entry would have been cached, but its size exceeds this limit, then it is not cached at all.
- resource_
cache_ total_ bytes_ limit - Get the memory usage limit for the resource cache, used for temporary bitmaps and other resources. Entries are purged from the cache when the memory usage exceeds this limit.
- resource_
cache_ total_ bytes_ used - Returns the memory used for temporary images and other resources.
- set_
font_ cache_ count_ limit - Set the limit to the number of entries in the font cache, and return the previous value. If this new value is lower than the previous, it will automatically try to purge entries to meet the new limit.
- set_
font_ cache_ limit - Specify the max number of bytes that should be used by the font cache. If the cache needs to allocate more, it will purge previous entries.
- set_
resource_ cache_ single_ allocation_ byte_ limit - When the cacheable entry is very large, adding it to the cache can cause most or all of the existing entries to be purged. To avoid this, set a limit for a single allocation. If a cacheable entry would have been cached, but its size exceeds this limit, then it is not cached at all.
- set_
resource_ cache_ total_ bytes_ limit - Set the memory usage limit for the resource cache, used for temporary bitmaps and other resources. Entries are purged from the cache when the memory usage exceeds this limit.
- set_
typeface_ cache_ count_ limit - Set the limit to the number of entries in the typeface cache, and return the previous value. Changes to this only take effect the next time each cache object is modified.
- typeface_
cache_ count_ limit - Return the current limit to the number of entries in the typeface cache. A cache “entry” is associated with each typeface.