From: Youngbok Shin Date: Fri, 24 Aug 2018 05:41:31 +0000 (+0900) Subject: lottie: fix issue - path was not updated properly for each painter item X-Git-Tag: submit/tizen/20180917.042405~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a752461b8fc31ef512ae55c83f56dcb25ca15c0a;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie: fix issue - path was not updated properly for each painter item It also adds debug message for polystar type. Change-Id: Ie1b788571d003402da0d518be484a0458df5dcec --- diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 8d57009..35be998 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -641,16 +641,15 @@ void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix, mPathChanged = false; // 1. update the local path if needed - if (!(mInit && mStaticPath) && hasChanged(frameNo)) { + if (hasChanged(frameNo)) { updatePath(mLocalPath, frameNo); - mInit = true; mPathChanged = true; + mNeedUpdate = true; } mTemp = mLocalPath; // 3. compute the final path with parentMatrix - if ((flag & DirtyFlagBit::Matrix) || mPathChanged) { mMatrix = parentMatrix; mPathChanged = true; @@ -659,10 +658,10 @@ void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix, const VPath & LOTPathDataItem::finalPath() { - if (mPathChanged) { + if (mPathChanged || mNeedUpdate) { mFinalPath.clone(mTemp); mFinalPath.transform(mMatrix); - mPathChanged = false; + mNeedUpdate = false; } return mFinalPath; } diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 1ef0ee3..b2d8a8f 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -193,20 +193,21 @@ private: class LOTPathDataItem : public LOTContentItem { public: - LOTPathDataItem(bool staticPath):mInit(false), mStaticPath(staticPath){} + LOTPathDataItem(bool staticPath): mStaticPath(staticPath){} void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) final; bool dirty() const {return mPathChanged;} const VPath &localPath() const {return mTemp;} const VPath &finalPath(); - void updatePath(const VPath &path) {mTemp.clone(path); mPathChanged = true;} + void updatePath(const VPath &path) {mTemp.clone(path); mPathChanged = true; mNeedUpdate = true;} + bool staticPath() const { return mStaticPath; } private: - bool mInit; bool mStaticPath; VPath mLocalPath; VPath mTemp; VPath mFinalPath; VMatrix mMatrix; bool mPathChanged{true}; + bool mNeedUpdate{true}; protected: virtual void updatePath(VPath& path, int frameNo) = 0; virtual bool hasChanged(int frameNo) = 0; @@ -235,6 +236,7 @@ protected: mCache.mRoundness = roundness; } bool hasChanged(int frameNo) final { + if (mCache.mFrameNo != -1 && staticPath()) return false; if (mCache.mFrameNo == frameNo) return false; VPointF pos = mData->mPos.value(frameNo); @@ -271,6 +273,7 @@ private: mCache.mSize = size; } bool hasChanged(int frameNo) final { + if (mCache.mFrameNo != -1 && staticPath()) return false; if (mCache.mFrameNo == frameNo) return false; VPointF pos = mData->mPos.value(frameNo); @@ -326,6 +329,7 @@ private: mCache.mRotation = rotation; } bool hasChanged(int frameNo) final { + if (mCache.mFrameNo != -1 && staticPath()) return false; if (mCache.mFrameNo == frameNo) return false; VPointF pos = mData->mPos.value(frameNo); diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp index beadb66..be8dbc9 100644 --- a/src/lottie/lottieparser.cpp +++ b/src/lottie/lottieparser.cpp @@ -1891,6 +1891,10 @@ public: { vDebug << "[ELLIPSE: static:" << e->isStatic() << "]"; } + void visit(LOTPolystarData *e) + { + vDebug << "[POLYSTAR: static:" << e->isStatic() << "]"; + } void visit(LOTTrimData *t) { vDebug << "[TRIM: static: " << t->isStatic() << " ]";