diff --git a/.gitmodules b/.gitmodules index f2a4b6044..f3d4a717e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "Telegram/ThirdParty/qtlottie"] path = Telegram/ThirdParty/qtlottie url = https://github.com/telegramdesktop/qtlottie.git +[submodule "Telegram/ThirdParty/rapidjson"] + path = Telegram/ThirdParty/rapidjson + url = https://github.com/Tencent/rapidjson.git diff --git a/Telegram/SourceFiles/lottie/lottie_animation.cpp b/Telegram/SourceFiles/lottie/lottie_animation.cpp index 4d93332e0..0ee37c15b 100644 --- a/Telegram/SourceFiles/lottie/lottie_animation.cpp +++ b/Telegram/SourceFiles/lottie/lottie_animation.cpp @@ -16,6 +16,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include +#include + #include "logs.h" #include "rasterrenderer/rasterrenderer.h" @@ -55,6 +57,9 @@ Animation::Animation(const QByteArray &content) auto error = QJsonParseError(); const auto document = QJsonDocument::fromJson(content, &error); const auto parsed = crl::now(); + auto test = rapidjson::Document(); + test.Parse(content.data()); + const auto second = crl::now(); if (error.error != QJsonParseError::NoError) { qWarning() << "Lottie Error: Parse failed with code " @@ -70,7 +75,7 @@ Animation::Animation(const QByteArray &content) }); } const auto finish = crl::now(); - LOG(("INIT: %1 (PARSE %2)").arg(finish - now).arg(parsed - now)); + LOG(("INIT: %1 (PARSE %2, RAPIDJSON %3)").arg(finish - now).arg(parsed - now).arg(second - parsed)); }); } diff --git a/Telegram/ThirdParty/rapidjson b/Telegram/ThirdParty/rapidjson new file mode 160000 index 000000000..01950eb7a --- /dev/null +++ b/Telegram/ThirdParty/rapidjson @@ -0,0 +1 @@ +Subproject commit 01950eb7acec78818d68b762efc869bba2420d82 diff --git a/Telegram/gyp/lib_lottie.gyp b/Telegram/gyp/lib_lottie.gyp index 98fb9920f..886eb999d 100644 --- a/Telegram/gyp/lib_lottie.gyp +++ b/Telegram/gyp/lib_lottie.gyp @@ -51,6 +51,7 @@ '<(submodules_loc)/GSL/include', '<(submodules_loc)/variant/include', '<(submodules_loc)/crl/src', + '<(submodules_loc)/rapidjson/include', ], 'sources': [ # interface for tdesktop