From 86bdf30479f6258b4281b678df4d749abc34bd04 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 10 Nov 2023 13:45:33 +0900 Subject: [PATCH] examples: show users the best practice usage. --- src/examples/Animation.cpp | 3 ++- src/examples/Lottie.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/examples/Animation.cpp b/src/examples/Animation.cpp index 68f8dc63..4f35994b 100644 --- a/src/examples/Animation.cpp +++ b/src/examples/Animation.cpp @@ -32,10 +32,11 @@ static Elm_Transit *transit; void tvgUpdateCmds(tvg::Canvas* canvas, tvg::Animation* animation, float progress) { if (!canvas) return; + canvas->clear(false); //Update animation frame only when it's changed if (animation->frame(animation->totalFrame() * progress) == tvg::Result::Success) { - canvas->update(animation->picture()); + canvas->update(); } } diff --git a/src/examples/Lottie.cpp b/src/examples/Lottie.cpp index d0bc5cbb..464145c4 100644 --- a/src/examples/Lottie.cpp +++ b/src/examples/Lottie.cpp @@ -142,6 +142,8 @@ void tvgSwTest(uint32_t* buffer) void drawSwView(void* data, Eo* obj) { + swCanvas->clear(false); + //canvas update auto before = ecore_time_get();