2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

QtLottie: Add precomp assets parsing.

This commit is contained in:
John Preston
2019-05-02 11:23:32 +04:00
parent f9a32dc70f
commit 2caa3e3def
6 changed files with 160 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtBodymovin/private/bmbase_p.h>
#include <QtBodymovin/private/bmlayer_p.h>
#include <QtBodymovin/private/bmasset_p.h>
#include "rasterrenderer/lottierasterrenderer.h"
@@ -138,8 +139,14 @@ void Animation::parse(const QByteArray &content) {
}
}
if (root.value(qstr("assets")).toArray().count()) {
_unsupported = true;
const auto assets = root.value(qstr("assets")).toArray();
for (const auto &entry : assets) {
if (const auto asset = BMAsset::construct(entry.toObject())) {
_assetIndexById.emplace(asset->id(), _assets.size());
_assets.emplace_back(asset);
} else {
_unsupported = true;
}
}
if (root.value(qstr("chars")).toArray().count()) {