lottie/builder: revert the clipper cache.

This ia a buggy,
We will revisit this optimization with a perfect solution.
This commit is contained in:
Hermet Park 2023-11-24 12:19:24 +09:00
parent 3674078b31
commit 221005bb25
3 changed files with 2 additions and 11 deletions

View file

@ -817,12 +817,8 @@ static void _updatePrecomp(LottieLayer* precomp, float frameNo)
//clip the layer viewport
if (precomp->w > 0 && precomp->h > 0) {
if (!precomp->cache.clipper) {
precomp->cache.clipper = Shape::gen().release();
PP(precomp->cache.clipper)->ref();
precomp->cache.clipper->appendRect(0, 0, static_cast<float>(precomp->w), static_cast<float>(precomp->h));
}
auto clipper = precomp->cache.clipper;
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....

View file

@ -156,8 +156,6 @@ LottieLayer::~LottieLayer()
delete(matte.target);
delete(transform);
if (cache.clipper && PP(cache.clipper)->unref() == 0) delete(cache.clipper);
}
void LottieLayer::prepare()

View file

@ -524,9 +524,6 @@ struct LottieLayer : LottieGroup
float frameNo = -1.0f;
Matrix matrix;
uint8_t opacity;
//tvg render data
tvg::Shape* clipper = nullptr;
} cache;
Type type = Null;