lottie/parser: support parsing auto orient property of layer. 25/193125/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 15 Nov 2018 02:45:57 +0000 (11:45 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Thu, 15 Nov 2018 02:45:57 +0000 (11:45 +0900)
Change-Id: Ib7d757d43633d601fd76e8c3393219f7682c9112

src/lottie/lottiemodel.h
src/lottie/lottieparser.cpp

index b3dba60..385091f 100644 (file)
@@ -300,6 +300,7 @@ public:
     int solidWidth() const noexcept{return mSolidLayer.mWidth;}
     int solidHeight() const noexcept{return mSolidLayer.mHeight;}
     LottieColor solidColor() const noexcept{return mSolidLayer.mColor;}
+    bool autoOrient() const noexcept{return mAutoOrient;}
     int timeRemap(int frameNo) const;
 public:
     struct SolidLayer {
@@ -326,6 +327,7 @@ public:
     bool                 mHasRepeater{false};
     bool                 mHasGradient{false};
     bool                 mRoot{false};
+    bool                 mAutoOrient{false};
     std::vector<std::shared_ptr<LOTMaskData>>  mMasks;
     LOTCompositionData   *mCompRef;
 };
index 30cf7c8..18e576b 100644 (file)
@@ -791,6 +791,8 @@ std::shared_ptr<LOTData> LottieParserImpl::parseLayer()
             layer->mHasMask = GetBool();
         } else if (0 == strcmp(key, "masksProperties")) {
             parseMaskProperty(layer);
+        } else if (0 == strcmp(key, "ao")) {
+            layer->mAutoOrient = GetInt();
         } else {
 #ifdef DEBUG_PARSER
             vWarning << "Layer Attribute Skipped : " << key;
@@ -1206,7 +1208,7 @@ std::shared_ptr<LOTTransformData> LottieParserImpl::parseTransformObject()
             parseProperty(obj->mSkewAxis);
         } else if (0 == strcmp(key, "o")) {
             parseProperty(obj->mOpacity);
-        }  else if (0 == strcmp(key, "hd")) {
+        } else if (0 == strcmp(key, "hd")) {
             obj->mHidden = GetBool();
         } else {
             Skip(key);
@@ -1916,6 +1918,7 @@ public:
                << ", outFm:" << obj->mOutFrame
                << ", stFm:" << obj->mStartFrame
                << ", ts:" << obj->mTimeStreatch
+               << ", ao:" << obj->autoOrient()
                << "\n";
         visitChildren(static_cast<LOTGroupData *>(obj), level);
         vDebug << level