mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-19 14:31:39 +00:00
parent
bd3d92f599
commit
39644a676d
2 changed files with 6 additions and 5 deletions
|
@ -59,7 +59,7 @@ Result Canvas::update() noexcept
|
||||||
{
|
{
|
||||||
TVGLOG("RENDERER", "Update S. ------------------------------ Canvas(%p)", this);
|
TVGLOG("RENDERER", "Update S. ------------------------------ Canvas(%p)", this);
|
||||||
if (pImpl->scene->paints().empty() || pImpl->status == Status::Drawing) return Result::InsufficientCondition;
|
if (pImpl->scene->paints().empty() || pImpl->status == Status::Drawing) return Result::InsufficientCondition;
|
||||||
auto ret = pImpl->update(false);
|
auto ret = pImpl->update(nullptr, false);
|
||||||
TVGLOG("RENDERER", "Update E. ------------------------------ Canvas(%p)", this);
|
TVGLOG("RENDERER", "Update E. ------------------------------ Canvas(%p)", this);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -56,7 +56,7 @@ struct Canvas::Impl
|
||||||
auto ret = scene->push(target, at);
|
auto ret = scene->push(target, at);
|
||||||
if (ret != Result::Success) return ret;
|
if (ret != Result::Success) return ret;
|
||||||
|
|
||||||
return update(true);
|
return update(target, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result remove(Paint* paint)
|
Result remove(Paint* paint)
|
||||||
|
@ -65,7 +65,7 @@ struct Canvas::Impl
|
||||||
return scene->remove(paint);
|
return scene->remove(paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result update(bool force)
|
Result update(Paint* paint, bool force)
|
||||||
{
|
{
|
||||||
Array<RenderData> clips;
|
Array<RenderData> clips;
|
||||||
auto flag = RenderUpdateFlag::None;
|
auto flag = RenderUpdateFlag::None;
|
||||||
|
@ -74,7 +74,8 @@ struct Canvas::Impl
|
||||||
if (!renderer->preUpdate()) return Result::InsufficientCondition;
|
if (!renderer->preUpdate()) return Result::InsufficientCondition;
|
||||||
|
|
||||||
auto m = tvg::identity();
|
auto m = tvg::identity();
|
||||||
PAINT(scene)->update(renderer, m, clips, 255, flag);
|
if (paint) PAINT(paint)->update(renderer, m, clips, 255, flag);
|
||||||
|
else PAINT(scene)->update(renderer, m, clips, 255, flag);
|
||||||
|
|
||||||
if (!renderer->postUpdate()) return Result::InsufficientCondition;
|
if (!renderer->postUpdate()) return Result::InsufficientCondition;
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ struct Canvas::Impl
|
||||||
if (status == Status::Drawing) return Result::InsufficientCondition;
|
if (status == Status::Drawing) return Result::InsufficientCondition;
|
||||||
if (clear && !renderer->clear()) return Result::InsufficientCondition;
|
if (clear && !renderer->clear()) return Result::InsufficientCondition;
|
||||||
if (scene->paints().empty()) return Result::InsufficientCondition;
|
if (scene->paints().empty()) return Result::InsufficientCondition;
|
||||||
if (status == Status::Damaged) update(false);
|
if (status == Status::Damaged) update(nullptr, false);
|
||||||
if (!renderer->preRender()) return Result::InsufficientCondition;
|
if (!renderer->preRender()) return Result::InsufficientCondition;
|
||||||
|
|
||||||
if (!PAINT(scene)->render(renderer) || !renderer->postRender()) return Result::InsufficientCondition;
|
if (!PAINT(scene)->render(renderer) || !renderer->postRender()) return Result::InsufficientCondition;
|
||||||
|
|
Loading…
Add table
Reference in a new issue