mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-20 06:52:03 +00:00
Revert "lottie: ++ scene composing optimization"
This reverts commit bfdc8e4de7
.
hotfix due to a memoy corruption. please see asan test.
This commit is contained in:
parent
774d366dc2
commit
8c3586a7c4
3 changed files with 10 additions and 15 deletions
|
@ -1027,21 +1027,18 @@ static void _updatePrecomp(LottieLayer* precomp, float frameNo, LottieExpression
|
|||
if (!child->matteSrc) _updateLayer(precomp, child, frameNo, exps);
|
||||
}
|
||||
|
||||
//TODO: remove the intermediate scene....
|
||||
if (precomp->scene->composite(nullptr) != tvg::CompositeMethod::None) {
|
||||
auto cscene = Scene::gen().release();
|
||||
cscene->push(cast(precomp->scene));
|
||||
precomp->scene = cscene;
|
||||
}
|
||||
|
||||
//clip the layer viewport
|
||||
if (!precomp->clipper) {
|
||||
precomp->clipper = Shape::gen().release();
|
||||
precomp->clipper->appendRect(0, 0, static_cast<float>(precomp->w), static_cast<float>(precomp->h));
|
||||
PP(precomp->clipper)->ref();
|
||||
if (precomp->w > 0 && precomp->h > 0) {
|
||||
auto clipper = Shape::gen().release();
|
||||
clipper->appendRect(0, 0, static_cast<float>(precomp->w), static_cast<float>(precomp->h));
|
||||
clipper->transform(precomp->cache.matrix);
|
||||
|
||||
//TODO: remove the intermediate scene....
|
||||
auto cscene = Scene::gen();
|
||||
cscene->composite(cast(clipper), CompositeMethod::ClipPath);
|
||||
cscene->push(cast(precomp->scene));
|
||||
precomp->scene = cscene.release();
|
||||
}
|
||||
precomp->clipper->transform(precomp->cache.matrix);
|
||||
precomp->scene->composite(cast(precomp->clipper), CompositeMethod::ClipPath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -333,7 +333,6 @@ LottieLayer::~LottieLayer()
|
|||
|
||||
//Remove tvg render paints
|
||||
if (solidFill && PP(solidFill)->unref() == 0) delete(solidFill);
|
||||
if (clipper && PP(clipper)->unref() == 0) delete(clipper);
|
||||
|
||||
delete(transform);
|
||||
free(name);
|
||||
|
|
|
@ -594,7 +594,6 @@ struct LottieLayer : LottieGroup
|
|||
LottieLayer* matteTarget = nullptr;
|
||||
|
||||
tvg::Shape* solidFill = nullptr;
|
||||
tvg::Shape* clipper = nullptr;
|
||||
|
||||
float timeStretch = 1.0f;
|
||||
float w = 0.0f, h = 0.0f;
|
||||
|
|
Loading…
Add table
Reference in a new issue