From fe1b039554c91be4cf5b6cbad29f67f13a749fa6 Mon Sep 17 00:00:00 2001 From: Subhransu Mohanty Date: Thu, 25 Feb 2021 10:59:33 +0900 Subject: [PATCH] add lottie_configure_model_cache_size() c api Change-Id: I56e51ae7651f9a966d56f70ebb304408d973cfae --- inc/rlottie_capi.h | 17 +++++++++++++++++ src/binding/c/lottieanimation_capi.cpp | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/inc/rlottie_capi.h b/inc/rlottie_capi.h index c54de28..7c883fa 100644 --- a/inc/rlottie_capi.h +++ b/inc/rlottie_capi.h @@ -274,6 +274,23 @@ RLOTTIE_API void lottie_animation_property_override(Lottie_Animation *animation, * */ RLOTTIE_API const LOTMarkerList* lottie_animation_get_markerlist(Lottie_Animation *animation); +/** + * @brief Configures rlottie model cache policy. + * + * Provides Library level control to configure model cache + * policy. Setting it to 0 will disable + * the cache as well as flush all the previously cached content. + * + * @param[in] cacheSize Maximum Model Cache size. + * + * @note to disable Caching configure with 0 size. + * @note to flush the current Cache content configure it with 0 and + * then reconfigure with the new size. + * + * @internal + */ +RLOTTIE_API void lottie_configure_model_cache_size(size_t cacheSize); + #ifdef __cplusplus } #endif diff --git a/src/binding/c/lottieanimation_capi.cpp b/src/binding/c/lottieanimation_capi.cpp index 2434b5f..a54dac5 100644 --- a/src/binding/c/lottieanimation_capi.cpp +++ b/src/binding/c/lottieanimation_capi.cpp @@ -275,4 +275,10 @@ lottie_animation_get_markerlist(Lottie_Animation_S *animation) return (const LOTMarkerList*)animation->mMarkerList; } +RLOTTIE_API void +lottie_configure_model_cache_size(size_t cacheSize) +{ + rlottie::configureModelCacheSize(cacheSize); +} + } -- 2.34.1