From f9a32dc70fc68bb5f3ba87ce5d4202b567680c4b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 1 May 2019 22:53:08 +0400 Subject: [PATCH] QtLottie: Add support for null layer. --- Telegram/ThirdParty/qtlottie | 2 +- .../QtBodymovin/private/bmnulllayer_p.h | 72 +++++++++++++++++++ Telegram/gyp/lib_lottie.gyp | 8 +++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h diff --git a/Telegram/ThirdParty/qtlottie b/Telegram/ThirdParty/qtlottie index c9792720e6..270cd6f31b 160000 --- a/Telegram/ThirdParty/qtlottie +++ b/Telegram/ThirdParty/qtlottie @@ -1 +1 @@ -Subproject commit c9792720e6347afb22c0436274f447c0f958dc02 +Subproject commit 270cd6f31b9c67bdf2ff7cd961df8e5bb86e137c diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h new file mode 100644 index 0000000000..7343ed8f83 --- /dev/null +++ b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the lottie-qt module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BMNULLLAYER_P_H +#define BMNULLLAYER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QJsonObject; + +class LottieRenderer; +class BMShape; +class BMTrimPath; +class BMBasicTransform; + +class BODYMOVIN_EXPORT BMNullLayer : public BMLayer +{ +public: + BMNullLayer() = default; + explicit BMNullLayer(const BMNullLayer &other); + BMNullLayer(const QJsonObject &definition); + ~BMNullLayer() override; + + BMBase *clone() const override; + + void updateProperties(int frame) override; + void render(LottieRenderer &render) const override; + +}; + +QT_END_NAMESPACE + +#endif // BMNULLLAYER_P_H diff --git a/Telegram/gyp/lib_lottie.gyp b/Telegram/gyp/lib_lottie.gyp index 0bc6b96d6a..1f2287e417 100644 --- a/Telegram/gyp/lib_lottie.gyp +++ b/Telegram/gyp/lib_lottie.gyp @@ -60,11 +60,13 @@ '<(submodules_loc)/crl/src', ], 'sources': [ + # interface for tdesktop '<(src_loc)/lottie/lottie_animation.cpp', '<(src_loc)/lottie/lottie_animation.h', '<(src_loc)/lottie/lottie_frame_renderer.cpp', '<(src_loc)/lottie/lottie_frame_renderer.h', + # taken from qtlottie/src/bodymovin/bodymovin.pro '<(lottie_loc)/bodymovin/bmbase.cpp', '<(lottie_loc)/bodymovin/bmlayer.cpp', '<(lottie_loc)/bodymovin/bmshape.cpp', @@ -115,9 +117,15 @@ '<(lottie_loc)/bodymovin/bmpathtrimmer_p.h', '<(lottie_loc)/bodymovin/bmglobal.h', + # taken from qtlottie/src/imports/imports.pro '<(lottie_loc)/imports/rasterrenderer/lottierasterrenderer.cpp', '<(lottie_loc)/imports/rasterrenderer/lottierasterrenderer.h', + + # added to qtlottie/src/bodymovin/bodymovin.pro + '<(lottie_loc)/bodymovin/bmnulllayer.cpp', + + '<(lottie_loc)/bodymovin/bmnulllayer_p.h', ], 'conditions': [[ 'build_macold', { 'xcode_settings': {