From 350e15a12e8170d800d58e4720097977dfad4afb Mon Sep 17 00:00:00 2001 From: xaowang96 <32351888+xaowang96@users.noreply.github.com> Date: Wed, 15 Dec 2021 21:27:09 +0800 Subject: [PATCH] chore(lottie) move rlottie_capi.h to lv_rlottie.c (#2902) fix(lottie) invalidate image src after delete rlottie Signed-off-by: wangxuedong Change-Id: Ie8ec726663335925ae9f25f2428097c2f948892e --- src/extra/libs/rlottie/lv_rlottie.c | 3 +++ src/extra/libs/rlottie/lv_rlottie.h | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/extra/libs/rlottie/lv_rlottie.c b/src/extra/libs/rlottie/lv_rlottie.c index 35a5a3389..8b162a5da 100644 --- a/src/extra/libs/rlottie/lv_rlottie.c +++ b/src/extra/libs/rlottie/lv_rlottie.c @@ -9,6 +9,8 @@ #include "lv_rlottie.h" #if LV_USE_RLOTTIE +#include + /********************* * DEFINES *********************/ @@ -170,6 +172,7 @@ static void lv_rlottie_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj rlottie->dest_frame = 0; } + lv_img_cache_invalidate_src(&rlottie->imgdsc); if(rlottie->allocated_buf) { lv_mem_free(rlottie->allocated_buf); rlottie->allocated_buf = NULL; diff --git a/src/extra/libs/rlottie/lv_rlottie.h b/src/extra/libs/rlottie/lv_rlottie.h index c53a7b891..d66dc22c0 100644 --- a/src/extra/libs/rlottie/lv_rlottie.h +++ b/src/extra/libs/rlottie/lv_rlottie.h @@ -16,8 +16,6 @@ extern "C" { #include "../../../lvgl.h" #if LV_USE_RLOTTIE -#include - /********************* * DEFINES *********************/ @@ -33,9 +31,11 @@ typedef enum { LV_RLOTTIE_CTRL_LOOP = 8, } lv_rlottie_ctrl_t; +/** definition in lottieanimation_capi.c */ +struct Lottie_Animation_S; typedef struct { lv_img_t img_ext; - Lottie_Animation * animation; + struct Lottie_Animation_S * animation; lv_timer_t * task; lv_img_dsc_t imgdsc; size_t total_frames;