mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie/builder: revert the clipper cache.
This ia a buggy, We will revisit this optimization with a perfect solution.
This commit is contained in:
parent
3674078b31
commit
221005bb25
3 changed files with 2 additions and 11 deletions
|
@ -817,12 +817,8 @@ static void _updatePrecomp(LottieLayer* precomp, float frameNo)
|
||||||
|
|
||||||
//clip the layer viewport
|
//clip the layer viewport
|
||||||
if (precomp->w > 0 && precomp->h > 0) {
|
if (precomp->w > 0 && precomp->h > 0) {
|
||||||
if (!precomp->cache.clipper) {
|
auto clipper = Shape::gen().release();
|
||||||
precomp->cache.clipper = Shape::gen().release();
|
clipper->appendRect(0, 0, static_cast<float>(precomp->w), static_cast<float>(precomp->h));
|
||||||
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;
|
|
||||||
clipper->transform(precomp->cache.matrix);
|
clipper->transform(precomp->cache.matrix);
|
||||||
|
|
||||||
//TODO: remove the intermediate scene....
|
//TODO: remove the intermediate scene....
|
||||||
|
|
|
@ -156,8 +156,6 @@ LottieLayer::~LottieLayer()
|
||||||
|
|
||||||
delete(matte.target);
|
delete(matte.target);
|
||||||
delete(transform);
|
delete(transform);
|
||||||
|
|
||||||
if (cache.clipper && PP(cache.clipper)->unref() == 0) delete(cache.clipper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LottieLayer::prepare()
|
void LottieLayer::prepare()
|
||||||
|
|
|
@ -524,9 +524,6 @@ struct LottieLayer : LottieGroup
|
||||||
float frameNo = -1.0f;
|
float frameNo = -1.0f;
|
||||||
Matrix matrix;
|
Matrix matrix;
|
||||||
uint8_t opacity;
|
uint8_t opacity;
|
||||||
|
|
||||||
//tvg render data
|
|
||||||
tvg::Shape* clipper = nullptr;
|
|
||||||
} cache;
|
} cache;
|
||||||
|
|
||||||
Type type = Null;
|
Type type = Null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue