mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
examples: show users the best practice usage.
This commit is contained in:
parent
33a2ef0b2d
commit
86bdf30479
2 changed files with 4 additions and 1 deletions
|
@ -32,10 +32,11 @@ static Elm_Transit *transit;
|
||||||
void tvgUpdateCmds(tvg::Canvas* canvas, tvg::Animation* animation, float progress)
|
void tvgUpdateCmds(tvg::Canvas* canvas, tvg::Animation* animation, float progress)
|
||||||
{
|
{
|
||||||
if (!canvas) return;
|
if (!canvas) return;
|
||||||
|
canvas->clear(false);
|
||||||
|
|
||||||
//Update animation frame only when it's changed
|
//Update animation frame only when it's changed
|
||||||
if (animation->frame(animation->totalFrame() * progress) == tvg::Result::Success) {
|
if (animation->frame(animation->totalFrame() * progress) == tvg::Result::Success) {
|
||||||
canvas->update(animation->picture());
|
canvas->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,8 @@ void tvgSwTest(uint32_t* buffer)
|
||||||
|
|
||||||
void drawSwView(void* data, Eo* obj)
|
void drawSwView(void* data, Eo* obj)
|
||||||
{
|
{
|
||||||
|
swCanvas->clear(false);
|
||||||
|
|
||||||
//canvas update
|
//canvas update
|
||||||
auto before = ecore_time_get();
|
auto before = ecore_time_get();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue