diff --git a/src/examples/Animation.cpp b/src/examples/Animation.cpp index 38b2865e..b95778db 100644 --- a/src/examples/Animation.cpp +++ b/src/examples/Animation.cpp @@ -28,15 +28,16 @@ static unique_ptr animation; static Elm_Transit *transit; +static bool updated = false; void tvgUpdateCmds(tvg::Canvas* canvas, tvg::Animation* animation, float progress) { - if (!canvas) return; - canvas->clear(false); + if (updated || !canvas) return; //Update animation frame only when it's changed if (animation->frame(animation->totalFrame() * progress) == tvg::Result::Success) { canvas->update(); + updated = true; } } @@ -101,8 +102,12 @@ void tvgSwTest(uint32_t* buffer) void drawSwView(void* data, Eo* obj) { + //It's not necessary to clear buffer since it has a solid background + //swCanvas->clear(false); + if (swCanvas->draw() == tvg::Result::Success) { swCanvas->sync(); + updated = false; } } diff --git a/src/examples/DirectUpdate.cpp b/src/examples/DirectUpdate.cpp index 06e823f4..a11e6086 100644 --- a/src/examples/DirectUpdate.cpp +++ b/src/examples/DirectUpdate.cpp @@ -61,9 +61,8 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress) { if (!canvas) return; - /* Update shape directly. - You can update necessary properties of this shape. */ - canvas->clear(false); + //It's not necessary to clear canvas since it has a solid background and retaining the paints. + //canvas->clear(false); //Reset Shape if (pShape->reset() == tvg::Result::Success) { diff --git a/src/examples/Lottie.cpp b/src/examples/Lottie.cpp index 8b3030f8..e9cbc5e4 100644 --- a/src/examples/Lottie.cpp +++ b/src/examples/Lottie.cpp @@ -142,7 +142,8 @@ void tvgSwTest(uint32_t* buffer) void drawSwView(void* data, Eo* obj) { - swCanvas->clear(false); + //It's not necessary to clear buffer since it has a solid background + //swCanvas->clear(false); //canvas update auto before = ecore_time_get();