Revert "lottie: minor optimization"

This reverts commit 51bc7e81f8.

note: side effect!
This commit is contained in:
Hermet Park 2025-03-26 20:49:23 +09:00
parent 745b4f4628
commit 3136cac6e4
2 changed files with 5 additions and 13 deletions

View file

@ -1039,14 +1039,13 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
auto& textGroupMatrix = textGroup->transform(); auto& textGroupMatrix = textGroup->transform();
auto shape = text->pooling(); auto shape = text->pooling();
shape->reset(); shape->reset();
ARRAY_FOREACH(p, glyph->children) { ARRAY_FOREACH(p, glyph->children) {
//Either group of a single path auto group = static_cast<LottieGroup*>(*p);
if ((*p)->type == LottieObject::Group) { ARRAY_FOREACH(p, group->children) {
ARRAY_FOREACH(p2, static_cast<LottieGroup*>(*p)->children) { if (static_cast<LottiePath*>(*p)->pathset(frameNo, SHAPE(shape)->rs.path, nullptr, tween, exps)) {
static_cast<LottiePath*>(*p2)->pathset(frameNo, SHAPE(shape)->rs.path, nullptr, tween, exps); PAINT(shape)->update(RenderUpdateFlag::Path);
}
} }
} else static_cast<LottiePath*>(*p)->pathset(frameNo, SHAPE(shape)->rs.path, nullptr, tween, exps);
} }
shape->fill(doc.color.rgb[0], doc.color.rgb[1], doc.color.rgb[2]); shape->fill(doc.color.rgb[0], doc.color.rgb[1], doc.color.rgb[2]);
shape->translate(cursor.x - textGroupMatrix.e13, cursor.y - textGroupMatrix.e23); shape->translate(cursor.x - textGroupMatrix.e13, cursor.y - textGroupMatrix.e23);

View file

@ -1079,13 +1079,6 @@ LottieObject* LottieParser::parseGroup()
while (nextArrayValue()) parseObject(group->children); while (nextArrayValue()) parseObject(group->children);
} else skip(); } else skip();
} }
if (group->children.count == 1) {
auto child = group->children.first();
group->children.clear();
delete(group);
return child;
}
group->prepare(); group->prepare();
return group; return group;