From: subhransu mohanty Date: Thu, 3 Jan 2019 06:17:55 +0000 (+0900) Subject: lottie/parser: parse precomp layer's with and height attribute. X-Git-Tag: submit/tizen/20190109.051753^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F196636%2F1;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/parser: parse precomp layer's with and height attribute. Change-Id: Ib975f753424acae422889b2ade611d664fe07392 --- diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 23e6171..47faccf 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -363,6 +363,7 @@ public: LottieColor solidColor() const noexcept{return mSolidLayer.mColor;} bool autoOrient() const noexcept{return mAutoOrient;} int timeRemap(int frameNo) const; + VSize layerSize() const {return mLayerSize;} public: struct SolidLayer { int mWidth{0}; @@ -378,6 +379,7 @@ public: long mInFrame{0}; long mOutFrame{0}; long mStartFrame{0}; + VSize mLayerSize; LottieBlendMode mBlendMode{LottieBlendMode::Normal}; float mTimeStreatch{1.0f}; std::string mPreCompRefId; diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp index 5732453..06d76d1 100644 --- a/src/lottie/lottieparser.cpp +++ b/src/lottie/lottieparser.cpp @@ -804,6 +804,10 @@ std::shared_ptr LottieParserImpl::parseLayer() layer->mTransform = parseTransformObject(ddd); } else if (0 == strcmp(key, "shapes")) { parseShapesAttr(layer); + } else if (0 == strcmp(key, "w")) { + layer->mLayerSize.setWidth(GetInt()); + } else if (0 == strcmp(key, "h")) { + layer->mLayerSize.setHeight(GetInt()); } else if (0 == strcmp(key, "sw")) { layer->mSolidLayer.mWidth = GetInt(); } else if (0 == strcmp(key, "sh")) { @@ -1944,7 +1948,10 @@ public: << "Composition:: a: " << !obj->isStatic() << ", v: " << obj->mVersion << ", stFm: " << obj->startFrame() - << ", endFm: " << obj->endFrame()<< "\n"; + << ", endFm: " << obj->endFrame() + << ", W: " << obj->size().width() + << ", H: " << obj->size().height() + << "\n"; level.append("\t"); visit(obj->mRootLayer.get(), level); level.erase(level.end() - 1, level.end()); @@ -1965,6 +1972,8 @@ public: << ", ts:" << obj->mTimeStreatch << ", ao:" << obj->autoOrient() << ", ddd:" << obj->mTransform->ddd() + << ", W:" << obj->layerSize().width() + << ", H:" << obj->layerSize().height() << "\n"; visitChildren(static_cast(obj), level); vDebug << level