mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-01 16:50:33 +00:00
lottie: make animation class constructor private.
we can't use make_unique to create the animation object anymore because the constructor is private. so used unique_ptr constructor instead. Change-Id: I23b68c68d1b960085800365662ebb1cc676731cc
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#endif
|
||||
|
||||
class AnimationImpl;
|
||||
class LOTNode;
|
||||
struct LOTNode;
|
||||
|
||||
namespace lottie {
|
||||
|
||||
@@ -209,17 +209,12 @@ public:
|
||||
*/
|
||||
~Animation();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief default constructor
|
||||
*
|
||||
* @note user should never construct animation object.
|
||||
* they should call the one of the factory method instead.
|
||||
*
|
||||
* @see loadFromFile()
|
||||
* @see loadFromData()
|
||||
*/
|
||||
Animation();
|
||||
private:
|
||||
|
||||
std::unique_ptr<AnimationImpl> d;
|
||||
};
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ Animation::loadFromData(std::string jsonData, const std::string &key)
|
||||
|
||||
LottieLoader loader;
|
||||
if (loader.loadFromData(std::move(jsonData), key)) {
|
||||
auto animation = std::make_unique<Animation>();
|
||||
auto animation = std::unique_ptr<Animation>(new Animation);
|
||||
animation->d->init(loader.model());
|
||||
return animation;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ Animation::loadFromFile(const std::string &path)
|
||||
|
||||
LottieLoader loader;
|
||||
if (loader.load(path)) {
|
||||
auto animation = std::make_unique<Animation>();
|
||||
auto animation = std::unique_ptr<Animation>(new Animation);
|
||||
animation->d->init(loader.model());
|
||||
return animation;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user