mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
lottie: fixed a regression bug
reverted stroke optimization from the previous cullting stragtegy.
introduced by d386a5654a
This commit is contained in:
parent
3b5b0e7eaa
commit
fba861cb4f
1 changed files with 8 additions and 15 deletions
|
@ -236,8 +236,7 @@ static void _updateStroke(LottieStroke* stroke, float frameNo, RenderContext* ct
|
||||||
bool LottieBuilder::fragmented(LottieGroup* parent, LottieObject** child, Inlist<RenderContext>& contexts, RenderContext* ctx, RenderFragment fragment)
|
bool LottieBuilder::fragmented(LottieGroup* parent, LottieObject** child, Inlist<RenderContext>& contexts, RenderContext* ctx, RenderFragment fragment)
|
||||||
{
|
{
|
||||||
if (ctx->fragment) return true;
|
if (ctx->fragment) return true;
|
||||||
|
if (!ctx->reqFragment) return false;
|
||||||
if (!ctx->reqFragment || ctx->fragment == RenderFragment::ByNone) return false;
|
|
||||||
|
|
||||||
contexts.back(new RenderContext(*ctx, (Shape*)(PAINT(ctx->propagator)->duplicate(parent->pooling()))));
|
contexts.back(new RenderContext(*ctx, (Shape*)(PAINT(ctx->propagator)->duplicate(parent->pooling()))));
|
||||||
|
|
||||||
|
@ -251,12 +250,9 @@ bool LottieBuilder::fragmented(LottieGroup* parent, LottieObject** child, Inlist
|
||||||
bool LottieBuilder::updateSolidStroke(LottieGroup* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx)
|
bool LottieBuilder::updateSolidStroke(LottieGroup* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx)
|
||||||
{
|
{
|
||||||
auto stroke = static_cast<LottieSolidStroke*>(*child);
|
auto stroke = static_cast<LottieSolidStroke*>(*child);
|
||||||
auto opacity = stroke->opacity(frameNo, tween, exps);
|
|
||||||
|
|
||||||
//interrupted by fully opaque, stop the current rendering
|
|
||||||
if (ctx->fragment == RenderFragment::ByStroke && opacity == 255) return true;
|
|
||||||
|
|
||||||
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByStroke)) return false;
|
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByStroke)) return false;
|
||||||
|
|
||||||
|
auto opacity = stroke->opacity(frameNo, tween, exps);
|
||||||
if (opacity == 0) return false;
|
if (opacity == 0) return false;
|
||||||
|
|
||||||
ctx->merging = nullptr;
|
ctx->merging = nullptr;
|
||||||
|
@ -271,13 +267,11 @@ bool LottieBuilder::updateSolidStroke(LottieGroup* parent, LottieObject** child,
|
||||||
bool LottieBuilder::updateGradientStroke(LottieGroup* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx)
|
bool LottieBuilder::updateGradientStroke(LottieGroup* parent, LottieObject** child, float frameNo, Inlist<RenderContext>& contexts, RenderContext* ctx)
|
||||||
{
|
{
|
||||||
auto stroke = static_cast<LottieGradientStroke*>(*child);
|
auto stroke = static_cast<LottieGradientStroke*>(*child);
|
||||||
auto opacity = stroke->opacity(frameNo, tween, exps);
|
|
||||||
|
|
||||||
//interrupted by fully opaque, stop the current rendering
|
|
||||||
if (ctx->fragment == RenderFragment::ByStroke && stroke->opaque && opacity == 255) return true;
|
|
||||||
|
|
||||||
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByStroke)) return false;
|
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByStroke)) return false;
|
||||||
|
|
||||||
|
auto opacity = stroke->opacity(frameNo, tween, exps);
|
||||||
|
if (opacity == 0 && !stroke->opaque) return false;
|
||||||
|
|
||||||
ctx->merging = nullptr;
|
ctx->merging = nullptr;
|
||||||
if (auto val = stroke->fill(frameNo, opacity, tween, exps)) ctx->propagator->strokeFill(val);
|
if (auto val = stroke->fill(frameNo, opacity, tween, exps)) ctx->propagator->strokeFill(val);
|
||||||
_updateStroke(static_cast<LottieStroke*>(stroke), frameNo, ctx, tween, exps);
|
_updateStroke(static_cast<LottieStroke*>(stroke), frameNo, ctx, tween, exps);
|
||||||
|
@ -293,12 +287,11 @@ bool LottieBuilder::updateSolidFill(LottieGroup* parent, LottieObject** child, f
|
||||||
|
|
||||||
//interrupted by fully opaque, stop the current rendering
|
//interrupted by fully opaque, stop the current rendering
|
||||||
if (ctx->fragment == RenderFragment::ByFill && opacity == 255) return true;
|
if (ctx->fragment == RenderFragment::ByFill && opacity == 255) return true;
|
||||||
|
|
||||||
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByFill)) return false;
|
|
||||||
if (opacity == 0) return false;
|
if (opacity == 0) return false;
|
||||||
|
|
||||||
ctx->merging = nullptr;
|
if (fragmented(parent, child, contexts, ctx, RenderFragment::ByFill)) return false;
|
||||||
|
|
||||||
|
ctx->merging = nullptr;
|
||||||
auto color = fill->color(frameNo, tween, exps);
|
auto color = fill->color(frameNo, tween, exps);
|
||||||
ctx->propagator->fill(color.rgb[0], color.rgb[1], color.rgb[2], opacity);
|
ctx->propagator->fill(color.rgb[0], color.rgb[1], color.rgb[2], opacity);
|
||||||
ctx->propagator->fill(fill->rule);
|
ctx->propagator->fill(fill->rule);
|
||||||
|
|
Loading…
Add table
Reference in a new issue