summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsubhransu mohanty <sub.mohanty@samsung.com>2018-07-09 19:32:41 +0900
committersubhransu mohanty <sub.mohanty@samsung.com>2018-07-09 19:32:41 +0900
commit1b324d7e0ea61523da951a61123f47e555ca77d0 (patch)
tree6884314dc1249be0b3399d867685b2682eebc651
parent0bcd85feed10e8d73becbebb8541aed5e2ce246f (diff)
lottie: update the static property of maskdata.
-rw-r--r--include/lottiemodel.h4
-rw-r--r--src/lottie/lottieparser.cpp5
2 files changed, 8 insertions, 1 deletions
diff --git a/include/lottiemodel.h b/include/lottiemodel.h
index f72e9f9..ab17b5a 100644
--- a/include/lottiemodel.h
+++ b/include/lottiemodel.h
@@ -634,12 +634,14 @@ public:
634 Substarct, 634 Substarct,
635 Intersect 635 Intersect
636 }; 636 };
637 LOTMaskData():mInv(false){} 637 LOTMaskData():mInv(false), mIsStatic(true){}
638 inline float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0;} 638 inline float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0;}
639 inline bool isStatic() const {return mIsStatic;}
639public: 640public:
640 LOTAnimatable<LottieShapeData> mShape; 641 LOTAnimatable<LottieShapeData> mShape;
641 LOTAnimatable<float> mOpacity; 642 LOTAnimatable<float> mOpacity;
642 bool mInv; 643 bool mInv;
644 bool mIsStatic;
643 LOTMaskData::Mode mMode; 645 LOTMaskData::Mode mMode;
644}; 646};
645 647
diff --git a/src/lottie/lottieparser.cpp b/src/lottie/lottieparser.cpp
index d81fcdd..8755122 100644
--- a/src/lottie/lottieparser.cpp
+++ b/src/lottie/lottieparser.cpp
@@ -719,6 +719,10 @@ LottieParserImpl::parseLayer()
719 staticFlag &= child.get()->isStatic(); 719 staticFlag &= child.get()->isStatic();
720 } 720 }
721 721
722 for (auto mask : layer->mMasks) {
723 staticFlag &= mask->isStatic();
724 }
725
722 layer->setStatic(staticFlag && 726 layer->setStatic(staticFlag &&
723 layer->mTransform->isStatic() && 727 layer->mTransform->isStatic() &&
724 !hasLayerRef); 728 !hasLayerRef);
@@ -773,6 +777,7 @@ LottieParserImpl::parseMaskObject()
773 Skip(key); 777 Skip(key);
774 } 778 }
775 } 779 }
780 obj->mIsStatic = obj->mShape.isStatic() && obj->mOpacity.isStatic();
776 return sharedMask; 781 return sharedMask;
777} 782}
778 783