Revert "trial & error to figure out the lottie packaging issue in vd." accepted/tizen/unified/20190923.011146 submit/tizen/20190919.052822
authorHermet Park <hermetpark@gmail.com>
Thu, 19 Sep 2019 02:18:40 +0000 (11:18 +0900)
committerHermet Park <hermetpark@gmail.com>
Thu, 19 Sep 2019 02:18:50 +0000 (11:18 +0900)
This reverts commit 2e5c1c74ba887cf8170c8aa9e8ee4eb4d2c36a78.

This doens't work.

Change-Id: I764b8bdbadedbb0954cb1fe410d2a10f2da807e7

CMakeLists.txt
example/evasapp.cpp
example/lottieview.cpp
example/uxsampletest.cpp
meson.build
src/lottie/lottieitem.cpp
src/lottie/lottieparser.cpp
src/vector/vdrawhelper.cpp
src/vector/vglobal.h

index 4f6f1c8..e0d4e0b 100644 (file)
@@ -45,7 +45,7 @@ target_include_directories(rlottie
 target_compile_options(rlottie
                     PUBLIC
                     PRIVATE
-                        -std=c++11
+                        -std=c++14
                         -fno-exceptions
                         -fno-unwind-tables
                         -fno-asynchronous-unwind-tables
index c3c8011..1fa3c0e 100644 (file)
@@ -134,7 +134,7 @@ EvasApp::jsonFiles(const std::string &dirName, bool /*recurse*/)
       closedir(d);
     }
 
-    std::sort(result.begin(), result.end(), [](std::string & a, std::string &b){return a < b;});
+    std::sort(result.begin(), result.end(), [](auto & a, auto &b){return a < b;});
 
     return result;
 }
index 3ac4dc9..8659c16 100644 (file)
@@ -55,27 +55,27 @@ LottieView::LottieView(Evas *evas, Strategy s) {
 
     switch (s) {
     case Strategy::renderCpp: {
-        mRenderDelegate = std::unique_ptr<RlottieRenderStrategy_CPP>(new RlottieRenderStrategy_CPP(evas));
+        mRenderDelegate = std::make_unique<RlottieRenderStrategy_CPP>(evas);
         break;
     }
     case Strategy::renderCppAsync: {
-        mRenderDelegate = std::unique_ptr<RlottieRenderStrategy_CPP_ASYNC>(new RlottieRenderStrategy_CPP_ASYNC(evas));
+        mRenderDelegate = std::make_unique<RlottieRenderStrategy_CPP_ASYNC>(evas);
         break;
     }
     case Strategy::renderC: {
-        mRenderDelegate = std::unique_ptr<RlottieRenderStrategy_C>(new RlottieRenderStrategy_C(evas));
+        mRenderDelegate = std::make_unique<RlottieRenderStrategy_C>(evas);
         break;
     }
     case Strategy::renderCAsync: {
-        mRenderDelegate = std::unique_ptr<RlottieRenderStrategy_C_ASYNC>(new RlottieRenderStrategy_C_ASYNC(evas));
+        mRenderDelegate = std::make_unique<RlottieRenderStrategy_C_ASYNC>(evas);
         break;
     }
     case Strategy::eflVg: {
-        mRenderDelegate = std::unique_ptr<EflVgRenderStrategy>(new EflVgRenderStrategy(evas));
+        mRenderDelegate = std::make_unique<EflVgRenderStrategy>(evas);
         break;
     }
     default:
-        mRenderDelegate = std::unique_ptr<RlottieRenderStrategy_CPP>(new RlottieRenderStrategy_CPP(evas));
+        mRenderDelegate = std::make_unique<RlottieRenderStrategy_CPP>(evas);
         break;
     }
 }
index 5e6b462..6fcbae8 100644 (file)
@@ -57,7 +57,7 @@ public:
 
 private:
   void show() {
-      mView = std::unique_ptr<LottieView>(new LottieView(mApp->evas(), Strategy::renderCAsync));
+      mView = std::make_unique<LottieView>(mApp->evas(), Strategy::renderCAsync);
       mView->setFilePath(mResourceList[mCurIndex].c_str());
       mView->setPos(0, 0);
       mView->setSize(mApp->width(), mApp->height());
index 4ca9664..e4d1669 100644 (file)
@@ -1,6 +1,6 @@
 project('rlottie',
         'cpp',
-        default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++11', 'optimization=s'],
+        default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
         version : '0.0.1',
         license : 'Apache')
 
index 68815fc..cdab800 100644 (file)
@@ -432,8 +432,9 @@ LOTCompLayerItem::LOTCompLayerItem(LOTLayerData *layerModel)
     for (const auto &layer : mLayers) {
         int id = layer->parentId();
         if (id >= 0) {
-            auto search = std::find_if(mLayers.begin(), mLayers.end(),
-                            [id](const std::unique_ptr<LOTLayerItem>& val){ return val->id() == id;});
+            auto search =
+                std::find_if(mLayers.begin(), mLayers.end(),
+                             [id](const auto &val) { return val->id() == id; });
             if (search != mLayers.end()) layer->setParentLayer((*search).get());
         }
     }
index 50776f7..aab1275 100644 (file)
@@ -589,7 +589,7 @@ void LottieParserImpl::parseComposition()
         }
     }
 
-    if (comp->mVersion.empty() || !comp->mRootLayer) {
+    if (comp->mVersion.empty()) {
         // don't have a valid bodymovin header
         return;
     }
@@ -771,7 +771,10 @@ LottieColor LottieParserImpl::toColor(const char *str)
 
     // some resource has empty color string
     // return a default color for those cases.
-    if (len != 7 || str[0] != '#') return color;
+    if (!len) return color;
+
+    RAPIDJSON_ASSERT(len == 7);
+    RAPIDJSON_ASSERT(str[0] == '#');
 
     char tmp[3] = {'\0', '\0', '\0'};
     tmp[0] = str[1];
@@ -1709,16 +1712,13 @@ void LottieParserImpl::getValue(std::vector<VPointF> &v)
 
 void LottieParserImpl::getValue(VPointF &pt)
 {
-    float val[4] = {0.f};
+    float val[4];
     int   i = 0;
 
     if (PeekType() == kArrayType) EnterArray();
 
     while (NextArrayValue()) {
-        const auto value = GetDouble();
-        if (i < 4) {
-            val[i++] = value;
-        }
+        val[i++] = GetDouble();
     }
     pt.setX(val[0]);
     pt.setY(val[1]);
@@ -1742,15 +1742,12 @@ void LottieParserImpl::getValue(float &val)
 
 void LottieParserImpl::getValue(LottieColor &color)
 {
-    float val[4] = {0.f};
+    float val[4];
     int   i = 0;
     if (PeekType() == kArrayType) EnterArray();
 
     while (NextArrayValue()) {
-        const auto value = GetDouble();
-        if (i < 4) {
-            val[i++] = value;
-        }
+        val[i++] = GetDouble();
     }
     color.r = val[0];
     color.g = val[1];
index e3ae7a8..d6fa3d1 100644 (file)
@@ -135,9 +135,6 @@ protected:
         return cache_entry;
     }
 
-private:
-    VGradientCache() = default;
-
     VGradientColorTableHash mCache;
     std::mutex              mMutex;
 };
index 5426890..75c947c 100644 (file)
@@ -70,45 +70,6 @@ using uchar  = uint8_t;
 #define VECTOR_FALLTHROUGH
 #endif
 
-#if __cplusplus==201103L
-
-#include <memory>
-
-namespace std {
-
-template<class T> struct _Unique_if {
-    typedef unique_ptr<T> _Single_object;
-};
-
-template<class T> struct _Unique_if<T[]> {
-    typedef unique_ptr<T[]> _Unknown_bound;
-};
-
-template<class T, size_t N> struct _Unique_if<T[N]> {
-    typedef void _Known_bound;
-};
-
-template<class T, class... Args>
-    typename _Unique_if<T>::_Single_object
-    make_unique(Args&&... args) {
-        return unique_ptr<T>(new T(std::forward<Args>(args)...));
-    }
-
-template<class T>
-    typename _Unique_if<T>::_Unknown_bound
-    make_unique(size_t n) {
-        typedef typename remove_extent<T>::type U;
-        return unique_ptr<T>(new U[n]());
-    }
-
-template<class T, class... Args>
-    typename _Unique_if<T>::_Known_bound
-    make_unique(Args&&...) = delete;
-
-}  //namespace std
-
-#endif //__cplusplus==201103L
-
 #include <atomic>
 class RefCount {
 public: