From a2614da5c660ae2580ecd09198f36079719b2c6d Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Thu, 24 Jan 2019 11:28:50 +0900 Subject: [PATCH] lottie: final changes to rename from lottie-player to rlottie Change-Id: Ie2ed4d7c3fb08abd3f8fe484021d478e90bc9d91 --- CMakeLists.txt | 5 ----- example/lottieview.cpp | 6 +++--- example/lottieview.h | 4 ++-- inc/lottieanimation.h | 1 - inc/meson.build | 1 - inc/rlottie.h | 2 +- packaging/rlottie.spec | 5 ++--- rlottie.manifest | 5 ----- src/binding/c/lottieanimation_capi.cpp | 4 ++-- src/lottie/lottieanimation.cpp | 2 +- src/lottie/lottieitem.cpp | 2 +- src/lottie/lottieitem.h | 2 +- test/test_lottieanimation.cpp | 8 ++++---- 13 files changed, 17 insertions(+), 30 deletions(-) delete mode 100644 inc/lottieanimation.h delete mode 100644 rlottie.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index 4249b0f384..0e164d5ced 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,17 +56,12 @@ SET(INCDIR ${PREFIX}/include) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) -#temporary for lottie-player dependency. -CONFIGURE_FILE(${PROJECT_NAME}.pc.in lottie-player.pc) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lottie-player.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) - #install header install(FILES inc/rlottie.h inc/rlottie_capi.h inc/rlottiecommon.h - inc/lottieanimation.h DESTINATION include) #install lib diff --git a/example/lottieview.cpp b/example/lottieview.cpp index a09417ac7d..7671735e62 100644 --- a/example/lottieview.cpp +++ b/example/lottieview.cpp @@ -18,7 +18,7 @@ #include"lottieview.h" -using namespace lottie; +using namespace rlottie; static Eina_Bool animator(void *data , double pos) @@ -321,14 +321,14 @@ void LottieView::seek(float pos) mDirty = true; auto buffer = (uint32_t *)evas_object_image_data_get(mImage, EINA_TRUE); size_t bytesperline = evas_object_image_stride_get(mImage); - lottie::Surface surface(buffer, width, height, bytesperline); + rlottie::Surface surface(buffer, width, height, bytesperline); mRenderTask = mPlayer->render(mCurFrame, surface); // to force a redraw evas_object_image_data_update_add(mImage, 0 , 0, surface.width(), surface.height()); } else { auto buffer = (uint32_t *)evas_object_image_data_get(mImage, EINA_TRUE); size_t bytesperline = evas_object_image_stride_get(mImage); - lottie::Surface surface(buffer, width, height, bytesperline); + rlottie::Surface surface(buffer, width, height, bytesperline); mPlayer->renderSync(mCurFrame, surface); evas_object_image_data_set(mImage, surface.buffer()); evas_object_image_data_update_add(mImage, 0 , 0, surface.width(), surface.height()); diff --git a/example/lottieview.h b/example/lottieview.h index aab0336fcc..1ff8266c5c 100644 --- a/example/lottieview.h +++ b/example/lottieview.h @@ -108,7 +108,7 @@ public: Evas_Object *mVg; int mRepeatCount; LottieView::RepeatMode mRepeatMode; - std::unique_ptr mPlayer; + std::unique_ptr mPlayer; size_t mCurFrame{UINT_MAX}; Ecore_Animator *mAnimator{nullptr}; bool mLoop; @@ -123,7 +123,7 @@ public: float mPos; float mFrameRate; long mTotalFrame; - std::future mRenderTask; + std::future mRenderTask; //keep a segment of the animation default is [0, 1] float mMinProgress{0}; diff --git a/inc/lottieanimation.h b/inc/lottieanimation.h deleted file mode 100644 index 1508b2ffff..0000000000 --- a/inc/lottieanimation.h +++ /dev/null @@ -1 +0,0 @@ -#include "rlottie.h" \ No newline at end of file diff --git a/inc/meson.build b/inc/meson.build index 7853c2e517..0349fac2f2 100644 --- a/inc/meson.build +++ b/inc/meson.build @@ -2,5 +2,4 @@ install_headers([ 'rlottie.h', 'rlottie_capi.h', 'rlottiecommon.h', - 'lottieanimation.h', ]) diff --git a/inc/rlottie.h b/inc/rlottie.h index 47aa4e254e..7821641188 100644 --- a/inc/rlottie.h +++ b/inc/rlottie.h @@ -49,7 +49,7 @@ class AnimationImpl; struct LOTNode; struct LOTLayerNode; -namespace lottie { +namespace rlottie { class LOT_EXPORT Surface { public: diff --git a/packaging/rlottie.spec b/packaging/rlottie.spec index 122ce8bf4d..1a343dbba1 100644 --- a/packaging/rlottie.spec +++ b/packaging/rlottie.spec @@ -1,4 +1,4 @@ -Name: rlottie +Name: lotti-player Summary: rlottie ibrary Version: 0.0.1 Release: 1 @@ -55,7 +55,7 @@ make %{?jobs:-j%jobs} %files %defattr(-,root,root,-) %{_libdir}/librlottie.so.* -%manifest %{name}.manifest +%manifest packaging/rlottie.manifest %license COPYING licenses/COPYING* %files devel @@ -64,5 +64,4 @@ make %{?jobs:-j%jobs} %{_libdir}/librlottie.so %{_libdir}/cmake/rlottie/*.cmake -%{_libdir}/pkgconfig/lottie-player.pc %{_libdir}/pkgconfig/rlottie.pc diff --git a/rlottie.manifest b/rlottie.manifest deleted file mode 100644 index 017d22d3af..0000000000 --- a/rlottie.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/binding/c/lottieanimation_capi.cpp b/src/binding/c/lottieanimation_capi.cpp index 6748f205a6..dd7f5e13fe 100644 --- a/src/binding/c/lottieanimation_capi.cpp +++ b/src/binding/c/lottieanimation_capi.cpp @@ -19,7 +19,7 @@ #include "rlottie.h" #include "vdebug.h" -using namespace lottie; +using namespace rlottie; extern "C" { @@ -117,7 +117,7 @@ lottie_animation_render_async(Lottie_Animation_S *animation, { if (!animation) return; - lottie::Surface surface(buffer, width, height, bytes_per_line); + rlottie::Surface surface(buffer, width, height, bytes_per_line); animation->mRenderTask = animation->mAnimation->render(frame_number, surface); animation->mBufferRef = buffer; } diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index 1f041f8f93..1084a23d26 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -23,7 +23,7 @@ #include -using namespace lottie; +using namespace rlottie; struct RenderTask { RenderTask() { receiver = sender.get_future(); } diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index aa88896968..3cd78fd4e5 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -121,7 +121,7 @@ const LOTLayerNode * LOTCompItem::renderTree() const return mRootLayer->layerNode(); } -bool LOTCompItem::render(const lottie::Surface &surface) +bool LOTCompItem::render(const rlottie::Surface &surface) { VBitmap bitmap(reinterpret_cast(surface.buffer()), surface.width(), surface.height(), diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index b38a37958a..9eda6d13c0 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -56,7 +56,7 @@ public: VSize size() const; void buildRenderTree(); const LOTLayerNode * renderTree()const; - bool render(const lottie::Surface &surface); + bool render(const rlottie::Surface &surface); private: VMatrix mScaleMatrix; VSize mViewSize; diff --git a/test/test_lottieanimation.cpp b/test/test_lottieanimation.cpp index 7b08b4f54a..d704fb4bfd 100644 --- a/test/test_lottieanimation.cpp +++ b/test/test_lottieanimation.cpp @@ -5,10 +5,10 @@ class AnimationTest : public ::testing::Test { public: void SetUp() { - animationInvalid = lottie::Animation::loadFromFile("wrong_file.json"); + animationInvalid = rlottie::Animation::loadFromFile("wrong_file.json"); std::string filePath = DEMO_DIR; filePath +="mask.json"; - animation = lottie::Animation::loadFromFile(filePath); + animation = rlottie::Animation::loadFromFile(filePath); } void TearDown() @@ -16,8 +16,8 @@ public: } public: - std::unique_ptr animationInvalid; - std::unique_ptr animation; + std::unique_ptr animationInvalid; + std::unique_ptr animation; }; TEST_F(AnimationTest, loadFromFile_N) {